Commit graph

227 commits

Author SHA1 Message Date
Lennart Poettering 477def8097 shutdown: unify handling of reboot() syscall a bit 2013-11-08 19:32:45 +01:00
Lennart Poettering 6d6d40c910 systemctl: properly initialize column widths for list-jobs 2013-11-08 18:57:43 +01:00
Kay Sievers 0d95178e49 systemctl: rename 'listen'
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-08 18:52:09 +01:00
Kay Sievers 4aa2beacb1 systemctl: fix "reboot" call 2013-11-08 17:49:59 +01:00
Lennart Poettering 41dd15e474 systemctl: restore ability to directly connect to PID1 from systemctl 2013-11-08 17:07:42 +01:00
Kay Sievers a9616cd17f systemctl: initialize variables 2013-11-08 15:21:50 +01:00
Lennart Poettering 7af5a806d1 systemctl: allow listing cgroups of containers 2013-11-08 14:07:27 +01:00
Lennart Poettering cbc9fbd131 systemctl: various cleanups 2013-11-08 14:07:27 +01:00
Marc-Antoine Perennou f459b6025f systemctl: port to libsystemd-bus 2013-11-08 14:07:27 +01:00
Michal Sekletar c6581cc14f systemctl: return r instead of always returning 0 2013-11-08 00:20:09 +01:00
Lennart Poettering 0d49cfa264 systemctl: we show headers for list-units even when piped these days, hence do the same for list-jobs 2013-11-07 21:02:48 +01:00
Mantas Mikulėnas a1074881b4 systemctl: make LOAD column width dynamic
Otherwise 'not-found' overflows into the ACTIVE column.
2013-11-07 01:23:54 -05:00
WaLyong Cho 37185ec80a Support additional argument in reboot
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-07 01:23:54 -05:00
Lennart Poettering eb9da376d7 clients: unify how we invoke getopt_long()
Among other things this makes sure we always expose a --version command
and show it in the help texts.
2013-11-06 18:28:39 +01:00
Thomas Hindoe Paaboel Andersen 76fdc9669a systemctl: fix typo in help text 2013-11-01 20:46:49 +01:00
Daniel Buch fb15be8395 path_lookup: moved _cleanup_lookup_paths_free_ from install.c to path-lookup.h 2013-10-27 11:51:22 -04:00
Lennart Poettering 71fda00f32 list: make our list macros a bit easier to use by not requring type spec on 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-14 06:11:19 +02:00
Zbigniew Jędrzejewski-Szmek 872c8faaf2 Fix write-only use of a few variables
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-13 17:56:54 -04:00
Zbigniew Jędrzejewski-Szmek 7ff7394d9e Never call qsort on potentially NULL arrays
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-13 17:56:54 -04:00
Václav Pavlín cbb13b2a53 systemctl: fix name mangling for sysv units 2013-10-02 16:42:53 +02:00
Cristian Rodríguez ba5ecfcdbb systemctl: remove legacy upstart compatibility 2013-10-01 03:23:08 +02:00
Lennart Poettering 68372da693 systemctl: make sure set-property mangles unit names 2013-09-27 00:11:54 +02:00
Dave Reisner 184ecaf794 systemctl: Avoid ellipsizing when piping output 2013-09-19 17:39:49 -04:00
Lennart Poettering ddca82aca0 cgroup: get rid of MemorySoftLimit=
The cgroup attribute memory.soft_limit_in_bytes is unlikely to stay
around in the kernel for good, so let's not expose it for now. We can
readd something like it later when the kernel guys decided on a final
API for this.
2013-09-17 14:58:00 -05:00
Kay Sievers 6e869e18c0 shut up gcc complaining about freeing a const variable 2013-09-12 23:37:23 +02:00
Michal Sekletar c1e784feb4 systemctl: process only signals for jobs we really wait for
wait_filter() callback shouldn't process JobRemove signals for arbitrary
jobs. It should only deal with signals for jobs which are included in
set of jobs we wait for.
2013-09-12 18:09:08 +02:00
Gao feng b8ab2dc6c9 systemctl: show BlockIODeviceWeight for unit
We can use systemctl show unitname to show the BlockIODeviceWeight
of unit.
2013-09-10 18:32:32 +02:00
Gao feng 7239c1707a systemcl: add support for setting BlockIODeviceWeight for unit
This patch allows user to set up BlockIODeviceWeight for unit
through systemctl. Such as

systemctl set-property sshd.service BlockIODeviceWeight="/dev/sda 100"
2013-09-10 18:31:43 +02:00
Gao feng 670612567b systemcl: add support for setting BlockIORead/WriteBandwidth for unit
This patch allows user to set up BlockIOReadBandwidth and BlockIOWriteBandwidth
for unit through systemctl. Such as

systemctl set-property sshd.service BlockIOReadBandwidth="/dev/sda 100000"
systemctl set-property sshd.service BlockIOWriteBandwidth="/dev/sda 200000"
2013-09-10 17:29:55 +02:00
Zbigniew Jędrzejewski-Szmek 94e0bd7db1 systemctl: show hint about --full when lines don't fit 2013-08-11 18:10:34 -04:00
Lennart Poettering f535088ef7 systemctl: add missing newline to --help output 2013-08-09 19:05:07 +02:00
Daniel Schaal 0b5a519c89 systemd-delta: Only print colors when on a tty
This make systemd-delta follow the behaviour of systemctl
and journalctl.

