summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
AgeCommit message (Collapse)Author
2013-12-08systemctl: fix 'is-enabled'Zbigniew Jędrzejewski-Szmek
2013-12-08systemctl: simplify argument parsingZbigniew Jędrzejewski-Szmek
2013-12-08Help output spring cleaningZbigniew Jędrzejewski-Szmek
Use [brackets] only for optional elements. Use <optional> in XML sources.
2013-12-07systemctl: fix and refactor wait_for_jobsThomas Hindoe Paaboel Andersen
wait_for_jobs was ignoring the errors from the jobs stored in r. It would only ever return whether the call to sd_bus_remove_filter went ok. This patch changes it to return the first job related error encountered. If a job related error is found, then the result of the call to sd_bus_remove_filter is ignored. wait_for_jobs was a bit hard to read so I split it up to avoid the goto and deep nesting.
2013-12-06systemctl: allow globbing in list-<whatever> commandsZbigniew Jędrzejewski-Szmek
It is nicer to say 'systemctl list-units ssh\*' then to use grep, because colouring is preserved and it is easier to match just against the unit name.
2013-12-06Get rid of our reimplementation of basenameZbigniew Jędrzejewski-Szmek
The only problem is that libgen.h #defines basename to point to it's own broken implementation instead of the GNU one. This can be fixed by #undefining basename.
2013-12-06systemctl: check the value from start_unit_oneThomas Hindoe Paaboel Andersen
introduced in f459b6025f9368116d8c410376546c157314c205
2013-12-04systemctl: make an always true assert staticThomas Hindoe Paaboel Andersen
Silences a warning i clang
2013-12-04systemctl: no need to fdopen stdoutThomas Hindoe Paaboel Andersen
2013-12-03trivial coding style clean upsThomas Hindoe Paaboel Andersen
- Add space between if/for and the opening parentheses - Place the opening brace on same line as the function (not for udev) From the CODING_STYLE Try to use this: void foo() { } instead of this: void foo() { }
2013-11-30systemctl: do not show SourcePath when FragmentPath cannot be foundZbigniew Jędrzejewski-Szmek
Those files can be in a completely deferent format and also arbitrarily long, and usually contain information about other stuff. If we ever add SourceLine= or SourceLines= in addition to SourcePath=, and can show the relevant information only, this commit can be reverted.
2013-11-30systemctl: add "systemctl cat"Shawn Landden
2013-11-30systemctl: refactor show()Shawn Landden
v2, don't leave in unused function
2013-11-26systemctl: fix enable/disable reply handlingKay Sievers
2013-11-26systemctl: replace the three job mode options by a single --job-mode= optionLennart Poettering
Also, expose the new "flush" job mode this way.
2013-11-25systemctl: remove debug log messageLennart Poettering
2013-11-25systemctl: when status is called without arguments show pagerLennart Poettering
2013-11-22systemctl: indicate in list-dependencies whether a unit is already runningLennart Poettering
2013-11-21bus: rework message handlers to always take an error argumentLennart Poettering
Message handler callbacks can be simplified drastically if the dispatcher automatically replies to method calls if errors are returned. Thus: add an sd_bus_error argument to all message handlers. When we dispatch a message handler and it returns negative or a set sd_bus_error we send this as message error back to the client. This means errors returned by handlers by default are given back to clients instead of rippling all the way up to the event loop, which is desirable to make things robust. As a side-effect we can now easily turn the SELinux checks into normal function calls, since the method call dispatcher will generate the right error replies automatically now. Also, make sure we always pass the error structure to all property and method handlers as last argument to follow the usual style of passing variables for return values as last argument.
2013-11-20core: convert PID 1 to libsystemd-busLennart Poettering
This patch converts PID 1 to libsystemd-bus and thus drops the dependency on libdbus. The only remaining code using libdbus is a test case that validates our bus marshalling against libdbus' marshalling, and this dependency can be turned off. This patch also adds a couple of things to libsystem-bus, that are necessary to make the port work: - Synthesizing of "Disconnected" messages when bus connections are severed. - Support for attaching multiple vtables for the same interface on the same path. This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus calls which used an inappropriate signature. As a side effect we will now generate PropertiesChanged messages which carry property contents, rather than just invalidation information.
2013-11-18Remove duplicate includesKarel Zak
2013-11-18remove unused variablesThomas Hindoe Paaboel Andersen
2013-11-14systemctl: honor --no-legend in 'list-jobs'Mantas Mikulėnas
2013-11-12bus: rename sd_bus_send_with_reply_and_block() to sd_bus_call()Lennart Poettering
The call is one of the most important ones we expose, where we place major emphasis on. We should make sure to give it a short, memorable name.
2013-11-11systemctl: warning: ‘r’ may be used uninitialized in this functionKay Sievers
2013-11-11systemctl: avoid unitialized access when showing 0 timersZbigniew Jędrzejewski-Szmek
2013-11-11systemctl: add new "list-timers" commandLennart Poettering
2013-11-09systemctl: make sure daemon-reload returns successZbigniew Jędrzejewski-Szmek
Also change sd_bus_message_exit_container to return -ENOENT when not in a container, to make it easier to distinguish different errors.
2013-11-09systemctl: fix printing of individual propertiesZbigniew Jędrzejewski-Szmek
2013-11-08shutdown: unify handling of reboot() syscall a bitLennart Poettering
2013-11-08systemctl: properly initialize column widths for list-jobsLennart Poettering
2013-11-08systemctl: rename 'listen'Kay Sievers
src/systemctl/systemctl.c: In function ‘get_listening’: src/systemctl/systemctl.c:535:25: warning: declaration of ‘listen’ shadows a global declaration [-Wshadow] src/systemctl/systemctl.c: In function ‘list_sockets’: src/systemctl/systemctl.c:690:44: warning: declaration of ‘listen’ shadows a global declaration [-Wshadow]
2013-11-08systemctl: fix "reboot" callKay Sievers
2013-11-08systemctl: restore ability to directly connect to PID1 from systemctlLennart Poettering
2013-11-08systemctl: initialize variablesKay Sievers
2013-11-08systemctl: allow listing cgroups of containersLennart Poettering
2013-11-08systemctl: various cleanupsLennart Poettering
2013-11-08systemctl: port to libsystemd-busMarc-Antoine Perennou
2013-11-08systemctl: return r instead of always returning 0Michal Sekletar
2013-11-07systemctl: we show headers for list-units even when piped these days, hence ↵Lennart Poettering
do the same for list-jobs
2013-11-07systemctl: make LOAD column width dynamicMantas Mikulėnas
Otherwise 'not-found' overflows into the ACTIVE column.
2013-11-07Support additional argument in rebootWaLyong Cho
reboot syscall can be performed with an additional argument. In some systems this functionality can be useful to modify the mode of the next boot performed by the bootloader.
2013-11-06clients: unify how we invoke getopt_long()Lennart Poettering
Among other things this makes sure we always expose a --version command and show it in the help texts.
2013-11-01systemctl: fix typo in help textThomas Hindoe Paaboel Andersen
2013-10-27path_lookup: moved _cleanup_lookup_paths_free_ from install.c to path-lookup.hDaniel Buch
2013-10-14list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering
each invocation We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
2013-10-13Fix write-only use of a few variablesZbigniew Jędrzejewski-Szmek
Since the invention of read-only memory, write-only memory has been considered deprecated. Where appropriate, either make use of the value, or avoid writing it, to make it clear that it is not used.
2013-10-13Never call qsort on potentially NULL arraysZbigniew Jędrzejewski-Szmek
This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero.
2013-10-02systemctl: fix name mangling for sysv unitsVáclav Pavlín
2013-10-01systemctl: remove legacy upstart compatibilityCristian Rodríguez