chiark / gitweb /
9 years agolog: never block on syslog in PID 1
Michal Schmidt [Sun, 18 Dec 2011 13:57:54 +0000 (14:57 +0100)]
log: never block on syslog in PID 1

Use a non-blocking syslog socket if logging from PID 1.
If sendmsg fails with EAGAIN, fall back to kmsg or console only for the
current message. Next message will try syslog again.

9 years agodbus: no sync D-Bus connection flushing
Michal Schmidt [Mon, 19 Dec 2011 17:32:10 +0000 (18:32 +0100)]
dbus: no sync D-Bus connection flushing

Blocking on D-Bus in a system manager could lead to deadlock.

9 years agodbus: register to DBus asynchronously
Michal Schmidt [Sun, 18 Dec 2011 13:58:10 +0000 (14:58 +0100)]
dbus: register to DBus asynchronously

Chen Jie observed and analyzed a deadlock. Assuming systemd-kmsg-syslogd
is already stopped, but rsyslogd is not started yet:
 1. systemd makes a synchronous call to dbus-daemon.
 2. dbus-daemon wants to write something to syslog.
 3. syslog needs to be started by systemd.
   ... but cannot be, because systemd is waiting in 1.

Solve this by avoiding synchronous D-Bus calls. I had to write an async
bus registration call. Interestingly, D-Bus authors anticipated this, in
documentation to dbus_bus_set_unique_name():
> The only reason to use this function is to re-implement the equivalent
> of dbus_bus_register() yourself. One (probably unusual) reason to do
> that might be to do the bus registration call asynchronously instead
> of synchronously.

Lennart's comments from IRC:
> though I think this doesn't fix the problem in its entirety
> simply because dbus_connection_open_private() itself is still synchronous
> i.e. the connect() call behind it is not async
> I think I listed that issue actually on some D-Bus todo list
> i.e. to make dbus_connection_get() fully async
> but that's going to be hard
> so your patch looks good

So it may not be perfect, but it's clearly an improvement.
I did not manage to reproduce the original deadlock with the patch.

9 years agolabel: fix labeling of symbolic links
Dan Walsh [Mon, 19 Dec 2011 22:55:29 +0000 (23:55 +0100)]
label: fix labeling of symbolic links

9 years agoexecute: fix losing of start timestamps
Michal Schmidt [Sat, 17 Dec 2011 00:33:40 +0000 (01:33 +0100)]
execute: fix losing of start timestamps

Start timestamps were always cleared before saving exit timestamps.
Fix it by removing a condition that makes no sense any way I look at it.

9 years agoman: fix misplaced remark in description of Sockets=
Michal Schmidt [Fri, 16 Dec 2011 23:39:19 +0000 (00:39 +0100)]
man: fix misplaced remark in description of Sockets=

9 years agotmpfiles: add 'z', like 'Z' but not recursive
Michal Schmidt [Fri, 16 Dec 2011 17:27:35 +0000 (18:27 +0100)]
tmpfiles: add 'z', like 'Z' but not recursive

9 years agotmpfiles: apply chown, chmod for 'Z' entries too
Michal Schmidt [Fri, 16 Dec 2011 17:00:11 +0000 (18:00 +0100)]
tmpfiles: apply chown, chmod for 'Z' entries too

If changing ownership or permissions is not desired, they can be
configured to '-' or omitted entirely.

9 years agoservice: use 'syslog+console' for sysv_console
Michal Schmidt [Fri, 16 Dec 2011 16:38:01 +0000 (17:38 +0100)]
service: use 'syslog+console' for sysv_console

The default output to 'tty' for SysV service was making it hard to debug
problems because error messages were missing from syslog.

9 years agoman: mention that 'Z' ignores uid/gid/mode
Michal Schmidt [Thu, 15 Dec 2011 23:38:22 +0000 (00:38 +0100)]
man: mention that 'Z' ignores uid/gid/mode

9 years agoman: document 'Z' in tmpfiles
Michal Schmidt [Thu, 15 Dec 2011 22:04:37 +0000 (23:04 +0100)]
man: document 'Z' in tmpfiles