https://bugs.freedesktop.org/show_bug.cgi?id=67656

[zj: unify color query methods between those three programs.]
2013-08-04 08:33:02 -04:00
Lennart Poettering a521ae4a56 systemctl: rearrange --help output a bit 2013-07-26 17:11:41 +02:00
Lennart Poettering 223ab9345d systemctl: remove "load" command
"systemctl load" has always been racy since the GC could hit any time,
before making use of the loaded unit. Very recent systemd will run GC
immeidately after all unit state changes which has the effect that the
the effect of "systemctl load" is completely gone now, so let's remove
the support for it in "systemctl" for good.
2013-07-26 17:05:43 +02:00
Lennart Poettering a65615ca5d systemctl: move set-log-level to systemd-analyze
"systemctl set-log-level" is a command for analysis and tracing hence
"systemd-analyze" should be the better home for it, thus allowing us to
make the overly large "systemctl" a bit smaller.
2013-07-26 16:59:55 +02:00
Lennart Poettering 9ea9d4cf16 systemctl: move "dump" command from systemctl to systemd-analyze
It's an analysis command and its format is explicitly not covered by any
stability guarantees, hence move away from systemctl and into
systemd-analyze, minimizing the already large interface of systemctl a
bit.

This patch also adds auto-paging to the various systemd-analyze commands
where that makes sense
2013-07-26 16:36:25 +02:00
Lennart Poettering 83787333bd man: update documentation of systemctl cgroup commands 2013-07-19 19:29:08 +02:00
Maciej Wereski 9b9b3d36b8 systemctl: option to list units by state
This allows to show only units with specified LOAD or SUB or ACTIVE state.
2013-07-18 19:50:04 +02:00
Zbigniew Jędrzejewski-Szmek 52990c2e0e systemd,systemctl: export condition status and show failing condition
$ systemctl --user status hoohoo
hoohoo.service
   Loaded: loaded (/home/zbyszek/.config/systemd/user/hoohoo.service; static)
   Active: inactive (dead)
           start condition failed at Tue 2013-06-25 18:08:42 EDT; 1s ago
           ConditionPathExists=/tmp/hoo was not met

Full information is exported over D-Bus:
  [(condition, trigger, negate, param, state),...]
where state is one of "failed" (<0), "untested" (0), "OK" (>0).
I've decided to use 0 for "untested", because it might be useful to
differentiate different types of failure later on, without breaking
compatibility.

systemctl shows the failing condition, if there was a non-trigger
failing condition, or says "none of the trigger conditions were met",
because there're often many trigger conditions, and they must all
fail for the condition to fail, so printing them all would consume
a lot of space, and bring unnecessary attention to something that is
quite low-level.
2013-07-17 23:41:10 -04:00
Lennart Poettering 2ce982f9b1 systemctl: also highlight a load state of "not-found" as red
"not-found" is a recently added load state and was previously just a
special case of "error". Since it also indicates a load error we should
also highlight it red, the same way as "error" was treated before.
2013-07-18 02:32:34 +02:00
Lukas Nykryn 66a6931494 systemctl: remove unused variable 2013-07-12 01:10:04 +02:00
Lennart Poettering 042f9f5e5e systemctl: show cgroup tree if cgroup is empty but has non-empty children
This makes sure "systemctl status user.slice" shows a nice cgroup tree
of all logged in users.
2013-07-11 19:15:01 +02:00
Lennart Poettering d0ede8f1c5 systemctl: suppress error message when doing "systemctl daemon-reexec"
When we issue a reexecution request via the private socket we need to
expect a "Disconnected" in addition to "NoReply" when the connection is
terminated.
2013-07-10 23:41:03 +02:00
Lennart Poettering 94c01aeb10 systemctl: suppress error messages when checking whether a unit needs to be reloaded 2013-07-10 23:41:03 +02:00
David Coppa 286ca4852e build-sys: rename LEGACY to NOLEGACY to better reflect meaning
https://bugs.freedesktop.org/show_bug.cgi?id=66542
2013-07-03 09:09:36 -04:00
Jason St. John e9c1ea9de8 replace tabs with spaces in various files
The affected files in this patch had inconsistent use of tabs vs. spaces
for indentation, and this patch eliminates the stray tabs.

Also, the opening brace of sigchld_hdl() in activate.c was moved so the
opening braces are consistent throughout the file.
2013-07-02 23:06:22 -04:00
Lennart Poettering fb6becb443 logind: port over to use scopes+slices for all cgroup stuff
In order to prepare things for the single-writer cgroup scheme, let's
make logind use systemd's own primitives for cgroup management.

Every login user now gets his own private slice unit, in which his sessions
live in a scope unit each. Also, add user@$UID.service to the same
slice, and implicitly start it on first login.
2013-07-02 01:48:55 +02:00
Lennart Poettering a00963a2e4 systemctl: show per-unit cgroup tree correctly following the new property 2013-07-01 00:18:00 +02:00
Lennart Poettering 7041efe960 dbus: make DeviceAllow=/DevicePolicy= writable 2013-06-27 23:13:17 +02:00
Lennart Poettering b42defe3b8 dbus: make more cgroup attributes runtime settable 2013-06-27 21:50:35 +02:00