chiark / gitweb /
8 years agologind: when registering a new session always use previous session info from cgroup...
Lennart Poettering [Tue, 5 Mar 2013 02:29:54 +0000 (03:29 +0100)]
logind: when registering a new session always use previous session info from cgroup path rather than audit

Previously for cases like "su" or "sudo" where a session is attempted to
be created from within an existing one we used the audit session ID to
detect this and in such a case we simple returned the session data of
the original session a second time.

With this change we will now use the cgroup path of the calling path to
determine the old session, i.e. we only rely on our own session
identification scheme, instead of audits.

We will continue to keep the audit session ID and ours in sync however,
to avoid unnecessary confusion.

8 years agobuild-sys: build and install systemd-coredumpctl conditionally
Michael Biebl [Mon, 4 Mar 2013 22:20:16 +0000 (23:20 +0100)]
build-sys: build and install systemd-coredumpctl conditionally

If coredump support is disabled via --disable-coredump, do not build and
install the systemd-coredumpctl binary and man page.

8 years agofstab-generator: only handle block devices with root= kernel command line parameter
Harald Hoyer [Mon, 4 Mar 2013 20:00:56 +0000 (21:00 +0100)]
fstab-generator: only handle block devices with root= kernel command line parameter

skip like root=nfs:... root=iscsi:... root=nbd:...

8 years agofstab-generator: place initrd /sysroot mounts in
Harald Hoyer [Mon, 4 Mar 2013 18:04:32 +0000 (19:04 +0100)]
fstab-generator: place initrd /sysroot mounts in

also do not overwrite /sysroot*.mount units already generated from fstab

8 years agounits/initrd-*: require rather than
Harald Hoyer [Mon, 4 Mar 2013 18:03:05 +0000 (19:03 +0100)]
units/initrd-*: require rather than

8 years agoadd and
Harald Hoyer [Mon, 4 Mar 2013 18:01:05 +0000 (19:01 +0100)]
add and

8 years agobuild-sys: do not install pam_systemd(8) without PAM
Zbigniew Jędrzejewski-Szmek [Mon, 4 Mar 2013 18:16:38 +0000 (13:16 -0500)]
build-sys: do not install pam_systemd(8) without PAM

8 years agobuild-sys: do not install logind manpages when disabled
Zbigniew Jędrzejewski-Szmek [Mon, 4 Mar 2013 17:57:12 +0000 (12:57 -0500)]
build-sys: do not install logind manpages when disabled

The condition was wrong: HAVE_PAM -> ENABLE_LOGIND.

8 years agoProFUSION got bought by Intel
Kay Sievers [Mon, 4 Mar 2013 15:13:19 +0000 (16:13 +0100)]
ProFUSION got bought by Intel

8 years agojournal: split journal uid only when audit uid data is valid
Kay Sievers [Mon, 4 Mar 2013 14:17:45 +0000 (15:17 +0100)]
journal: split journal uid only when audit uid data is valid

8 years agocore/manager: fix conditions to start and stop watching running jobs
Michal Schmidt [Mon, 4 Mar 2013 13:38:51 +0000 (14:38 +0100)]
core/manager: fix conditions to start and stop watching running jobs

Harald encountered division by zero in manager_print_jobs_in_progress.
Clearly we had the watch enabled when we shouldn't - there were no
running jobs in m->jobs, only waiting ones. This is either a deadlock,
or maybe some of them would be detected as runnable in the next dispatch
of the run queue. In any case we mustn't crash.

Fix it by starting and stopping the watch based on n_running_jobs
instead of the number of all jobs.

8 years agotmpfiles: use cleanup func. to save a few lines
Zbigniew Jędrzejewski-Szmek [Sun, 3 Mar 2013 23:42:52 +0000 (18:42 -0500)]
tmpfiles: use cleanup func. to save a few lines

8 years agotmpfiles: move exclamation mark into right place
Lukas Nykryn [Fri, 1 Mar 2013 17:29:59 +0000 (18:29 +0100)]
tmpfiles: move exclamation mark into right place

