summaryrefslogtreecommitdiffstats
path: root/src/systemctl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* support reboot -f for kexec kernelThomas Blume2015-08-121-0/+1
| | | | | | | | | | | | 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.
* tree-wide: introduce mfree()David Herrmann2015-07-311-2/+1
| | | | | | | | | Pretty trivial helper which wraps free() but returns NULL, so we can simplify this: free(foobar); foobar = NULL; to this: foobar = mfree(foobar);
* sd-bus: introduce new sd_bus_flush_close_unref() callLennart Poettering2015-07-031-5/+5
| | | | | | | | | | | | | | | | 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
* systemctl: fix edit when EDITOR contains argumentsJan Synacek2015-06-181-12/+25
| | | | | | | | 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
* everywhere: actually make use of DUAL_TIMESTAMP_NULL macroLennart Poettering2015-06-161-1/+1
| | | | Let's use it as initializer where appropriate.
* util: when creating temporary file names, allow including extra id string in itLennart Poettering2015-06-151-1/+1
| | | | | | | | | | | 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.
* tree-wide: fix memory leaks in users of bus_map_all_properties()David Herrmann2015-06-141-9/+12
| | | | | | | | | | 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.
* tree-wide: whenever we fork off a foreign child process reset signal ↵Lennart Poettering2015-06-101-0/+6
| | | | | | | | | | 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).
* systemctl: Use /usr/bin/editor if availableMichael Biebl2015-06-031-1/+1
| | | | | | | | | | | | | 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
* util: split out signal-util.[ch] from util.[ch]Lennart Poettering2015-05-291-0/+1
| | | | No functional changes.
* systemctl: Don't skip SysV init.d scripts when enabling/disabling unitsMartin Pitt2015-05-281-2/+11
| | | | | | | 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.
* systemctl: drop hardcoded chkconfig invocationMartin Pitt2015-05-282-6/+52
| | | | | | | | | | | | | | 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.
* util: split all hostname related calls into hostname-util.cLennart Poettering2015-05-181-0/+1
|
* systemctl: introduce --now for enable, disable and maskJan Synacek2015-05-151-4/+24
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=42940
* systemctl: fix check for template unitsThomas Hindoe Paaboel Andersen2015-05-121-1/+1
| | | | A typo from 7410616c. We want to ignore EINVAL but only catch errors.
* core: rename SystemdRunningAs to ManagerRunningAsLennart Poettering2015-05-111-1/+1
| | | | | | 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.
* treewide: Correct typos and spell plural of bus consistentTorstein Husebø2015-05-111-2/+2
|
* systemctl: null-initialize pointer with cleanup attributeDaniel Buch2015-05-061-1/+1
|
* core: rework unit name validation and manipulation logicLennart Poettering2015-05-061-46/+54
| | | | | | | | | | | | | | | 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
* systemctl: kill newline characters from log_error_errno() callsDaniel Mack2015-04-241-2/+2
| | | | log_error_errno() already adds a newline, so drop them.
* systemctl: talk to logind for scheduled shutdownsDaniel Mack2015-04-241-57/+103
| | | | | | | | | 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.
* shared/utmp-wtmp: add parameter for origin tty and callback userdataDaniel Mack2015-04-241-2/+2
| | | | | | | | | 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.
* systemctl: avoid bumping NOFILE rlimit unless neededZbigniew Jędrzejewski-Szmek2015-04-151-5/+6
| | | | | | | 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
* shared: add terminal-util.[ch]Ronny Chevalier2015-04-111-0/+1
|
* shared: add process-util.[ch]Ronny Chevalier2015-04-101-0/+1
|
* shared: add formats-util.hRonny Chevalier2015-04-101-0/+1
|
* systemctl: Use logind for --firmware-setup if possibleJan Janssen2015-04-081-5/+43
|
* logind,systemctl: add reboot to EFI firmware supportJan Janssen2015-04-071-0/+15
|
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-131-2/+2
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* systemctl: remove dead checkZbigniew Jędrzejewski-Szmek2015-03-071-2/+2
| | | | | | r could never be less than zero. CID #1271350.
* core: expose consumed CPU time per unitLennart Poettering2015-03-021-0/+9
| | | | | | 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.
* systemctl: bump NOFILE only for systemctl_mainZbigniew Jędrzejewski-Szmek2015-02-241-5/+5
| | | | | | It is not necessary when running as telinit, etc. https://bugzilla.redhat.com/show_bug.cgi?id=1184712
* systemctl: support auditd.service betterZbigniew Jędrzejewski-Szmek2015-02-241-23/+23
| | | | | | | | | | 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.
* systemctl: check validity of PID we receivedZbigniew Jędrzejewski-Szmek2015-02-241-1/+4
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-6/+0
| | | | | | 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.
* everywhere: remove configurability of sysv runlevel to target mappingLennart Poettering2015-02-181-4/+4
| | | | | | | | | | | | | | | 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.
* systemctl: allow interactive authorization for all bus callsLennart Poettering2015-02-181-173/+74
| | | | | | | | | 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.
* systemctl: let's make use of FOREACH_STRING() where we canLennart Poettering2015-02-181-13/+13
|
* Transpose args in strv_fnmatch() to be more ooZbigniew Jędrzejewski-Szmek2015-02-161-4/+4
|
* Add helper for fnmatch over strvZbigniew Jędrzejewski-Szmek2015-02-161-44/+7
|
* remove unused variableThomas Hindoe Paaboel Andersen2015-02-121-1/+0
|
* systemctl: don't update the reboot parameter if none is givenMichael Olbrich2015-02-111-1/+1
| | | | | | 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"
* systemctl: unit_find_paths(): unify error handling in two code pathesIvan Shapovalov2015-02-051-28/+35
|
* systemctl: cat, edit: further polish error messagesIvan Shapovalov2015-02-051-10/+10
|
* systemctl: cat: fix error handlingIvan Shapovalov2015-02-051-3/+3
| | | | | - correctly check for local vs. remote transport - return after receiving error from expand_names()
* systemctl: cat, edit: improve unit load error reportingIvan Shapovalov2015-02-051-14/+40
| | | | | | | - report actual load error for units which could not be loaded - make unit_find_paths() report all kinds of errors it encounters (for consistency) - consistently handle not-found errors in cat() and edit()
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-031-3/+3
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* systemctl: refuse --host with catZbigniew Jędrzejewski-Szmek2015-01-291-0/+5
| | | | | | This might be fixed one day, but for now it's better to fail. https://bugzilla.redhat.com/show_bug.cgi?id=1186952
* systemctl: bugfix for systemctl reboot command with argumentSangjung Woo2015-01-231-1/+7
| | | | | | | According to systemctl man page, 'systemctl reboot [arg]' should work without any errors. However, it does not work because of 'Invalid number of arguments' error, except for 'reboot [arg]'. This patch fixes the bug so that both of commands work in exactly the same way.
* core: add a property that shows the current memory usage of a unitLennart Poettering2015-01-231-1/+23
| | | | | This is exposed the memory.usage_in_bytes cgroup property on the bus, and makes "systemctl status" show it in its default output.