summaryrefslogtreecommitdiff
path: root/src/systemctl
AgeCommit message (Collapse)Author
2014-05-15Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek
No functional change expected :)
2014-05-15Make systemctl --root look for files in the proper placesZbigniew Jędrzejewski-Szmek
Running systemctl enable/disable/set-default/... with the --root option under strace reveals that it accessed various files and directories in the main fs, and not underneath the specified root. This can lead to correct results only when the layout and configuration in the container are identical, which often is not the case. Fix this by adding the specified root to all file access operations. This patch does not handle some corner cases: symlinks which point outside of the specified root might be interpreted differently than they would be by the kernel if the specified root was the real root. But systemctl does not create such symlinks by itself, and I think this is enough of a corner case not to be worth the additional complexity of reimplementing link chasing in systemd. Also, simplify the code in a few places and remove an hypothetical memory leak on error.
2014-05-15sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables ↵Lennart Poettering
attached to a bus connection This makes callback behaviour more like sd-event or sd-resolve, and creates proper object for unregistering callbacks. Taking the refernce to the slot is optional. If not taken life time of the slot will be bound to the underlying bus object (or in the case of an async call until the reply has been recieved).
2014-05-10systemctl: return an error code is status failsZbigniew Jędrzejewski-Szmek
This got lost in the refactoring in f74294c1dabb4. Also make sure that the return code corresponds to the *first* failure, not the last. https://lists.fedoraproject.org/pipermail/devel/2014-May/199080.html
2014-04-23delta: draw arrows with draw_special_char()Lennart Poettering
Let's unify generation of unicode chars at one place. Also, don't add an extra space into chars we print, except for the tree chars where this is really necessary.
2014-04-21systemctl: delete REBOOT_PARAM_FILE if no parameter is specifiedMichael Olbrich
And move it to sperate function.
2014-04-16systemctl: allow to change the default target without the --force switchDjalal Harouni
Currently "systemctl set-default" will fail to change the default target due to the 'default.target' being a symlink which is always the case. To work around this, the user must specify the "--force" switch to be able to overwrite the existing symlink. This is clearly a regression that was introduced by commit 718db96199e since it worked before without the "--force" switch and the man pages do not mention that you need to specify it. It is expected that this is a symlink. So just explicity set the force flag to make it work again. https://bugs.freedesktop.org/show_bug.cgi?id=76623 Reported-by: <code@progandy.de>
2014-04-16systemctl: add --recursive for list-timersThomas Hindoe Paaboel Andersen
2014-04-16systemctl: add --recursive for list-socketsThomas Hindoe Paaboel Andersen
2014-04-12Unify GREEDY_REALLOC and GREEDY_REALLOC_TZbigniew Jędrzejewski-Szmek
greedy_realloc() and greedy_realloc0() now store the allocated size as the count, not bytes. Replace GREEDY_REALLOC uses with GREEDY_REALLOC_T everywhere, and then rename GREEDY_REALLOC_T to GREEDY_REALLOC. It is just too error-prone to have two slightly different macros which do the same thing.
2014-04-05systemctl: update NAME to PATTERN in help()Zbigniew Jędrzejewski-Szmek
Previously the man page was modified, but not help().
2014-03-27systemctl: fix spelling in commentBrandon Philips
2014-03-24timer: support timers that can resume the system from suspendLennart Poettering
2014-03-24systemctl: show last trigger time in "systemctl list-timers"Lennart Poettering
2014-03-18systemctl: sort local host entry before container in list-machines outputLennart Poettering
2014-03-18systemctl: prefix list-units and list-machines output with a circle ↵Lennart Poettering
indicating a failure state (Subject to --no-legend)
2014-03-17systemctl: introduce -r switch to show units running in local containers in ↵Lennart Poettering
addition to the host
2014-03-16Use strlen even for constant stringsJosh Triplett
GCC optimizes strlen("string constant") to a constant, even with -O0. Thus, replace patterns like sizeof("string constant")-1 with strlen("string constant") where possible, for clarity. In particular, for expressions intended to add up the lengths of components going into a string, this often makes it clearer that the expression counts the trailing '\0' exactly once, by putting the +1 for the '\0' at the end of the expression, rather than hidden in a sizeof in the middle of the expression.
2014-03-14utmp-wtmp: allow overriding username on wallSebastian Thorarensen
utmp_wall() now takes an optional argument 'username_override' which allows the caller to override the username shown on wall messages. journald will use this to inform users that its wall messages comes from 'systemd-journald'.
2014-03-13systemctl: autopage always if systemctl status is invoked without argsLennart Poettering
2014-03-13systemctl: suppress duplicate newline if there's not log output in ↵Lennart Poettering
"systemctl status"
2014-03-13systemctl: reorder verbsLennart Poettering
2014-03-13systemctl: make sure status -a doesn't terminate too soonLennart Poettering
2014-03-13systemctl: show a colored red dot in "status" output indicating the state of ↵Lennart Poettering
a unit
2014-03-12systemctl: when "systemctl status" is called without arguments show a short ↵Lennart Poettering
overall system state Previously "systemctl status" without argument would print the status of all loaded units. This has now been moved to "systemctl status -a".
2014-03-12systemctl: add new "list-machines" commandLennart Poettering
"systemctl list-machines" shows one line per local container which includes the current system state of the container, the number of failed units as well as the number of currently queued jobs.
2014-03-11systemctl: for switch-root check, if we switch to a systemd initHarald Hoyer
If "systemctl switch-root" is called with a specific "INIT" or /proc/cmdline contains "init=", then systemd would not serialize itsself. Let systemctl check, if the new init is in the standard systemd installation path and if so, clear the INIT parameter, to let systemd serialize itsself.
2014-03-05systemd-run: add new --property= switch that can set arbitrary properties ↵Lennart Poettering
for the unit that is created The code for parsing these properties is shared with "systemctl set-property", which means all the resource control settings are immediately available.
2014-03-04Introduce strv_consume which takes ownershipZbigniew Jędrzejewski-Szmek
This mirrors set_consume and makes the common use a bit nicer.
2014-02-25Replace /var/run with /run in remaining placesZbigniew Jędrzejewski-Szmek
/run was already used almost everywhere, fix the remaining places for consistency.
2014-02-23systemctl: move next elapse calculation to its own functionDjalal Harouni
2014-02-23core: clean up some confusing regarding SI decimal and IEC binary suffixes ↵Lennart Poettering
for sizes According to Wikipedia it is customary to specify hardware metrics and transfer speeds to the basis 1000 (SI decimal), while software metrics and physical volatile memory (RAM) sizes to the basis 1024 (IEC binary). So far we specified everything in IEC, let's fix that and be more true to what's otherwise customary. Since we don't want to parse "Mi" instead of "M" we document each time what the context used is.
2014-02-21systemctl: fix compiler warning in list_timers()Daniel Mack
get_next_elapse() will always fill 'next' with values when it returns >= 0. Hence, the compiler is wrong about this warning. Initialize 'next' nevertheless. src/systemctl/systemctl.c: In function ‘list_timers’: src/systemctl/systemctl.c:953:43: warning: ‘next.monotonic’ may be used uninitialized in this function [-Wmaybe-uninitialized] converted = nw.realtime - (nw.monotonic - next.monotonic); ^ In file included from ./src/shared/log.h:30:0, from src/systemctl/systemctl.c:46: ./src/shared/macro.h:137:38: warning: ‘next.realtime’ may be used uninitialized in this function [-Wmaybe-uninitialized] _a < _b ? _a : _b; \ ^ src/systemctl/systemctl.c:933:32: note: ‘next.realtime’ was declared here dual_timestamp next; ^
2014-02-20api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering
first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
2014-02-19systemctl: remove erroneous return in runlevel_parse_argv()Maciej Wereski
2014-02-13systemctl: fix exit statuses from is-active/is-failedDave Reisner
This was inadvertantly disturbed in e3e0314b when glob support was added.
2014-02-13core: add SystemCallArchitectures= unit setting to allow disabling of non-nativeLennart Poettering
architecture support for system calls Also, turn system call filter bus properties into complex types instead of concatenated strings.
2014-02-10includes: remove duplicate includesTom Gundersen
Found by the new check-includes make target.
2014-01-20systemctl: skip native unit file handling if sysv file handling already ↵Lennart Poettering
handled everything Issue pointed out by Colin Guthrie.
2014-01-15systemctl: introduce new "import-environment" commandLennart Poettering
This may be used in graphical session start-up scripts to upload environment variables such as $DISPLAY into the systemd manager easily.
2014-01-05strv: multiple cleanupsSimon Peeters
- turn strv_merge into strv_extend_strv. appending strv b to the end of strv a instead of creating a new strv - strv_append: remove in favor of strv_extend and strv_push. - strv_remove: write slightly more elegant - strv_remove_prefix: remove unused function - strv_overlap: use strv_contains - strv_printf: STRV_FOREACH handles NULL correctly
2014-01-04systemctl: improve readability on failed commandsThomas Hindoe Paaboel Andersen
Not long ago a failed command would print: "Failed to start something.service: ..." regardless of whether the command was to start/stop/restart/etc. With e3e0314 this was improved to print the method used. E.g. for stopping: "Failed to StopUnit something.service: ..." This patch matches the method to a more human readable word. E.g: "Failed to stop something.service: ..."
2013-12-27systemctl: remove unused variableThomas Hindoe Paaboel Andersen
2013-12-26Use enums to make it obvious what boolean params meanZbigniew Jędrzejewski-Szmek
Suggested-by: Russ Allbery <rra@debian.org>
2013-12-26systemctl: allow globbing in commands which take multiple unit namesZbigniew Jędrzejewski-Szmek
2013-12-26systemctl: drop uninteresting units immediatelyZbigniew Jędrzejewski-Szmek
Also properly free memory if list-unit-files --root=... is used.
2013-12-26systemctl: simplify start_unitZbigniew Jędrzejewski-Szmek
2013-12-22systemctl: also color filenames of drop-ins in catZbigniew Jędrzejewski-Szmek
2013-12-21systemctl: fix bad memory access when processing PIDs on the "systemctl ↵Lennart Poettering
status" command line
2013-12-18systemct: add empty line between units in catZbigniew Jędrzejewski-Szmek