Unary not has higher precedence than comparisons,
so the condition was bogus.

8 years agocore/path: install inotify watches top-down instead of bottom-up
Zbigniew Jędrzejewski-Szmek [Sun, 3 Mar 2013 06:32:34 +0000 (01:32 -0500)]
core/path: install inotify watches top-down instead of bottom-up

When watches are installed from the bottom, it is always possible
to race, and miss a file creation event. The race can be avoided
if a watch is first established for a parent directory, and then for
the file in the directory. If the file is created in the time between,
the watch on the parent directory will fire.

Some messages (mostly at debug level) are added to help diagnose
pidfile issues.

Should fix

8 years agobuild-sys: be more tolerant if dbus directories do not exist
Michael Biebl [Mon, 4 Mar 2013 01:13:34 +0000 (02:13 +0100)]
build-sys: be more tolerant if dbus directories do not exist

use readlink -m instead of -f since we might be building in a minimal
chroot where those directories do not actually exist and readlink -f
would return an empty string.

8 years agobuild-sys: resolve absolute path for the dbus directories
Michael Biebl [Mon, 4 Mar 2013 00:39:22 +0000 (01:39 +0100)]
build-sys: resolve absolute path for the dbus directories

/usr/share/dbus-1/system-services simply looks a lot nicer then

8 years agobuild-sys: replace backticks `` with $()
Michael Biebl [Mon, 4 Mar 2013 00:38:16 +0000 (01:38 +0100)]
build-sys: replace backticks `` with $()

for consistencies sake use $() everywhere

8 years agobuild-sys: don't hard code bash-completion directory
Michael Biebl [Sun, 3 Mar 2013 20:32:49 +0000 (21:32 +0100)]
build-sys: don't hard code bash-completion directory

8 years agobuild-sys: use $PKG_CONFIG instead of calling the pkg-config binary directly
Michael Biebl [Sun, 3 Mar 2013 20:27:44 +0000 (21:27 +0100)]
build-sys: use $PKG_CONFIG instead of calling the pkg-config binary directly

8 years agoudev: fix segfault with android rndis
Rob Clark [Sun, 3 Mar 2013 17:55:08 +0000 (12:55 -0500)]
udev: fix segfault with android rndis

The android gadget driver for network tethering over rndis somehow has a
parent device with a null subsystem.  Probably this is bug in android driver,
but it is easy enough to make systemd/udev behave gracefully and not
segfault.  And this will help for making linux distros with systemd
(like fedora) work on android devices.

8 years agoudev: remove database conversion code
Kay Sievers [Sun, 3 Mar 2013 17:35:22 +0000 (18:35 +0100)]
udev: remove database conversion code

8 years agoudev: firmware - do not created /run/udev/firmware-missing/
Kay Sievers [Sun, 3 Mar 2013 17:20:09 +0000 (18:20 +0100)]
udev: firmware - do not created /run/udev/firmware-missing/

The userspace firmware loader is deprecated now, and will be entirely
removed when we depend on a kernel version with the built-in firmware
loader available.

8 years agojournald: do not barf when setting RateLimitInterval=0
Zbigniew Jędrzejewski-Szmek [Sun, 3 Mar 2013 01:14:21 +0000 (20:14 -0500)]
journald: do not barf when setting RateLimitInterval=0

Assertion 'interval > 0 || burst == 0' failed at src/journal/journald-rate-limit.c:78, function journal_rate_limit_new(). Aborting.

8 years agocore/service: use cleanup functions, wrap lines
Zbigniew Jędrzejewski-Szmek [Sat, 2 Mar 2013 13:28:58 +0000 (08:28 -0500)]
core/service: use cleanup functions, wrap lines

8 years agocore/path: catch errors when adding watches
Zbigniew Jędrzejewski-Szmek [Sun, 3 Mar 2013 06:49:11 +0000 (01:49 -0500)]
core/path: catch errors when adding watches

