summaryrefslogtreecommitdiff
path: root/src/systemctl
AgeCommit message (Collapse)Author
2015-10-27util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering
2015-10-26util-lib: split out user/group/uid/gid calls into user-util.[ch]Lennart Poettering
2015-10-26util-lib: split out IO related calls to io-util.[ch]Lennart Poettering
2015-10-25util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering
There are more than enough to deserve their own .c file, hence move them over.
2015-10-24path-util: unify how we process paths specified on the command lineLennart Poettering
Let's introduce a common function that makes relative paths absolute and warns about any errors while doing so.
2015-10-22systemctl: the various list commands actually can take any number of argumentsLennart Poettering
I accidentally broke this a while back when I ported systemctl to the verbs logic. Add support for this back.
2015-10-01systemctl: fix how we decode types and statesLennart Poettering
There was a bad memory access among other smaller issues.
2015-10-01systemctl: fix memory leak in systemctl_parse_argvreverendhomer
This commit fixes Coverity #1325228
2015-09-30Merge pull request #1422 from keszybz/sd-daemon-mq-badfLennart Poettering
sd-daemon: fix return value for sd_is_mq
2015-09-30Merge pull request #1419 from keszybz/shell-completionLennart Poettering
Shell completion tweaks
2015-09-30systemctl: do not set variable to be immediately overwrittenZbigniew Jędrzejewski-Szmek
2015-09-30systemctl: when reading legacy -t argument for shutdown, don't drop ↵Lennart Poettering
following parameter We currently completely ignore the following parameter, but we really should not, as that is actually the time to shut down on.
2015-09-30systemctl: various modernizationsLennart Poettering
2015-09-30tree-wide: use strempty() where possibleDaniel Mack
Also add a Coccinell patch to detect such locations in the future.
2015-09-29systemctl: when a shutdown is scheduled, always go via logindLennart Poettering
2015-09-29systemctl: minor modernizationsLennart Poettering
2015-09-29systemctl: port verb dispatching to generic verbs.[ch] codeLennart Poettering
Let's parse the command line the same way in our various tools.
2015-09-29systemctl: prefer shutting down through logind even as rootLennart Poettering
Otherwise, wall messages will not be generated for root.
2015-09-29systemctl: split out code invoking SetExitCode() into function of its ownLennart Poettering
2015-09-29systemctl: don't assert on the arguments array unnecessarilyLennart Poettering
In most verbs it's fine to treat the arguments array being NULL is empty array, hence do so.
2015-09-29systemctl: make use of strv_skip() where appropriateLennart Poettering
2015-09-29systemctl: make use of log_error_errno() where we canLennart Poettering
Also adds a couple of "return" statements, where they are missing.
2015-09-29systemctl: rework how we connect to bussesLennart Poettering
Sometimes we have to connect to the system manager directly (early boot, initrd, late boot, ...), sometimes through the system bus (unprivileged, remote, logind, ...). Instead of guessing in advance, which kind of connection we require (and sometimes guessing incorrectly), let's make sure each time we need bus connection we request the right bus explicitly. This way, we set up exactly the bus connections require, never guess incorrectly, and do so only immediately when necessary. As effect this reworks avoid_bus() into install_client_side(), since that's all it determines now: whether to install unit files client-side or server-side (i.e. in PID 1).
2015-09-29bus-util: rename bus_open_transport() to bus_connect_transport()Lennart Poettering
In sd-bus, the sd_bus_open_xyz() family of calls allocates a new bus, while sd_bus_default_xyz() family tries to reuse the thread's default bus. bus_open_transport() sometimes internally uses the former, sometimes the latter family, but suggests it only calls the former via its name. Hence, let's avoid this confusion, and generically rename the call to bus_connect_transport(). Similar for all related calls. And while we are at it, also change cgls + cgtop to do direct systemd connections where possible, since all they do is talk to systemd itself.
2015-09-29systemctl: rename parse_time_spec() to parse_shutdown_time_spec()Lennart Poettering
Let's clarify that this function is specific to shutdown time specifications, nothing else.
2015-09-29systemctl: conditionalize /dev/initctl fallback on HAVE_SYSV_COMPATLennart Poettering
2015-09-29systemctl: allocate arg_wall only on the heapLennart Poettering
Previously, we'd allocate it sometimes from the heap, but otherwise let it point directly int argv[]. Let's clean this up, so that we know exactly how to release its resources, and do so at the end.
2015-09-29systemctl: add 'const' where appropriateLennart Poettering
2015-09-29systemctl: remove client-side wall message supportLennart Poettering
logind sends out wall messages now, let's remove this from the systemctl client side hence. If people build systemd without logind support they won't get wall messages now, but that's OK.
2015-09-29systemctl: move strv_skip_first() out of systemctl.cLennart Poettering
Make it generic, call it strv_skip() and move it to strv.[ch]
2015-09-29systemctl: split out code that schedules shutdowsn into its own functionLennart Poettering
2015-09-29systemctl: rename all logind-specific functions to logind_xyz()Lennart Poettering
2015-09-29systemctl: move shutdown cancelling code into its own functionLennart Poettering
Let's make sure the main switch statement only invokes functions, but doesn't do anything real on its own.
2015-09-29systemctl: don't special case ACTION_RUNLEVEL anymoreLennart Poettering
Let's move its dispatching to the main switch statement.
2015-09-29systemctl: introduce a single function to set the wall messageLennart Poettering
Let's not have the same code three times, but reduce it to one function.
2015-09-29systemctl: make "systemctl is-system-running" return "offline" if we are not ↵Lennart Poettering
booted with systemd This sounds like the better place to expose this than in "systemd-notify --booted". Also document the so far undocumented "unknown" state the command might return. And rearrange the table of states documented to be more like the one for "is-running". Also, don't document the precise exit code of this function, just say errors are reported != 0 or > 0...
2015-09-29util: introduce common version() implementation and use it everywhereLennart Poettering
This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
2015-09-28Move all unit states to basic/ and extend systemctl --state=helpZbigniew Jędrzejewski-Szmek
2015-09-28systemctl: add --state=helpZbigniew Jędrzejewski-Szmek
This mirrors --type=help and simplifies completion scripts. The array of states is dense, so the is no need to check if the string is null.
2015-09-22Merge pull request #1334 from poettering/sd-bus-default-flush-closeDavid Herrmann
sd-bus: introduce new sd_bus_default_flush_close() call
2015-09-22cgtop: underline table headerLennart Poettering
Let's underline the header line of the table shown by cgtop, how it is customary for tables. In order to do this, let's introduce new ANSI underline macros, and clean up the existing ones as side effect.
2015-09-22sd-bus: introduce new sd_bus_default_flush_close() callLennart Poettering
If code enqueues a message on one of the default busses, but doesn't sync on it, and immediately drops the reference to the bus again, it will stay queued and consume memory. Intrdouce a new call sd_bus_default_flush_close() that can be invoked at the end of programs (or threads) and flushes out all unsent messages on any of the default busses.
2015-09-21containers: systemd exits with non-zero codeAlban Crequy
When a systemd service running in a container exits with a non-zero code, it can be useful to terminate the container immediately and get the exit code back to the host, when systemd-nspawn returns. This was not possible to do. This patch adds the following to make it possible: - Add a read-only "ExitCode" property on PID 1's "Manager" bus object. By default, it is 0 so the behaviour stays the same as previously. - Add a method "SetExitCode" on the same object. The method fails when called on baremetal: it is only allowed in containers or in user session. - Add support in systemctl to call "systemctl exit 42". It reuses the existing code for user session. - Add exit.target and systemd-exit.service to the system instance. - Change main() to actually call systemd-shutdown to exit() with the correct value. - Add verb 'exit' in systemd-shutdown with parameter --exit-code - Update systemctl manpage. I used the following to test it: | $ sudo rkt --debug --insecure-skip-verify run \ | --mds-register=false --local docker://busybox \ | --exec=/bin/chroot -- /proc/1/root \ | systemctl --force exit 42 | ... | Container rkt-895a0cba-5c66-4fa5-831c-e3f8ddc5810d failed with error code 42. | $ echo $? | 42 Fixes https://github.com/systemd/systemd/issues/1290
2015-09-21core: extend KillUnit() to return error when no unit was killedJan Synacek
2015-09-10Merge pull request #1227 from intelfx/systemctl-legacy-tools-polkitLennart Poettering
systemctl: fix various aspects of polkit authorization in legacy tools.
2015-09-10Merge pull request #1239 from poettering/cgroup-pidsDaniel Mack
core: add support for the "pids" cgroup controller
2015-09-10Merge pull request #1242 from poettering/no-off_tDaniel Mack
Drop usage of off_t
2015-09-10core: add support for the "pids" cgroup controllerLennart Poettering
This adds support for the new "pids" cgroup controller of 4.3 kernels. It allows accounting the number of tasks in a cgroup and enforcing limits on it. This adds two new setting TasksAccounting= and TasksMax= to each unit, as well as a gloabl option DefaultTasksAccounting=. This also updated "cgtop" to optionally make use of the new kernel-provided accounting. systemctl has been updated to show the number of tasks for each service if it is available. This patch also adds correct support for undoing memory limits for units using a MemoryLimit=infinity syntax. We do the same for TasksMax= now and hence keep things in sync here.
2015-09-10tree-wide: never use the off_t unless glibc makes us use itLennart Poettering
off_t is a really weird type as it is usually 64bit these days (at least in sane programs), but could theoretically be 32bit. We don't support off_t as 32bit builds though, but still constantly deal with safely converting from off_t to other types and back for no point. Hence, never use the type anymore. Always use uint64_t instead. This has various benefits, including that we can expose these values directly as D-Bus properties, and also that the values parse the same in all cases.
2015-09-10systemctl: add RequisiteOf* as inverses of Requisite and RequisiteOverridableEvgeny Vereshchagin