9 years agotmpfiles: add RECURSIVE_RELABEL_PATH ('Z')
Michal Schmidt [Thu, 15 Dec 2011 22:11:07 +0000 (23:11 +0100)]
tmpfiles: add RECURSIVE_RELABEL_PATH ('Z')

Feature requested by Dan Walsh.

9 years agotmpfiles: separate a generic item glob processing function
Michal Schmidt [Thu, 15 Dec 2011 22:45:26 +0000 (23:45 +0100)]
tmpfiles: separate a generic item glob processing function

Item glob processing will be useful for more than just removing.

9 years agotmpfiles: use a common function to set owner/group/mode/label
Michal Schmidt [Thu, 15 Dec 2011 22:44:23 +0000 (23:44 +0100)]
tmpfiles: use a common function to set owner/group/mode/label

9 years agotmpfiles: rename a couple of functions
Michal Schmidt [Thu, 15 Dec 2011 20:32:50 +0000 (21:32 +0100)]
tmpfiles: rename a couple of functions

remove_item -> remove_item_instance
remove_item_glob -> remove_item

9 years agotmpfiles: use an enum instead of plain char for item type
Michal Schmidt [Thu, 15 Dec 2011 20:31:14 +0000 (21:31 +0100)]
tmpfiles: use an enum instead of plain char for item type

For better safety. gcc can warn about missing values in switch statements.

9 years agosystemctl: fix typo in 'is-enabled'
Michal Schmidt [Wed, 14 Dec 2011 21:23:56 +0000 (22:23 +0100)]
systemctl: fix typo in 'is-enabled'

It prevented the action from working without dbus.

9 years agofsck: Fix typo in comment
Gregs Gregs [Mon, 14 Nov 2011 17:58:03 +0000 (19:58 +0200)]
fsck: Fix typo in comment

9 years agoupdate TODO
Lennart Poettering [Wed, 14 Dec 2011 16:03:50 +0000 (17:03 +0100)]
update TODO

9 years agopam-module: add a couple of debugging prints
Michal Schmidt [Wed, 14 Dec 2011 00:25:47 +0000 (01:25 +0100)]
pam-module: add a couple of debugging prints

9 years agounit: check for unneeded dependencies even when unit stop was expected
Michal Schmidt [Fri, 9 Dec 2011 14:25:29 +0000 (15:25 +0100)]
unit: check for unneeded dependencies even when unit stop was expected

systemd did not stop units marked as "StopWhenUnneeded=yes" when the requiring
unit was stopped on user's request.


9 years agounit: fix false positive in check for unneeded unit
Michal Schmidt [Fri, 9 Dec 2011 14:24:04 +0000 (15:24 +0100)]
unit: fix false positive in check for unneeded unit

A freshly started unit A was immediately considered unneeded just because
unit B, which Requires A, was starting later in the transaction.
Fix it by looking not only at the state of B, but also at its pending job.

Also fix a copied&pasted comment.

9 years agopath: add missing pieces for PathModified
Michal Schmidt [Thu, 8 Dec 2011 11:09:10 +0000 (12:09 +0100)]
path: add missing pieces for PathModified

PATH_MODIFIED worked internally for PID files detection, but was unusable
in units.

9 years ago'@' is an 'ampersat' not an 'ampersand'; let's call it 'at symbol'
Tim Waugh [Thu, 8 Dec 2011 16:32:09 +0000 (17:32 +0100)]
'@' is an 'ampersat' not an 'ampersand'; let's call it 'at symbol'

9 years agosystemctl: print 'error' load state in red
Michal Schmidt [Tue, 6 Dec 2011 00:14:36 +0000 (01:14 +0100)]
systemctl: print 'error' load state in red

Be consistent in coloring of load states in list-units and status.
Print only 'error' in red.
There are no 'banned' or 'failed' states. Do not color 'masked', it's
not an error.

9 years agounit: garbage collect units with load error
Michal Schmidt [Mon, 5 Dec 2011 23:47:28 +0000 (00:47 +0100)]
unit: garbage collect units with load error

Units that failed to load were never cleaned up. It was possible to
reach the 128K limit of units by attempting to load a bunch of nonsense.

Bug observed by Reartes Guillermo in