Errors because of oom conditions or descriptor exhaustion should not
be ignored. We probably cannot recover from those conditions.

Current behaviour wrt. insufficient permissions is described in the
man page. It might make sense in case of user sessions, so I left
it as is.

8 years agocore/path: modernize style
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2013 23:04:36 +0000 (18:04 -0500)]
core/path: modernize style

8 years agocore/path: use automatic cleanup
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2013 22:58:56 +0000 (17:58 -0500)]
core/path: use automatic cleanup

... and fix bogus return code on malloc failure.

8 years agocore/path: fix a leak in success path
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2013 22:44:25 +0000 (17:44 -0500)]
core/path: fix a leak in success path

... and use automatic cleanup.

8 years agoUpdate TODO
Michael Biebl [Sun, 3 Mar 2013 13:40:49 +0000 (14:40 +0100)]
Update TODO

8 years agobash-completion: split completions and move to new location
Michael Biebl [Sat, 2 Mar 2013 21:34:01 +0000 (22:34 +0100)]
bash-completion: split completions and move to new location

Split the large bash completion script into separate, smaller files each
named after the binary it is used for and move the files to
/usr/share/bash-completion/completions. This way the completions can be
loaded on demand and we only install the completions for the tools we
actually build. The old path /etc/bash_completion.d/ is deprecated and
will disappear in the future.

8 years agojob: print the "OK" status messages in normal green
Michal Schmidt [Sat, 2 Mar 2013 12:16:27 +0000 (13:16 +0100)]
job: print the "OK" status messages in normal green

The "OK" status messages should not draw attention to themselves.
It's better if they're not printed in bright/bold. Leave that
to errors and warnings.

Use a plain inconspicuous enterprisey green.

8 years agomanager: turn a superfluous check into assert
Michal Schmidt [Sat, 2 Mar 2013 11:44:41 +0000 (12:44 +0100)]
manager: turn a superfluous check into assert

The crash that the check prevented has been fixed by commit 9e9e2b7.

8 years agounit: count deserialized job only after it's definitely installed
Michal Schmidt [Sat, 2 Mar 2013 11:29:04 +0000 (12:29 +0100)]
unit: count deserialized job only after it's definitely installed

Installation of a deserialized job may fail (though purely in theory),
so increase the running job counter only when succeeding.

8 years agoinitrd: add unit files needed for basic systemd-in-initrd support
Tom Gundersen [Sun, 24 Feb 2013 16:40:36 +0000 (17:40 +0100)]
initrd: add unit files needed for basic systemd-in-initrd support

