summaryrefslogtreecommitdiff
path: root/src/systemctl
AgeCommit message (Collapse)Author
2013-04-05Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek
Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
2013-04-05systemctl: tweak drop-in displayLennart Poettering
So far we didn't place spaces between the box drawing chars and the values next to them. Let's be consistent here. (Or to turn this around: if we really want to place a space there we probably should do that in all our tree outputs, not just here...)
2013-04-05systemctl: tweak output of Listen: fields a bitLennart Poettering
It's probably a good idea to minimize the number of field names to show in the "systemctl status" output, in order to make them useful as a guide for the reader how things are "grouped". This patch moves information about the used socket technology to the end of the output lines in brackets, rather than into the field names. This turns the used socket technology into what it is -- peripheral meta information -- instead of something that was at the core. New output: systemd-journald.socket - Journal Socket Loaded: loaded (/usr/lib/systemd/system/systemd-journald.socket; static) Active: active (running) since Fr 2013-03-29 02:16:30 CET; 1 weeks 0 days ago Docs: man:systemd-journald.service(8) man:journald.conf(5) man:systemd-journald.service(8) man:journald.conf(5) Listen: /run/systemd/journal/stdout (Stream) /run/systemd/journal/socket (Datagram) /dev/log (Datagram)
2013-04-05systemctl: Add DropIn paths to status messageOleksii Shevchuk
$ systemctl status null.target null.target - NYAN Loaded: loaded (/home/alxchk/.config/systemd/user/null.target; disabled) Drop-In: /home/alxchk/.config/systemd/user/null.target.d └─ descr.conf, install-1.conf, install.conf /etc/systemd/user/null.target.d └─ test.conf Active: active since Пт 2013-04-05 20:42:13 EEST; 1min 58s ago
2013-04-05systemctl: align cgroups to 'n' in 'name='Zbigniew Jędrzejewski-Szmek
Also drop ':' in repeated Docs lines.
2013-04-04util: make time formatting a bit smarterLennart Poettering
Instead of outputting "5h 55s 50ms 3us" we'll now output "5h 55.050003s". Also, while outputting the accuracy is configurable. Basically we now try use "dot notation" for all time values > 1min. For >= 1s we use 's' as unit, otherwise for >= 1ms we use 'ms' as unit, and finally 'us'. This should give reasonably values in most cases.
2013-04-01systemctl: align all status fields to common columnZbigniew Jędrzejewski-Szmek
avahi-daemon.socket - Avahi mDNS/DNS-SD Stack Activation Socket Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.socket; enabled) Active: active (listening) since Mon 2013-04-01 09:02:44 EDT; 14h ago ListenStream: /var/run/avahi-daemon/socket
2013-04-01Add Listen* to dbus propertiesOleksii Shevchuk
sockets.socket - Test Loaded: loaded (/home/alxchk/.config/systemd/user/sockets.socket; static) Active: inactive (dead) Listen: Stream: /tmp/stream1 Stream: @stream4 Stream: [::]:9999 Stream: 127.0.0.2:9996 Stream: [::1]:9996 Datagram: /tmp/stream2 Datagram: @stream5 Datagram: [::]:9998 Datagram: 127.0.0.2:9995 Datagram: [::1]:9995 SequentialPacket: @stream6 SequentialPacket: /tmp/stream3 FIFO: /tmp/fifo1 Special: /dev/input/event9 Netlink: kobject-uevent 0 MessageQueue: /msgqueue1 [zj: - minor cleanups, - free i.listen, - remove sorting, because the order or sockets matters.]
2013-04-01Always use our own MAX/MIN definitionsCristian Rodríguez
code in src/shared/macro.h only defined MAX/MIN in case they were not defined previously. however the MAX/MIN macros implemented in glibc are not of the "safe" kind but defined as: define MIN(a,b) (((a)<(b))?(a):(b)) define MAX(a,b) (((a)>(b))?(a):(b)) Avoid nasty side effects by using our own versions instead. Also fix the warnings derived from this change. [zj: - modify MAX3 macro to fix warning about _a shadowing _a, - do bootchart/svg.c too, - remove unused MIN3.]
2013-03-31ModernizationZbigniew Jędrzejewski-Szmek
Use _cleanup_ and wrap lines to ~80 chars and such.
2013-03-30unit: no need to export variables if we can avoid itLennart Poettering
2013-03-29Always use errno > 0 to help gccZbigniew Jędrzejewski-Szmek
gcc thinks that errno might be negative, and functions could return something positive on error (-errno). Should not matter in practice, but makes an -O4 build much quieter.
2013-03-23add --with-telinit=PATH configure optionCristian Rodríguez
Distributions that never shipped upstart do not have "telinit" in /lib/upstart/.. Defaults to /lib/upstart/telinit so there is no change for systems existing installs.
2013-03-13systemctl: remove unused variableMichal Sekletar
2013-03-13initctl: catch write error, use _cleanup_Zbigniew Jędrzejewski-Szmek
!= operator always returns something nonnegative, so the error condition was not caught.
2013-03-13logs-show: export logic to add matches for unitsZbigniew Jędrzejewski-Szmek
After that functions which add matches, show_journal_by_unit and show_journal_by_user_unit, become nearly identical, so I merged them into one function.
2013-03-07pager: introduce "jump to end" optionHarald Hoyer
$ journalctl -be is what you want :) https://bugzilla.redhat.com/show_bug.cgi?id=867841
2013-03-07systemctl: mangle unit name in is-enabledLukas Nykryn
https://bugs.freedesktop.org/show_bug.cgi?id=56072 https://bugzilla.redhat.com/show_bug.cgi?id=880353
2013-03-01systemctl: check if iterator was initialized succesfullyLukas Nykryn
2013-03-01Revert "systemctl: try to reload daemon after enable/disable only when not ↵Lennart Poettering
running in a chroot" This reverts commit 5522a1fa876f1ab94a2accaadca824799fdf2cab. I am an idiot, the chroot case was already filtered out, so no point in checking this again.
2013-03-01systemctl: try to reload daemon after enable/disable only when not running ↵Lennart Poettering
in a chroot http://lists.freedesktop.org/archives/systemd-devel/2013-February/009208.html
2013-02-27systemctl: fix minimal number of params for new cgroup commandsLennart Poettering
2013-02-27unit: rework resource management APILennart Poettering
This introduces a new static list of known attributes and their special semantics. This means that cgroup attribute values can now be automatically translated from user to kernel notation for command line set settings, too. This also adds proper support for multi-line attributes.
2013-02-27systemctl: fix indentationLennart Poettering
2013-02-22systemctl: generalize action table to be usable in more action<->verb mappingsMichal Schmidt
Should be no functional change.
2013-02-22systemctl: make shutdown operations use irreversible jobsMichal Schmidt
Occasionally people report problem with reboot/poweroff operations hanging in the middle. One known cause is when a new transaction to start a unit is enqueued while the shutdown is going on. The start of the unit conflicts with the shutdown jobs, so they get cancelled. The failure case can be quite unpleasant, becase getty and sshd may already be stopped. Fix it by using irreversible jobs for shutdown (reboot/poweroff/...) actions. This applies to commands like "reboot", "telinit 6", "systemctl reboot". Should someone desire to use reversible jobs, they can say "systemctl start reboot.target".`
2013-02-22core, systemctl: add support for irreversible jobsMichal Schmidt
Add a new job mode: replace-irreversibly. Jobs enqueued using this mode cannot be implicitly canceled by later enqueued conflicting jobs. They can however still be canceled with an explicit "systemctl cancel" call.
2013-02-22systemctl: make "systemctl default" use "isolate" job modeMichal Schmidt
"systemctl default" should behave identically to "telinit N" (where N is the corresponding runlevel target number), therefore it should use isolate job mode too.
2013-02-16systemctl: allow comma sepearted property listsZbigniew Jędrzejewski-Szmek
2013-02-16systemctl: Don't give re-activation warning if unit is maskedJan Janssen
2013-02-16systemctl: allow status with no unitsZbigniew Jędrzejewski-Szmek
This makes 'status' behave like 'list-units': systemctl status -> status of all units systemctl -t error status -> status of error units systemctl -t mount status -> etc.
2013-02-14systemctl: print wall message only if successfulZbigniew Jędrzejewski-Szmek
systemctl would write to the wall even if unsuccessful. https://bugs.freedesktop.org/show_bug.cgi?id=60393
2013-02-14systemctl: use automatic cleanupZbigniew Jędrzejewski-Szmek
2013-02-14honor SELinux labels, when creating and writing config filesHarald Hoyer
Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-13Move systemctl dot to systemd-analyze dotSimon Peeters
2013-02-13systemctl: use parse_unit_infoMarc-Antoine Perennou
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-13dbus: import struct unit_info from systemctlMarc-Antoine Perennou
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-01-30systemctl: Fix wrong assertion testMauro Dreissig
2013-01-19unit: optionally allow making cgroup attribute changes persistentLennart Poettering
2013-01-18systemctl: print the user session journal for user session units.Mirco Tischler
2013-01-18systemctl: add new "get-cgroup-attr" to query current cgroup attribute valueLennart Poettering
Also adds a pair of bus calls for this to the daemon.
2013-01-18systemctl: it's probably a good idea not to alter return parameters if we failLennart Poettering
We generally follow the rule not to touch return values unless we succeed, so for the sake of uniformity do the same here.
2013-01-18systemctl: no need to check this explicitly, we already checked it a few ↵Lennart Poettering
lines up anyway, so let's just assert
2013-01-18systemctl: we can make this faster and shorten it a bit with strv_extend()Lennart Poettering
Now that strv_extend() is not so slow anymore, we can make use of it, to shorten our code a bit.
2013-01-18systemctl: make list-dependencies default to default.targetLennart Poettering
2013-01-18systemctl: we can use nulstr_contains() for this lookupLennart Poettering
It's a bit easier to read...
2013-01-17systemctl add command list-dependenciesLukas Nykryn
systemctl list-dependencies lists all unit's dependecies and recursively expands all subsidiary target units into a tree. Primary purpose for this command is to show all units which are enabled in specified target.
2013-01-16systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is ↵Lukas Nykryn
specified New file output.h with output flags and modes. --full parameter also for cgls and loginctl. Include 'all' parameter in flags (show_cgroup_by_path, show_cgroup, show_cgroup_and_extra, show_cgroup_and_extra_by_spec). get_process_cmdline with max_length == 0 will not ellipsize output. Replace LINE_MAX with 0 in some calls of get_process_cmdline. [zj: Default to --full when under pager for clgs. Drop '-f' since it wasn't documented and didn't actually work. Reindent a bit. ]
2013-01-15systemctl: fix assertion hit by incorrect comparisonDave Reisner
2013-01-15Typo fixOleksii Shevchuk