9 years agoAllow 'list-unit-files' to run with --root.
Bill Nottingham [Tue, 22 Nov 2011 20:45:34 +0000 (15:45 -0500)]
Allow 'list-unit-files' to run with --root.

To do so, move the check for the bus to the bus-using portion of
list_unit_files(), and ensure that get_config_path doesn't abort when
checking the runtime path with --root.

9 years agoservice: stop the service if ExecStartPost ends with a failure
Michal Schmidt [Sat, 3 Dec 2011 20:34:34 +0000 (21:34 +0100)]
service: stop the service if ExecStartPost ends with a failure

The handling of failures in ExecStartPost is inconsistent. If the
command times out, the service is stopped. But if the command exits
with a failure, the service keeps running.

It makes more sense to stop the service when ExecStartPost fails.
If this behaviour is not desired, the ExecStartPost command can be
prefixed with "-".

9 years agoservice: handle services with racy daemonization gracefully
Michal Schmidt [Sat, 3 Dec 2011 01:13:30 +0000 (02:13 +0100)]
service: handle services with racy daemonization gracefully

There are a lot of forking daemons that do not exactly follow the
initialization steps as described in daemon(7). It is common that they
do not bother waiting in the parent process for the child to write the
PID file before exiting. The daemons' developers often do not perceive
this as a bug and they're unwilling to change.

Currently systemd warns about the missing PID file and falls back to
guessing the main PID. Being not quite deterministic, the guess can be
wrong with bad consequences. If the guessing is disabled, determinism is
achieved at the cost of losing the ability of noticing when the main
process of the service dies.

As long as it does not negatively affect properly written services,
systemd should strive for compatibility even with services with racy
daemonization. It is possible to provide determinism _and_ main process
supervision to them.

If the PID file is not there, rather than guessing and considering the
service running immediately after getting the SIGCHLD from the ExecStart
(or ExecStartPost) process, we can keep the service in the activating
state for a bit longer. We can use inotify to wait for the PID file to
appear. Only when it finally does appear and we read a valid PID from
it, we'll move the service to the running state. If the PID file never
appears, the usual timeout kicks in and the service fails.

9 years agopath: add PathModified (= PathChanged + IN_MODIFY)
Michal Schmidt [Sat, 3 Dec 2011 09:22:26 +0000 (10:22 +0100)]
path: add PathModified (= PathChanged + IN_MODIFY)

9 years agopath: refactor PathSpec usage
Michal Schmidt [Sat, 3 Dec 2011 00:38:30 +0000 (01:38 +0100)]
path: refactor PathSpec usage

path_*() functions operate on "Path *p" and they do not touch PathSpec
internals directly.

pathspec_*() functions operate on "PathSpec *s". The PathSpec class will
be useful outside of path.c.

9 years agopath: use %m instead of strerror(errno)
Michal Schmidt [Sat, 3 Dec 2011 00:36:05 +0000 (01:36 +0100)]
path: use %m instead of strerror(errno)

and strerror(-errno) was just wrong.

9 years agoutil: fix error checking after fgets()
Michal Schmidt [Fri, 2 Dec 2011 23:41:34 +0000 (00:41 +0100)]
util: fix error checking after fgets()

fgets() does not set errno on EOF.

9 years agorc-local: order after
Michal Schmidt [Fri, 2 Dec 2011 10:32:52 +0000 (11:32 +0100)]
rc-local: order after

As suggested by Bill Nottingham: rc.local is often used for frobbing the

9 years agorc-local: no need to check if the script is executable
Michal Schmidt [Fri, 2 Dec 2011 10:32:04 +0000 (11:32 +0100)]
rc-local: no need to check if the script is executable

rc-local.service is pulled in by a generator only if the script is
executable. No need to check again.

9 years agoadd a generator to pull rc-local.service in
Michal Schmidt [Fri, 2 Dec 2011 09:18:46 +0000 (10:18 +0100)]
add a generator to pull rc-local.service in

rc-local.service acts as an ordering barrier even if its condition is
false, because conditions are evaluated when the service is about to be

To avoid the ordering barrier in a legacy-free system, add a generator
to pull rc-local.service into the transaction only if the script is

If/when we rewrite SysV compatibility into a generator, this one can become
a part of it.