This will:
 * mount all configured filesystems (typically the rootfs on /sysroot)
 * reload the configuration to pick up anything from the mounted fs (typically
 * mount any newly configured filesystems (typically /usr on /sysroot/usr, if
 * shut-down and clean-up any daemons running in the initramfs (typically udevd)
 * switch-root to /sysroot and start the real init

For an example of what files should be included in an initramfs based on this

Cc: Harald Hoyer <>
Cc: Dave Reisner <>
8 years agofstab-generator: initrd - mount selected entries from /sysroot/etc/fstab
Tom Gundersen [Fri, 22 Feb 2013 10:52:36 +0000 (11:52 +0100)]
fstab-generator: initrd - mount selected entries from /sysroot/etc/fstab

We only mount "/usr" and entries marked with "x-initrd.mount".

This (together with the right unit files) is needed in the initramfs in order to
natively support mounting /usr (and friends) from the initramfs.

The way it is meant to work is:
 * wait for sysroot.mount to be mounted
 * do a daemon-reload to generate sysroot-usr.mount (++) from /sysroot/etc/fstab
 * wait for sysroot-usr.mount to be mounted
 * switch-root

Cc: Harald Hoyer <>
Cc: Dave Reisner <>
8 years agosystemctl: check if iterator was initialized succesfully
Lukas Nykryn [Fri, 1 Mar 2013 17:29:58 +0000 (18:29 +0100)]
systemctl: check if iterator was initialized succesfully

8 years agomanager: print p and then free it
Lukas Nykryn [Fri, 1 Mar 2013 17:30:01 +0000 (18:30 +0100)]
manager: print p and then free it

8 years agosystemd-analyze: free unit_times only if it is not NULL
Lukas Nykryn [Fri, 1 Mar 2013 17:30:00 +0000 (18:30 +0100)]
systemd-analyze: free unit_times only if it is not NULL

8 years agosystemd-python: add missing check for return of PyDict_SetItem in _reader.c
Lukas Nykryn [Fri, 1 Mar 2013 17:29:57 +0000 (18:29 +0100)]
systemd-python: add missing check for return of PyDict_SetItem in _reader.c

8 years agofstab-generator: drop rootwait support
Tom Gundersen [Fri, 1 Mar 2013 20:15:51 +0000 (21:15 +0100)]
fstab-generator: drop rootwait support

I originally added this to stay as compatible as possible with the kernel, but
as Lennart argued it is not really useful in the initramfs, so let's drop it (we
already don't support 'rootdealy').

8 years agoupdate TODO
Lennart Poettering [Fri, 1 Mar 2013 18:21:47 +0000 (19:21 +0100)]
update TODO

8 years agoinhibit: make the output more readable
Mantas Mikulėnas [Sun, 17 Feb 2013 19:00:34 +0000 (21:00 +0200)]
inhibit: make the output more readable

The columnar output can become pretty horrible. When GNOME inhibits
power/suspend/hibernate keys, the "WHAT" column's text extends to "WHO"
and even "WHY". At the same time, all texts in "WHY" are of the form

    GNOME handlin...sses
    Receiving sle...ions
    GNOME needs t...reen

This patch splits each inhibit entry into four lines, allowing the full
text to fit in a normal-width terminal.

8 years agocoredump: bump coredump truncation size from 24M to 768M
Lennart Poettering [Fri, 1 Mar 2013 14:19:00 +0000 (15:19 +0100)]
coredump: bump coredump truncation size from 24M to 768M

In the long run we really should make this runtime configurable.

8 years agocore: fix running jobs counters after reload/reexec
Michal Schmidt [Fri, 1 Mar 2013 13:47:46 +0000 (14:47 +0100)]
core: fix running jobs counters after reload/reexec

All active units will call unit_notify() during coldplug, so we just
make sure we're counting from zero again and get the correct result for

For n_running_jobs we likewise reset it to zero and then count
the running jobs as we encounter them in deserialization.

8 years agofstab-generator: set "ro" as default for sysroot.mount
Harald Hoyer [Fri, 1 Mar 2013 16:49:06 +0000 (17:49 +0100)]
fstab-generator: set "ro" as default for sysroot.mount

8 years agofstab-generator: fix commit 92094b7
Harald Hoyer [Fri, 1 Mar 2013 16:05:58 +0000 (17:05 +0100)]
fstab-generator: fix commit 92094b7

8 years agounit: fix the race in deserialization.
Oleksii Shevchuk [Wed, 13 Feb 2013 22:49:26 +0000 (00:49 +0200)]
unit: fix the race in deserialization.

unit_notify is fired in deserelization code (particulary in
service_set_state). Units passed in random order, and there is possibility,
that unit with StopWhenUnneeded=yes passed before it actual dependecies. In
that case unit will be stopped as unneeded, because deps in UNIT_INACTIVE state

So, reuse similar logic (unit.c:1421) to avoid this race

8 years agofstab-generator: parse_new_root_from_proc_cmdline() don't use "defaults"
Harald Hoyer [Fri, 1 Mar 2013 13:58:32 +0000 (14:58 +0100)]
fstab-generator: parse_new_root_from_proc_cmdline() don't use "defaults"

Don't use "defaults" as default option string.

"defaults,<anyotheroption>" does not
even work for the mount unit mount options.

8 years agomanager: prevent segfault in manager_print_jobs_in_progress()
Harald Hoyer [Fri, 1 Mar 2013 13:57:16 +0000 (14:57 +0100)]
manager: prevent segfault in manager_print_jobs_in_progress()

8 years agocryptsetup-generator: fix the kernel command line strategy for luks.uuid
Harald Hoyer [Fri, 1 Mar 2013 10:33:14 +0000 (11:33 +0100)]
cryptsetup-generator: fix the kernel command line strategy for luks.uuid

If rd.luks.uuid or luks.uuid is specified on the kernel command, only
generate units for these UUIDs. Additionally use the information in
/etc/crypttab unless rd.luks.crypttab=0 or luks.crypttab=0 is specified.

8 years agospecifier: when resolving specifier strings when loading configuration, don't misunde...
Lennart Poettering [Fri, 1 Mar 2013 13:54:55 +0000 (14:54 +0100)]
specifier: when resolving specifier strings when loading configuration, don't misunderstand parse failures as OOM

8 years agofstab,mount: detect rbind as bind mount
Frederic Crozat [Thu, 21 Feb 2013 15:09:40 +0000 (16:09 +0100)]
fstab,mount: detect rbind as bind mount

Correctly detect rbind mount option as bind mount.


8 years agojournalctl: add --user-unit= switch
Daniel Wallace [Fri, 1 Mar 2013 13:39:04 +0000 (14:39 +0100)]
journalctl: add --user-unit= switch

Add --user-unit= to make it possible to query for user logs by the name
of the service.

8 years agopath-lookup: downgrade again the messages where we log for units
Lennart Poettering [Fri, 1 Mar 2013 13:07:20 +0000 (14:07 +0100)]
path-lookup: downgrade again the messages where we log for units

This partially reverts 7ad94c716d6403233d04c4d37cb14df958c9b65d.

After that commit commands such as "systemctl enable" and friends
printed the search path information multiple times in its output, which
is ugly.

If we want the search paths to be printed at a higher log level, then we
should do this in PID 1 only, i.e. split the printing out of the normal
path lookup logic and invoke that explicitly from PID 1 but not in the
auxiliary tools.

8 years agoRevert "systemctl: try to reload daemon after enable/disable only when not running...
Lennart Poettering [Fri, 1 Mar 2013 13:04:18 +0000 (14:04 +0100)]
Revert "systemctl: try to reload daemon after enable/disable only when not 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.

8 years agosystemctl: try to reload daemon after enable/disable only when not running in a chroot
Lennart Poettering [Fri, 1 Mar 2013 12:59:49 +0000 (13:59 +0100)]
systemctl: try to reload daemon after enable/disable only when not running in a chroot

8 years agopager: add K to less environment
Lukas Nykryn [Wed, 27 Feb 2013 15:26:59 +0000 (16:26 +0100)]
pager: add K to less environment

Using less as a pager sometimes breaks terminal when output
is interrupted by ctrl-c.

Reproducer: run 'sudo journalctl' ctrl-c.

Thanks for the solution.

8 years agojournalctl: add --reverse option to show the newest lines first
Lukas Nykryn [Fri, 1 Mar 2013 09:27:10 +0000 (10:27 +0100)]
journalctl: add --reverse option to show the newest lines first

8 years agoMerge branch 'python-systemd-reader'
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2013 00:53:42 +0000 (19:53 -0500)]
Merge branch 'python-systemd-reader'

* python-systemd-reader:
  python-systemd: rename Journal to Reader
  build-sys: upload python documentation to
  systemd-python: add Journal class for reading journal
  python: build html docs using sphinx
  journalct: also print Python code in --new-id
  python: utilize uuid.UUID in logging
  python: add systemd.id128 module
  ... and 34 other commits

In short: python module systemd.id128 is added, and existing
systemd.journal gains a new class systemd.journal.Reader, which can be
used to iterate over journal entries. Documentation is provided, and
accessible under e.g.
    pydoc3 systemd.journal.Reader

8 years agopython-systemd: rename Journal to Reader
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2013 00:32:31 +0000 (19:32 -0500)]
python-systemd: rename Journal to Reader

