Commit graph

137 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e62d8c3944 Modernization
Use _cleanup_ and wrap lines to ~80 chars and such.
2013-03-31 14:36:12 -04:00
Lennart Poettering 830f01f0bc unit: no need to export variables if we can avoid it 2013-03-30 15:21:54 +01:00
Zbigniew Jędrzejewski-Szmek 8333c77edf Always use errno > 0 to help gcc
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-29 10:12:41 -04:00
Cristian Rodríguez 4ad61fd180 add --with-telinit=PATH configure option
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-23 01:44:56 +01:00
Michal Sekletar 1609dcb137 systemctl: remove unused variable 2013-03-13 21:05:08 -04:00
Zbigniew Jędrzejewski-Szmek 427b47c4ab initctl: catch write error, use _cleanup_
!= operator always returns something nonnegative, so the
error condition was not caught.
2013-03-13 19:53:45 -04:00
Zbigniew Jędrzejewski-Szmek 886a64fe69 logs-show: export logic to add matches for units
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-13 19:53:29 -04:00
Harald Hoyer 1b12a7b589 pager: introduce "jump to end" option
$ journalctl -be

is what you want :)

https://bugzilla.redhat.com/show_bug.cgi?id=867841
2013-03-07 21:16:04 +01:00
Lukas Nykryn dec49d88d6 systemctl: mangle unit name in is-enabled
https://bugs.freedesktop.org/show_bug.cgi?id=56072
https://bugzilla.redhat.com/show_bug.cgi?id=880353
2013-03-07 16:25:00 +01:00
Lukas Nykryn fea9740ae4 systemctl: check if iterator was initialized succesfully 2013-03-01 16:43:57 -05:00
Lennart Poettering d6cb60c7a0 Revert "systemctl: try to reload daemon after enable/disable only when not running in a chroot"
This reverts commit 5522a1fa87.

I am an idiot, the chroot case was already filtered out, so no point in
checking this again.
2013-03-01 14:04:18 +01:00
Lennart Poettering 5522a1fa87 systemctl: try to reload daemon after enable/disable only when not running in a chroot
http://lists.freedesktop.org/archives/systemd-devel/2013-February/009208.html
2013-03-01 13:59:49 +01:00
Lennart Poettering 1f4cadad8b systemctl: fix minimal number of params for new cgroup commands 2013-02-27 18:58:56 +01:00
Lennart Poettering 26d04f86a3 unit: rework resource management API
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-27 18:50:41 +01:00
Lennart Poettering 416389f7ae systemctl: fix indentation 2013-02-27 15:01:06 +01:00
Michal Schmidt 47a0eaa60c systemctl: generalize action table to be usable in more action<->verb mappings
Should be no functional change.
2013-02-22 16:06:18 +01:00
Michal Schmidt b85bdddafb systemctl: make shutdown operations use irreversible jobs
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-22 16:06:17 +01:00
Michal Schmidt 23ade460e5 core, systemctl: add support for irreversible jobs
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-22 16:06:17 +01:00
Michal Schmidt b7cf6049a3 systemctl: make "systemctl default" use "isolate" job mode
"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-22 16:06:17 +01:00
Zbigniew Jędrzejewski-Szmek 033a842c36 systemctl: allow comma sepearted property lists 2013-02-16 17:36:00 -05:00
Jan Janssen d0a5cdb280 systemctl: Don't give re-activation warning if unit is masked 2013-02-16 09:53:49 -05:00
Zbigniew Jędrzejewski-Szmek 265a7a2a60 systemctl: allow status with no units
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-16 09:53:49 -05:00
Zbigniew Jędrzejewski-Szmek f6bb13ab8d systemctl: print wall message only if successful
systemctl would write to the wall even if unsuccessful.