9 years agoman: document the PassCred option
Michal Schmidt [Wed, 30 Nov 2011 10:06:35 +0000 (11:06 +0100)]
man: document the PassCred option

9 years agosyslog: use PassCred=yes for the /dev/log socket
Michal Schmidt [Wed, 30 Nov 2011 08:37:13 +0000 (09:37 +0100)]
syslog: use PassCred=yes for the /dev/log socket

Both kmsg-syslogd and the real syslog service want to receive
SCM_CREDENTIALS. With socket activation it is too late to set
SO_PASSCRED in the services.

9 years agoshutdownd: use PassCred=yes in the socket unit
Michal Schmidt [Tue, 29 Nov 2011 22:14:36 +0000 (23:14 +0100)]
shutdownd: use PassCred=yes in the socket unit

Since Linux 3.2 in order to receive SCM_CREDENTIALS it is not sufficient
to set SO_PASSCRED just before recvmsg(). The option has to be already
set when the sender sends the message.

With socket activation it is too late to set the option in the service.
It must be set on the socket right from the start.

See the kernel commit:
16e57262 af_unix: dont send SCM_CREDENTIALS by default


9 years agosocket: add option for SO_PASSCRED
Michal Schmidt [Tue, 29 Nov 2011 21:15:41 +0000 (22:15 +0100)]
socket: add option for SO_PASSCRED

Add an option to enable SO_PASSCRED for unix sockets.

9 years agolet mount and swap units log to the configured defaults
Michal Schmidt [Sat, 19 Nov 2011 01:47:09 +0000 (02:47 +0100)]
let mount and swap units log to the configured defaults


9 years agopam-module: treat "cron" in PAM_TTY as empty tty
Michal Schmidt [Sat, 19 Nov 2011 00:17:46 +0000 (01:17 +0100)]
pam-module: treat "cron" in PAM_TTY as empty tty

cron sets PAM_TTY to "cron" and it has been doing it for a long time.
It cannot be changed because user configurations may depend on it.

9 years agopam-module: use the correct session type "unspecified"
Michal Schmidt [Sat, 19 Nov 2011 00:14:11 +0000 (01:14 +0100)]
pam-module: use the correct session type "unspecified"

logind does not understand "other".

9 years agoexecute: log errors from "sd(EXEC)"
Michal Schmidt [Wed, 16 Nov 2011 23:21:16 +0000 (00:21 +0100)]
execute: log errors from "sd(EXEC)"

To give the administrator more hints about failures occuring in spawning
of commands than just the exit code, log the strerror.
All fds are closed, so reopen the log.


9 years agoexecute: make setup_pam() return -errno when possible
Michal Schmidt [Wed, 16 Nov 2011 23:16:22 +0000 (00:16 +0100)]
execute: make setup_pam() return -errno when possible

The only caller currently checks if the result is non-zero,
so nothing changes there.

9 years agoexecute: avoid logging to closed fds
Michal Schmidt [Wed, 16 Nov 2011 22:45:01 +0000 (23:45 +0100)]
execute: avoid logging to closed fds

Several functions called from the "sd(EXEC)" process try to log messages
when all the file descriptors are already closed, including the logging
ones. The logging functions do not expect their fds to be closed and
they hit an assertion failure. The failure wants to be logged too,
so there is an infinite recursion, ended by a SIGSEGV.

When we close all fds, we must let log.c know about it.

9 years agoFix same expression on both sides of '&&'
Thomas Jarosch [Wed, 9 Nov 2011 19:48:31 +0000 (20:48 +0100)]
Fix same expression on both sides of '&&'

The code should probably look like the statements above it.
Please verify, I just detected it using cppcheck.

Signed-off-by: Thomas Jarosch <>
9 years agoman: fix typo in sd_notify
Michal Schmidt [Fri, 11 Nov 2011 09:48:17 +0000 (10:48 +0100)]
man: fix typo in sd_notify

Noticed by guzu.

9 years agojob: colored status messages on boot
Michal Schmidt [Thu, 10 Nov 2011 11:53:39 +0000 (12:53 +0100)]
job: colored status messages on boot

The lack or green/red status marks on boot has been described by some
users as "critical", "dramatic", "dealbreaker", "showstopper". Seriously.