It seems inevitable that we'll also grow a writing interface,
and then it'll be cumbersome to have a "Journal" for reading,
and a "Writer" for writing.

8 years agosystemd-python: return both parts of sd_journal_get_monotonic_usec
Zbigniew Jędrzejewski-Szmek [Sat, 23 Feb 2013 00:11:36 +0000 (01:11 +0100)]
systemd-python: return both parts of sd_journal_get_monotonic_usec

In Python 3, a named tuple is used. In Python 2, a simple
tuple is used. In either case, the pair is (timestamp, bootid).

8 years agopython-systemd: check all errors and use automatic cleanup
Zbigniew Jędrzejewski-Szmek [Fri, 22 Feb 2013 12:33:06 +0000 (13:33 +0100)]
python-systemd: check all errors and use automatic cleanup

It doesn't make sense to convert to string, just to convert
back to a number later on.

Also try to follow systemd rules for indentation.

8 years agobuild-sys: upload python documentation to
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2013 17:10:08 +0000 (18:10 +0100)]
build-sys: upload python documentation to

8 years agosystemd-python: hide ChainMap import
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2013 14:08:01 +0000 (15:08 +0100)]
systemd-python: hide ChainMap import

8 years agosystemd-python: document attributes
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2013 14:07:39 +0000 (15:07 +0100)]
systemd-python: document attributes