https://bugs.freedesktop.org/show_bug.cgi?id=60393
2013-02-14 15:26:34 -05:00
Zbigniew Jędrzejewski-Szmek cec7eda533 systemctl: use automatic cleanup 2013-02-14 15:26:34 -05:00
Harald Hoyer a5c32cff1f honor SELinux labels, when creating and writing config files
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-14 16:19:38 +01:00
Simon Peeters 1700761b06 Move systemctl dot to systemd-analyze dot 2013-02-13 14:47:05 -08:00
Marc-Antoine Perennou a38694df9c systemctl: use parse_unit_info
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-13 14:36:01 -08:00
Marc-Antoine Perennou cdf3f17bfb dbus: import struct unit_info from systemctl
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-02-13 14:36:01 -08:00
Mauro Dreissig 883127fd84 systemctl: Fix wrong assertion test 2013-01-30 23:37:39 -05:00
Lennart Poettering 71645acac2 unit: optionally allow making cgroup attribute changes persistent 2013-01-19 01:02:30 +01:00
Mirco Tischler cc86e6b86e systemctl: print the user session journal for user session units. 2013-01-18 11:14:00 -05:00
Lennart Poettering d2a3097582 systemctl: add new "get-cgroup-attr" to query current cgroup attribute value
Also adds a pair of bus calls for this to the daemon.
2013-01-18 01:44:41 +01:00
Lennart Poettering d54110d11d systemctl: it's probably a good idea not to alter return parameters if we fail
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-18 00:53:09 +01:00
Lennart Poettering 52a2ab41e0 systemctl: no need to check this explicitly, we already checked it a few lines up anyway, so let's just assert 2013-01-18 00:52:45 +01:00
Lennart Poettering 540e7dbe9e systemctl: we can make this faster and shorten it a bit with strv_extend()
Now that strv_extend() is not so slow anymore, we can make use of it, to
shorten our code a bit.
2013-01-18 00:51:48 +01:00
Lennart Poettering e31165b262 systemctl: make list-dependencies default to default.target 2013-01-18 00:36:12 +01:00
Lennart Poettering e608b38a87 systemctl: we can use nulstr_contains() for this lookup
It's a bit easier to read...
2013-01-18 00:29:51 +01:00
Lukas Nykryn 55c0b89c57 systemctl add command list-dependencies
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-17 21:34:11 +01:00
Lukas Nykryn 9bdbc2e2ec systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is 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-16 12:11:47 -05:00
Dave Reisner ec76596cab systemctl: fix assertion hit by incorrect comparison 2013-01-15 18:49:31 -05:00
Oleksii Shevchuk 69bd386c4c Typo fix 2013-01-15 06:08:32 -05:00
Lennart Poettering 59164be40e systemctl: when inhibiting shutdown/suspend also check for other login sessions 2013-01-15 03:04:41 +01:00
Lennart Poettering aca26b5220 systemctl: drop compat with really really old systemd versions 2013-01-14 21:25:25 +01:00
Lennart Poettering 1dcf60656c systemctl: be smarter when mangling snapshot names
For "systemctl snapshot" it makes no sense to complete an incomplete
name with ".service" as we previously did, use ".snapshot" instead.
Also, don't bother with mount units or suchlike, we know that this must
be a snapshot and hence is the only sane way for completion.
2013-01-14 21:24:58 +01:00
Lennart Poettering f84190d8ca systemctl: numerous modernizations 2013-01-14 21:24:58 +01:00
Lennart Poettering 246aa6dd9d core: add bus API and systemctl commands for altering cgroup parameters during runtime 2013-01-14 21:24:57 +01:00
Lennart Poettering 748ebafa7a systemctl: honour inhibitors only when running unprivileged 2013-01-14 21:24:57 +01:00
Lennart Poettering d255133d8e systemctl: don't hit an assert if we try to reboot and dbus is dead
https://bugzilla.redhat.com/show_bug.cgi?id=889624
2013-01-14 21:24:57 +01:00
Lennart Poettering 60f9ba0b94 systemctl: rework is-active and is-failed code 2013-01-14 21:24:57 +01:00
Lennart Poettering b37844d3d7 systemctl: honour inhibitors when shutting down or entering sleep state 2013-01-11 04:24:05 +01:00