9 years agoservice: don't warn if the pidfile still exists after SIGCHLD
Michal Schmidt [Thu, 10 Nov 2011 08:55:47 +0000 (09:55 +0100)]
service: don't warn if the pidfile still exists after SIGCHLD

A service that drops its privileges may not be able to remove it when it
exits. The stale pidfile is not a problem as long as the service
carefully recognizes it on its next start.

systemd would produce a warning after the service exits:
  PID ... read from file ... does not exist. Your service or init
  script might be broken.

Silence the warning in this case. Still warn if this error is detected
when loading the pidfile after service start.

Noticed by Miroslav Lichvar in

9 years agounits/suse: let rc-local.service log to syslog
Michal Schmidt [Wed, 9 Nov 2011 09:10:38 +0000 (10:10 +0100)]
units/suse: let rc-local.service log to syslog

Same change as the previous commit did for Fedora. fcrozat agreed.

9 years agounits/fedora: let rc-local.service log to syslog
Michal Schmidt [Wed, 9 Nov 2011 07:58:36 +0000 (08:58 +0100)]
units/fedora: let rc-local.service log to syslog

rc-local.service should not be excluded from the default stdout logging.

Missing logs were noticed by Andrew McNabb in

9 years agounits: drop unnecessary 'StandardOutput=syslog'
Michal Schmidt [Wed, 9 Nov 2011 07:42:03 +0000 (08:42 +0100)]
units: drop unnecessary 'StandardOutput=syslog'

DefaultStandardOutput is syslog anyway. There's no reason to assume that
the administrator would want these units to be excluded when he configures
a different DefaultStandardOutput.

9 years agoman: fix a typo in signal number
Michal Schmidt [Mon, 7 Nov 2011 00:08:21 +0000 (01:08 +0100)]
man: fix a typo in signal number

9 years agoutmp: for DEAD_PROCESS write the current time to wtmp
Michal Schmidt [Sun, 6 Nov 2011 22:55:06 +0000 (23:55 +0100)]
utmp: for DEAD_PROCESS write the current time to wtmp

Zeroed .ut_tv values in wtmp confuse chkrootkit.

Reported and debugged by Norman Smith. This is based on his patch,
but modified to behave more like upstart did in F14 and cleaned up.

9 years agoutmp: initialize store with the found entry, not with the lookup key
Michal Schmidt [Sun, 6 Nov 2011 22:31:46 +0000 (23:31 +0100)]
utmp: initialize store with the found entry, not with the lookup key

9 years agoutmp: no need to zero a struct before overwriting it with memcpy
Michal Schmidt [Sun, 6 Nov 2011 22:07:54 +0000 (23:07 +0100)]
utmp: no need to zero a struct before overwriting it with memcpy

9 years agoutmp: remove unneded parameters
Michal Schmidt [Sun, 6 Nov 2011 22:06:38 +0000 (23:06 +0100)]
utmp: remove unneded parameters

With these functions no caller ever passes anything else than 0
for 't' (meaning the current time will be used).

9 years agoupdate TODO
Lennart Poettering [Thu, 3 Nov 2011 18:55:36 +0000 (19:55 +0100)]
update TODO

9 years agocgroup: immediately remove all cgroups which run empty
Lennart Poettering [Thu, 3 Nov 2011 18:42:53 +0000 (19:42 +0100)]
cgroup: immediately remove all cgroups which run empty

Some controllers have scaling problems when many empty cgroups exist.
Hence, as soon as we get a notification that a cgroup is empty, delete
it. This is also nice to keep the systemd-cgls output short.

9 years agoMerge remote-tracking branch 'zbigniew/systemadm_changes'
Lennart Poettering [Wed, 2 Nov 2011 13:08:49 +0000 (14:08 +0100)]
Merge remote-tracking branch 'zbigniew/systemadm_changes'

9 years agobash-completion: rename file since it is no longer for systemctl only
Ran Benita [Wed, 2 Nov 2011 08:48:51 +0000 (10:48 +0200)]
bash-completion: rename file since it is no longer for systemctl only

9 years agobash-completion: add completions for systemd-loginctl
Ran Benita [Wed, 2 Nov 2011 08:48:50 +0000 (10:48 +0200)]
bash-completion: add completions for systemd-loginctl