In id128 it would be better to add everything automatically, but
sphinx cannot do this right now.

8 years agosystemd-python: use PyModule_AddObject in id128
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2013 13:23:57 +0000 (14:23 +0100)]
systemd-python: use PyModule_AddObject in id128

8 years agobuild-sys: make sphinx support uncoditional
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2013 08:20:35 +0000 (09:20 +0100)]
build-sys: make sphinx support uncoditional

It needs to be invoked explicitly, so there's no need to check

8 years agosystemd-python: polish the docstrings
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2013 04:03:32 +0000 (23:03 -0500)]
systemd-python: polish the docstrings

8 years agoman: clarify systemctl --property= documentation a bit
Lennart Poettering [Thu, 28 Feb 2013 18:55:48 +0000 (19:55 +0100)]
man: clarify systemctl --property= documentation a bit

8 years agoupdate TODO
Lennart Poettering [Thu, 28 Feb 2013 12:48:53 +0000 (13:48 +0100)]
update TODO

8 years agoman: fix docbook in systemd-activate(8)
Zbigniew Jędrzejewski-Szmek [Thu, 28 Feb 2013 03:38:26 +0000 (22:38 -0500)]
man: fix docbook in systemd-activate(8)

8 years agoman: document systemd-nspawn behaviour with -b
Zbigniew Jędrzejewski-Szmek [Thu, 28 Feb 2013 03:25:40 +0000 (22:25 -0500)]
man: document systemd-nspawn behaviour with -b

Cf. cb96a2c69 and 1ddf879a.

8 years agosystemd-activate: add a socket-activation test tool
Zbigniew Jędrzejewski-Szmek [Sat, 23 Feb 2013 16:52:04 +0000 (17:52 +0100)]
systemd-activate: add a socket-activation test tool

8 years agonspawn: environment would be truncated with TERM unset
Zbigniew Jędrzejewski-Szmek [Sat, 23 Feb 2013 13:44:16 +0000 (14:44 +0100)]
nspawn: environment would be truncated with TERM unset

8 years agoman: drop rhs parts in snippets in directive index
Zbigniew Jędrzejewski-Szmek [Thu, 28 Feb 2013 02:31:02 +0000 (21:31 -0500)]
man: drop rhs parts in snippets in directive index

-       --exit-if-exists=file
+       --exit-if-exists=

