summaryrefslogtreecommitdiff
path: root/src/systemctl
AgeCommit message (Collapse)Author
2015-09-09tree-wide: drop {} from one-line if blocksLennart Poettering
Patch via coccinelle.
2015-09-08systemctl: add ConsistsOf as the inverse of PartOfEvgeny Vereshchagin
2015-09-07systemctl: a number of cleanups regarding error handling in systemctlLennart Poettering
2015-09-01cgroup: drop "ignore_self" argument from cg_is_empty()Lennart Poettering
In all cases where the function (or cg_is_empty_recursive()) ignoring the calling process is actually wrong, as a process keeps a cgroup busy regardless if its the current one or another. Hence, let's simplify things and drop the "ignore_self" parameter.
2015-08-25Revert "systemctl: properly handle empty control group paths in "status""Lennart Poettering
This reverts commit b04c25f9ef6359ed0ae403bdbfe4df840aba0f58.
2015-08-25Merge pull request #1022 from poettering/machinectl-shellTom Gundersen
Add new "machinectl shell" command for su(1)-like behaviour
2015-08-25logind/systemctl: introduce SetWallMessage and --messageJan Synacek
Enable unprivileged users to set wall message on a shutdown operation. When the message is set via the --message option, it is logged together with the default shutdown message. $ systemctl reboot --message "Applied kernel updates." $ journalctl -b -1 ... systemd-logind[27]: System is rebooting. (Applied kernel updates.) ...
2015-08-24systemctl: properly handle empty control group paths in "status"Lennart Poettering
When showing the status of the "-.slice" slice root unit (whose reported cgroup path is ""), we suppressed the cgroup tree so far, because skipped it for all unit with an empty cgroup path. Let's fix that, and properly handle the empty cgroup path.
2015-08-12support reboot -f for kexec kernelThomas Blume
Fix error message: -->-- Code should not be reached 'Unknown action.' at src/systemctl/systemctl.c:6382, function halt_now(). Aborting. Aborted --<-- when executing 'reboot -f' from a system running a kexec kernel.
2015-07-31tree-wide: introduce mfree()David Herrmann
Pretty trivial helper which wraps free() but returns NULL, so we can simplify this: free(foobar); foobar = NULL; to this: foobar = mfree(foobar);
2015-07-03sd-bus: introduce new sd_bus_flush_close_unref() callLennart Poettering
sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush() (which writes all unwritten messages out) + sd_bus_close() (which terminates the connection, releasing all unread messages) + sd_bus_unref() (which frees the connection). The combination of this call is used pretty frequently in systemd tools right before exiting, and should also be relevant for most external clients, and is hence useful to cover in a call of its own. Previously the combination of the three calls was already done in the _cleanup_bus_close_unref_ macro, but this was only available internally. Also see #327
2015-06-18systemctl: fix edit when EDITOR contains argumentsJan Synacek
Correctly support cases when the EDITOR environment variable and friends also contain arguments. For example, to run emacs in terminal only, one can say: EDITOR="emacs -nw" systemctl edit myservice
2015-06-16everywhere: actually make use of DUAL_TIMESTAMP_NULL macroLennart Poettering
Let's use it as initializer where appropriate.
2015-06-15util: when creating temporary file names, allow including extra id string in itLennart Poettering
This adds a "char *extra" parameter to tempfn_xxxxxx(), tempfn_random(), tempfn_ranomd_child(). If non-NULL this string is included in the middle of the newly created file name. This is useful for being able to distuingish the kind of temporary file when we see one. This also adds tests for the three call. For now, we don't make use of this at all, but port all users over.
2015-06-14tree-wide: fix memory leaks in users of bus_map_all_properties()David Herrmann
If you use bus_map_all_properties(), you must be aware that it might touch output variables even though it may fail. This is, because we parse many different bus-properties and cannot tell how to clean them up, in case we fail deep down in the parser. Fix all callers of bus_map_all_properties() to correctly cleanup any context structures at all times.
2015-06-10tree-wide: whenever we fork off a foreign child process reset signal ↵Lennart Poettering
mask/handlers Also, when the child is potentially long-running make sure to set a death signal. Also, ignore the result of the reset operations explicitly by casting them to (void).
2015-06-03systemctl: Use /usr/bin/editor if availableMichael Biebl
If the EDITOR environment variable is not set, the Debian policy recommends to use the /usr/bin/editor program as default editor. This file is managed via the dpkg alternatives mechanism and typically used in Debian/Ubuntu and derivatives to configure the default editor. See section 11.4 of the Debian policy [1]. Therefor prefer /usr/bin/editor over specific editors if available. [1] https://www.debian.org/doc/debian-policy/ch-customized-programs.html
2015-05-29util: split out signal-util.[ch] from util.[ch]Lennart Poettering
No functional changes.
2015-05-28systemctl: Don't skip SysV init.d scripts when enabling/disabling unitsMartin Pitt
If there is both a SysV init.d script and a systemd unit for a given name, we want to do the same enable/disable operation for both, instead of just on the systemd unit. This keeps the enablement status in sync so that switching init systems behaves as expected.
2015-05-28systemctl: drop hardcoded chkconfig invocationMartin Pitt
Introduce /usr/lib/systemd/systemd-sysv-install [--root=] <action> <name> abstraction, replacing the direct calling of chkconfig. This allows distributions to call their specific tools like update-rc.d without patching systemd. Ship systemd-sysv-install.SKELETON as an example for packagers how to implement this. Drop the --enable-chkconfig configure option. Document this in README and point to it in NEWS.
2015-05-18util: split all hostname related calls into hostname-util.cLennart Poettering
2015-05-15systemctl: introduce --now for enable, disable and maskJan Synacek
https://bugs.freedesktop.org/show_bug.cgi?id=42940
2015-05-12systemctl: fix check for template unitsThomas Hindoe Paaboel Andersen
A typo from 7410616c. We want to ignore EINVAL but only catch errors.
2015-05-11core: rename SystemdRunningAs to ManagerRunningAsLennart Poettering
It's primarily just a property of the Manager object after all, and we try to refer to PID 1 as "manager" instead of "systemd", hence let's to stick to this here too.
2015-05-11treewide: Correct typos and spell plural of bus consistentTorstein Husebø
2015-05-06systemctl: null-initialize pointer with cleanup attributeDaniel Buch
2015-05-05core: rework unit name validation and manipulation logicLennart Poettering
A variety of changes: - Make sure all our calls distuingish OOM from other errors if OOM is not the only error possible. - Be much stricter when parsing escaped paths, do not accept trailing or leading escaped slashes. - Change unit validation to take a bit mask for allowing plain names, instance names or template names or an combination thereof. - Refuse manipulating invalid unit name
2015-04-24systemctl: kill newline characters from log_error_errno() callsDaniel Mack
log_error_errno() already adds a newline, so drop them.
2015-04-24systemctl: talk to logind for scheduled shutdownsDaniel Mack
Drop the code which communicates with shutdownd via its private socket, and use the functionality in logind instead. The code pathes which talk to logind have to create their own ad-hoc bus connection because by default, systemctl connects to systemd's private socket.
2015-04-24shared/utmp-wtmp: add parameter for origin tty and callback userdataDaniel Mack
Instead of looking up the tty from STDIN, let utmp_wall() take an argument to specify an origin tty for the wall message. Only if that argument is NULL do the STDIN lookup. Also add an void *userdata argument that is handed back to the callback function.
2015-04-14systemctl: avoid bumping NOFILE rlimit unless neededZbigniew Jędrzejewski-Szmek
We actually only use the journal when showing status. Move setrlimit call so it is only called for status. https://bugzilla.redhat.com/show_bug.cgi?id=1184712
2015-04-11shared: add terminal-util.[ch]Ronny Chevalier
2015-04-10shared: add process-util.[ch]Ronny Chevalier
2015-04-10shared: add formats-util.hRonny Chevalier
2015-04-08systemctl: Use logind for --firmware-setup if possibleJan Janssen
2015-04-07logind,systemctl: add reboot to EFI firmware supportJan Janssen
2015-03-13tree-wide: there is no ENOTSUP on linuxDavid Herrmann
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
2015-03-07systemctl: remove dead checkZbigniew Jędrzejewski-Szmek
r could never be less than zero. CID #1271350.
2015-03-02core: expose consumed CPU time per unitLennart Poettering
This adds support for showing the accumulated consumed CPU time per-unit in the "systemctl status" output. The property is also readable via the bus.
2015-02-24systemctl: bump NOFILE only for systemctl_mainZbigniew Jędrzejewski-Szmek
It is not necessary when running as telinit, etc. https://bugzilla.redhat.com/show_bug.cgi?id=1184712
2015-02-23systemctl: support auditd.service betterZbigniew Jędrzejewski-Szmek
We would print the filename header before trying to open the file. But since the header was printed to stdout, and the error to stderr, the error would appear on the terminal before the header. It is cleaner to open the file first, then and only then print the header. Also exit on first error. We shouldn't report success if we were unable to open a file.
2015-02-23systemctl: check validity of PID we receivedZbigniew Jędrzejewski-Szmek
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-02-18everywhere: remove configurability of sysv runlevel to target mappingLennart Poettering
With this change runlevel 2, 3, 4 are mapped to multi-user.target for good, and 5 to graphical.target. This was already the previous mapping but is now no longer reconfigurable, but hard-coded into the core. This should generally simplify things, but also fix one bug: the sysv-generator previously generated symlinks to runlevel[2-5].target units, which possibly weren't picked up if these aliases were otherwise only referenced by the real names "multi-user.target" and "graphical.target". We keep compat aliases "runlevel[2345].target" arround for cases where this target name is explicitly requested.
2015-02-18systemctl: allow interactive authorization for all bus callsLennart Poettering
Make use of the new sd_bus_set_allow_interactive_authorization() call to globally enable interactive authorization. Also, turn on PK agent for more calls. This allows us to make use of the sd_bus_call_method() convencience helper at more places.
2015-02-18systemctl: let's make use of FOREACH_STRING() where we canLennart Poettering
2015-02-16Transpose args in strv_fnmatch() to be more ooZbigniew Jędrzejewski-Szmek
2015-02-16Add helper for fnmatch over strvZbigniew Jędrzejewski-Szmek
2015-02-12remove unused variableThomas Hindoe Paaboel Andersen
2015-02-11systemctl: don't update the reboot parameter if none is givenMichael Olbrich
Otherwise systemd-reboot.service will remove the parameter that was set before. This was broken in commit "b986229efe2cc96157aa14c37bab7843311bbef1 systemctl: bugfix for systemctl reboot command with argument"