This script is straightforward and should give proper completions for
all of systemd-loginctl's verbs.

9 years agobash-completion: update with new verbs and arguments
Ran Benita [Wed, 2 Nov 2011 08:48:49 +0000 (10:48 +0200)]
bash-completion: update with new verbs and arguments

Adds arguments --root= --runtime --no-legend.
Adds verbs link mask unmask reenable list-unit-files.
Also uses list-unit-files to make nicer enable and disable completions.

Rebased due to changes in systemctl.

9 years agoAdd Mageia support
Dexter Morgan [Fri, 28 Oct 2011 17:16:33 +0000 (19:16 +0200)]
Add Mageia support

This patch adds support for the Mageia Linux distribution:

Mageia is a fork of Mandriva although some divergence has already occured
and thus inclusion of these changes upstream allow us to (hopefully)
migrate more rapidly to the new standard approaches systemd offers.
Indeed, we already use the preferred mechanism of OS identification via
the /etc/os-release file rather than a distro specific variation.

This patch mostly mirrors the patch added previously for Mandriva
support. In addition to those original authors, this patch was mostly
written by Dexter Morgan with help from Colin Guthrie and Eugeni Dodonov.

9 years agoupdate TODO
Lennart Poettering [Tue, 1 Nov 2011 22:53:15 +0000 (23:53 +0100)]
update TODO

9 years agocryptsetup-generator: avoid ordering cycle on swap
Tom Gundersen [Mon, 17 Oct 2011 11:01:08 +0000 (13:01 +0200)]
cryptsetup-generator: avoid ordering cycle on swap

Devices with random keys (swap), should not be ordered before,
as this creates a cycle with systemd-load-random-seed.service (and also it
does not make sense, a swap device is not a local-fs).

9 years agounits: drop [Install] section from
Lennart Poettering [Tue, 1 Nov 2011 21:29:48 +0000 (22:29 +0100)]
units: drop [Install] section from is not a unit a user should ever explicitly enable.
Instead services which need to hook before network mounts should pull it

9 years agomount: order remote mounts after both and
Lennart Poettering [Tue, 1 Nov 2011 21:27:48 +0000 (22:27 +0100)]
mount: order remote mounts after both and

Since is optional we cannot count on it to order
remote mounts after, so let's add that order explicitly
in addition to

9 years agocgroup: always recreate cgroup before we try to apply attributes
Lennart Poettering [Tue, 1 Nov 2011 21:02:36 +0000 (22:02 +0100)]
cgroup: always recreate cgroup before we try to apply attributes

We might have trimmed the cgroup tree previously, hence don't trust our
own "realized" flag, always recreate cgroup tree before applying our
attributes to make sure this actually works out.

9 years agoinitctl: don't use dbus connection after PID 1 got respawned
Lennart Poettering [Tue, 1 Nov 2011 17:18:17 +0000 (18:18 +0100)]
initctl: don't use dbus connection after PID 1 got respawned

After reexec PID 1 our bus connection is invalidated. Hence don't try to
reuse it, just terminate so that when we are spawned the next time we
just get a new one.

Spotted by Marti Raudsepp.

9 years agocondition: Fix file descriptor leak in test_capability()
Thomas Jarosch [Wed, 26 Oct 2011 07:38:39 +0000 (09:38 +0200)]
condition: Fix file descriptor leak in test_capability()

Detected by cppcheck.

9 years agorandom-seed: convert poolsize from bits to bytes
Tom Gundersen [Sat, 22 Oct 2011 16:47:08 +0000 (18:47 +0200)]
random-seed: convert poolsize from bits to bytes

The problem was first noted in a bug report against Arch's initscripts.

Reported-by: Taylan Ulrich Bayırlı <>
Reported-by: Gerardo Exequiel Pozzi <>
9 years agoplymouth: fix ply proto endianess issues
Lennart Poettering [Tue, 1 Nov 2011 13:20:31 +0000 (14:20 +0100)]
plymouth: fix ply proto endianess issues

Plymouth enforces LE even for the local Ply proto, hence we should do
the conversion properly for BE arch compat.

Tracked down by Harald Hoyer.