8 years agobuild-sys: fix update-man-rules for vpath builds
Zbigniew Jędrzejewski-Szmek [Thu, 28 Feb 2013 01:16:38 +0000 (20:16 -0500)]
build-sys: fix update-man-rules for vpath builds

8 years agobuild-sys: tell to distribute kernel-install
Zbigniew Jędrzejewski-Szmek [Thu, 28 Feb 2013 02:48:34 +0000 (21:48 -0500)]
build-sys: tell to distribute kernel-install

8 years agocore/manager: print status messages about running jobs
Michal Schmidt [Wed, 27 Feb 2013 23:03:22 +0000 (00:03 +0100)]
core/manager: print status messages about running jobs

Sometimes the boot gets stuck until a timeout hits. The usual timeouts
are on the order of minutes, so users may lose patience.

Print animated status messages telling the names of units with running
jobs to make it easy to see what systemd is waiting for.

The animation looks cooler with a shorter interval, but 1 s is OK and
should not be too hard on slow serial console users.

8 years agocore: count active units that may mind our printing to /dev/console
Michal Schmidt [Wed, 27 Feb 2013 23:01:10 +0000 (00:01 +0100)]
core: count active units that may mind our printing to /dev/console

8 years agocore/execute: determine if ExecContext may fiddle with /dev/console
Michal Schmidt [Thu, 28 Feb 2013 00:36:55 +0000 (01:36 +0100)]
core/execute: determine if ExecContext may fiddle with /dev/console

There is some guesswork, but it should work satisfactorily for the
purpose of knowing when to suppress printing of status messages.

8 years agocore/execute: add internal is_terminal_output()
Michal Schmidt [Thu, 28 Feb 2013 00:35:47 +0000 (01:35 +0100)]
core/execute: add internal is_terminal_output()

Similar to already existing is_terminal_input().

Note that the only current user (connect_logger_as) is never called
for EXEC_OUTPUT_TTY, so it won't mind whether we accept it.

8 years agoutil: split resolving of /dev/console into a new function
Michal Schmidt [Thu, 28 Feb 2013 00:30:38 +0000 (01:30 +0100)]
util: split resolving of /dev/console into a new function

8 years agocore/unit: use a temp variable for manager pointer in unit_notify()
Michal Schmidt [Wed, 27 Feb 2013 22:58:10 +0000 (23:58 +0100)]
core/unit: use a temp variable for manager pointer in unit_notify()

8 years agoutil, core: add support for ephemeral status lines
Michal Schmidt [Wed, 27 Feb 2013 21:52:43 +0000 (22:52 +0100)]
util, core: add support for ephemeral status lines

Ephemeral status lines do not end with a newline and they expect to be
overwritten by the next printed status line.

8 years agocore/transaction: replace a bare status_printf()
Michal Schmidt [Wed, 27 Feb 2013 22:31:35 +0000 (23:31 +0100)]
core/transaction: replace a bare status_printf()

Like other status messages, this one too should not be printed
unconditionally, but it should take the manager state into account.
unit_status_printf() does that.

8 years agocore: redefine unit_status_printf()
Michal Schmidt [Wed, 27 Feb 2013 21:54:14 +0000 (22:54 +0100)]
core: redefine unit_status_printf()

Take advantage of the fact that almost all callers want to pass unit
description as the last parameter. Those who don't can use the more
flexible manager_status_printf().

8 years agocore/manager: make a couple of functions static
Michal Schmidt [Wed, 27 Feb 2013 23:14:47 +0000 (00:14 +0100)]
core/manager: make a couple of functions static

They're not used outside manager.c anymore.

8 years agocore: add manager_status_printf()
Michal Schmidt [Wed, 27 Feb 2013 23:14:40 +0000 (00:14 +0100)]
core: add manager_status_printf()

unit_status_printf() checks the state of the manager, not of the unit
as such. Move it to manager.c and rename it to manager_status_printf().

Temporarily keep unit_status_printf as a wrapper macro.