9 years agoREADME: explain dependency on cgroups
Lennart Poettering [Tue, 1 Nov 2011 12:52:28 +0000 (13:52 +0100)]
README: explain dependency on cgroups

9 years agoupdate TODO
Lennart Poettering [Tue, 1 Nov 2011 12:48:30 +0000 (13:48 +0100)]
update TODO

9 years agosystemctl: make list-unit-files output more economical
Zbigniew Jędrzejewski-Szmek [Mon, 24 Oct 2011 09:49:59 +0000 (11:49 +0200)]
systemctl: make list-unit-files output more economical

The first column is given the width of the widest entry,
if possible, otherwise all entries are ellipsized to fit
in ($COLUMNS - (width of second column)).

[ Added a few fixes, calculate state_cols too, respect '--no-legend',
  better handling of '--full' -- michich ]

9 years agosystemctl-completion: always invoke with --no-legend
Dave Reisner [Wed, 12 Oct 2011 00:56:53 +0000 (20:56 -0400)]
systemctl-completion: always invoke with --no-legend

In the case of completion for the 'restart' verb, passing the invalid
unit name (the colums header) causes completion to cease functioning
entirely, with the error:

  Failed to issue method call: Unit name UNIT is not valid.

This adds a small wrapper function for systemctl which can have common
options added to it.

9 years agoaudit: do not complain if kernel lacks audit
Jonathan Nieder [Mon, 17 Oct 2011 19:01:40 +0000 (21:01 +0200)]
audit: do not complain if kernel lacks audit

When running on a kernel without audit support, systemd currently
writes a mysterious-sounding error to its log:

systemd[1]: Failed to connect to audit log: Protocol not supported

Better to suppress the audit_open() failure message when (and only
when) it is due to running on a kernel without audit support, since in
this case the admin probably does not mind systemd not writing to the
audit log.  This way, more serious errors like ENOMEM and EACCES will
stand out more.

9 years agoservice: Drop rcN.d runlevels from SysV services that also exist in rcS.d
Tollef Fog Heen [Mon, 17 Oct 2011 19:00:42 +0000 (21:00 +0200)]
service: Drop rcN.d runlevels from SysV services that also exist in rcS.d

Services which claim to start in both rcN.d and rcS.d generate
loops which for some reason seems to usually end up with dbus not
starting and the whole machine being quite unhappy. We now rather
assume that if a service can be started in rcS, it should not also
start in rcN.d.

Fixes Debian bug #637037

9 years agomanager: fix a crash in isolating
Michal Schmidt [Mon, 17 Oct 2011 09:12:12 +0000 (11:12 +0200)]
manager: fix a crash in isolating

HASHMAP_FOREACH is safe against the removal of the current entry, but
not against the removal of other entries. job_finish_and_invalidate()
can recursively remove other entries.

It triggered an assertion failure:
  Assertion 'j->installed' failed at src/manager.c:1218, function
  transaction_apply(). Aborting.

Fix the crash by iterating from the beginning when there is a
possibility that the iterator could be invalid.

It is O(n^2) in the worst case, but that's better than a crash.

9 years agoutil: properly detect what the last capability is
Lennart Poettering [Tue, 11 Oct 2011 20:30:31 +0000 (22:30 +0200)]
util: properly detect what the last capability is

9 years agobuild-sys: bump release for v37 v37
Lennart Poettering [Tue, 11 Oct 2011 18:46:56 +0000 (20:46 +0200)]
build-sys: bump release for v37

9 years agoservice: don't try to guess PID for SysV services anymore
Lennart Poettering [Tue, 11 Oct 2011 18:21:06 +0000 (20:21 +0200)]
service: don't try to guess PID for SysV services anymore

As it turns out there are quite a number of SysV services too broken to
make the guessing work: instead of returning in the parent only after
the child is fully initialized they return immediately. The effect is
that the guessing in systemd might happen too early, at a time where the
final main process doesn't exist yet.

By turning this off we won't try to detect the main pid anymore, with
the effect that all processes of the service in question are considered
equally likely to be the main process.

9 years agolocaled: make sure s-s-k doesn't create any X11 config files anymore
Lennart Poettering [Tue, 11 Oct 2011 18:20:01 +0000 (20:20 +0200)]
localed: make sure s-s-k doesn't create any X11 config files anymore

9 years agolocaled: shorten generate-kbd-model-map
Zbigniew Jędrzejewski-Szmek [Tue, 11 Oct 2011 10:34:14 +0000 (12:34 +0200)]
localed: shorten generate-kbd-model-map

Output is identical.

9 years agopager: add _noreturn_ to pager_fallback()
Zbigniew Jędrzejewski-Szmek [Tue, 11 Oct 2011 09:27:06 +0000 (11:27 +0200)]
pager: add _noreturn_ to pager_fallback()

src/pager.c: In function ‘pager_fallback’:
src/pager.c:35:13: warning: function might be possible candidate for attribute ‘noreturn’ [-Wmissing-noreturn]

9 years agounit: introduce ConditionCapability
Lennart Poettering [Tue, 11 Oct 2011 13:16:52 +0000 (15:16 +0200)]
unit: introduce ConditionCapability

9 years agounits: forgot target units
Lennart Poettering [Tue, 11 Oct 2011 12:26:20 +0000 (14:26 +0200)]
units: forgot target units

9 years agounits: increase LimitNOFILE a bit
Lennart Poettering [Tue, 11 Oct 2011 02:43:29 +0000 (04:43 +0200)]
units: increase LimitNOFILE a bit

since we need one fd per session (for logind) and one fd per service
(for stdout-syslog-bridge) increase the default rlimit a bit.

9 years agologind: fail gracefully if too many sessions are created
Lennart Poettering [Tue, 11 Oct 2011 02:43:01 +0000 (04:43 +0200)]
logind: fail gracefully if too many sessions are created

9 years agotimedate: fall back to /etc/sysconfig/clock on Fedora, for compatibility with legacy
Lennart Poettering [Tue, 11 Oct 2011 02:23:35 +0000 (04:23 +0200)]
timedate: fall back to /etc/sysconfig/clock on Fedora, for compatibility with legacy

9 years agounits: remount root and API FS before all mount units are applied
Lennart Poettering [Tue, 11 Oct 2011 01:41:04 +0000 (03:41 +0200)]
units: remount root and API FS before all mount units are applied

In order to ensure that bind mounts copy the final mount settings to the
new bind mount make the root and API FS mount options are applied before
the other file systems are mounted.

9 years agounits: introduce and
Lennart Poettering [Tue, 11 Oct 2011 01:33:53 +0000 (03:33 +0200)]
units: introduce and

This hook target enables services to order themselves between and remote mounts, which is needed for GFS2 and similar

9 years agol10n: Reword the polish translation a bit
Zbigniew Jędrzejewski-Szmek [Tue, 20 Sep 2011 07:09:15 +0000 (09:09 +0200)]
l10n: Reword the polish translation a bit

s/siedzenie/stanowisko/: they both translate to seat in English, but 'stanowisko'
is a place where you work, while 'siedzenie' is like a chair.

s/podłączanie/podłączenie/: we are doing it now, now sometime in the future.

9 years agoman: document list-unit-files
Ran Benita [Sat, 24 Sep 2011 09:04:16 +0000 (12:04 +0300)]
man: document list-unit-files

It's documented in the --help, but not in the manpage.

9 years agosd-login.h: correct spelling mistakes in comments
Dave Reisner [Mon, 26 Sep 2011 13:25:27 +0000 (09:25 -0400)]
sd-login.h: correct spelling mistakes in comments

9 years agohostname-setup: Frugalware switched to /etc/hostname
Miklos Vajna [Tue, 27 Sep 2011 18:45:51 +0000 (20:45 +0200)]
hostname-setup: Frugalware switched to /etc/hostname

9 years agoreadahead: lower max file size for readahead
Paolo Bonzini [Mon, 10 Oct 2011 23:43:58 +0000 (01:43 +0200)]
readahead: lower max file size for readahead

9 years agoman: .include directive does not include as textual include it includes by parsing...
Barry Scott [Mon, 3 Oct 2011 10:50:10 +0000 (11:50 +0100)]
man: .include directive does not include as textual include it includes by parsing the include file.

This means that section headers must be used inside of
a .include file otherwise all the lines are ignored.