8 years agocore: keep track of the number of JOB_RUNNING jobs
Michal Schmidt [Tue, 26 Feb 2013 11:09:41 +0000 (12:09 +0100)]
core: keep track of the number of JOB_RUNNING jobs

8 years agoman: document the new systemctl cgroup commands
Lennart Poettering [Wed, 27 Feb 2013 18:37:04 +0000 (19:37 +0100)]
man: document the new systemctl cgroup commands

8 years agosystemctl: fix minimal number of params for new cgroup commands
Lennart Poettering [Wed, 27 Feb 2013 17:58:56 +0000 (18:58 +0100)]
systemctl: fix minimal number of params for new cgroup commands

8 years agoupdate TODO
Lennart Poettering [Wed, 27 Feb 2013 17:56:25 +0000 (18:56 +0100)]
update TODO

8 years agounit: rework resource management API
Lennart Poettering [Wed, 27 Feb 2013 17:50:41 +0000 (18:50 +0100)]
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.

8 years agosystemctl: fix indentation
Lennart Poettering [Wed, 27 Feb 2013 14:01:06 +0000 (15:01 +0100)]
systemctl: fix indentation

8 years agoupdate TODO
Lennart Poettering [Wed, 27 Feb 2013 14:00:38 +0000 (15:00 +0100)]
update TODO

8 years agoman: clarify how to configure default control group hierarchies for services and...
Lennart Poettering [Wed, 27 Feb 2013 14:00:26 +0000 (15:00 +0100)]
man: clarify how to configure default control group hierarchies for services and sessions

8 years agoRevert "log: fix fallbacks to kmsg"
Lennart Poettering [Wed, 27 Feb 2013 13:33:50 +0000 (14:33 +0100)]
Revert "log: fix fallbacks to kmsg"

This reverts commit 4a01181e460686d8b4a543b1dfa7f77c9e3c5ab8.

This patch broke LOG_TARGET_AUTO, i.e. automatic selection of STDERR if
it is a TTY with a fallback on the journal and kmsg otherwise.

The general rule should probably be:

log_open() -- open the "best" possible logging channel according to
log_target configuration.

log_dispatch() -- don't open any log channels ever, with the exception
of kmsg since that has no drawbacks. And do this only on true errors of
the better log channel, not just when it wasn't opened.

8 years agomount-setup: mount pstore filesystem
Kay Sievers [Wed, 27 Feb 2013 12:07:09 +0000 (13:07 +0100)]
mount-setup: mount pstore filesystem

8 years agolog-show: look at everything in /run/log/journal
Zbigniew Jędrzejewski-Szmek [Mon, 25 Feb 2013 04:51:41 +0000 (05:51 +0100)]
log-show: look at everything in /run/log/journal

Logs written by journald from the initramfs may be written to a
directory with the name created from a random machine-id. Afterwards,
when the root filesystem has been mounted and machine-id reinitalized,
logs will be written to the directory with a name created from the
proper machine-id. When logs are flushed to /var/log/journal,
everything is copied to one output directory.

When journalctl without '-m' is run after the logs have been flushed
to /var/log/journal, all messages are shown. However, when run while
logs are still in /run/log/journal, those stored under the random
machine-id will not be shown.

Make journalctl behave the same regardless whether persistent storage
has been enabled or not, and slurp all files from /run/log/journal
even without '-m'.

8 years agobash-completion: journalctl query by binary and device
Zbigniew Jędrzejewski-Szmek [Mon, 25 Feb 2013 14:24:10 +0000 (15:24 +0100)]
bash-completion: journalctl query by binary and device

The approach taken is different between the two:
- since there are many files in /usr, but messages appear
  only for a tiny subset, the completion is performed
  only for stuff shown by journalctl -F _EXE. This makes
  sense because the list is already in proper form.
- since it is hard to convert _KERNEL_DEVICE to device
  file name, simply all files in /dev/ are used as possible

Unfortunately zsh completion requires more work and is not
covered by this commit.