Differences between revisions 122 and 123
Revision 122 as of 2010-12-26 02:42:00
Size: 13664
Editor: ?SedatDilek
Comment: UPDATE: libnotify-0.7 is now in experimental and the revert-patch is no more needed
Revision 123 as of 2010-12-26 02:43:44
Size: 13665
Editor: ?SedatDilek
Comment: Issue #3: Fix URL-ref (missing "]")
Deletions are marked like this. Additions are marked like this.
Line 88: Line 88:
UPDATE: libnotify-0.7 is now in experimental and the revert-patch is no more needed see upstream-fix [[http://cgit.freedesktop.org/systemd/commit/?id=d0ef2204b4256189afc2188f0765338d616ca757|here]. UPDATE: libnotify-0.7 is now in experimental and the revert-patch is no more needed see upstream-fix [[http://cgit.freedesktop.org/systemd/commit/?id=d0ef2204b4256189afc2188f0765338d616ca757|here]].

Translation(s): none


systemd - system and service manager

Introduction

systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux cgroups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It can work as a drop-in replacement for sysvinit.

Installation

Currently v11 is available from experimental and v15 is being worked on. systemd requires latest upstream version of dbus, means you need dbus >=1.4.0, which can also be found in experimental. You have to enhance your sources.list and add experimental Distribution.

To install systemd (and dbus) from experimental:

# apt-get update
# apt-get install -t experimental dbus systemd

You also need a kernel with the following options enabled:

  • CONFIG_DEVTMPFS=y
  • CONFIG_CGROUPS=y
  • CONFIG_AUTOFS4_FS=[y|m]
  • CONFIG_IPV6=[y|m], optional, but highly recommended
  • CONFIG_FANOTIFY=y, optional, required for systemd readahed. availabe in Linux kernel >= 2.6.37-rcX (debian-kernel-team is planning to provide when rc4 is out)

Since v8 the cgroupfs is mounted at /sys/fs/cgroup. This requires a Linux kernel >= 2.6.36 or a backport of this patch.

Debian Linux kernels (>= 2.6.32-23) are suitable.

Debian packages with native systemd support

dbus

(>=1.4.0-1)

experimental

supports socket activation

rsyslog

(>=5.7.1-1)

experimental

supports socket activation, run systemctl enable rsyslog.service

hal

(>=0.5.14-4)

experimental

supports D-Bus activation

consolekit

(>=0.4.3-1)

unstable

supports D-Bus activation

avahi

(>=0.6.28-1)

experimental

avahi-daemon: supports socket and D-Bus activation, avahi-dnsconfd: started by multi-user.target. Run systemctl enable avahi-daemon.service resp. systemctl enable avahi-dnsconfd.service.

network-manager

(>=0.8.2-3)

experimental

supports D-Bus activation, run systemctl enable NetworkManager.service

EXAMPLE (here for rsyslog, enable service after installation from Debian/experimental):

# systemctl enable rsyslog.service
Output:
ln -s '/lib/systemd/system/rsyslog.service' '/etc/systemd/system/multi-user.target.wants/rsyslog.service'
ln -s '/lib/systemd/system/rsyslog.socket' '/etc/systemd/system/sockets.target.wants/rsyslog.socket'

Known Issues and Workarounds

Issue #1: sysvinit vs. systemd-sysv

sysvinit is the current default init-system in Debian and is flagged as an "Essential" package. This means the package management tools will refuse to remove or replace the package unless forced. Also on dist-upgrades essential packages are preferred and will be re-installed. For more Details see chapters "3.8 Essential packages" and "5.6.9 Essential"

The systemd-sysvinit package ships /sbin/init (as a symlink to /bin/systemd) and therefore conflicts with the sysvinit package.

Workaround #1: Do not install systemd-sysv, enhance grub-line (Kernel command line) by "init=/bin/systemd". For a grub2 persistent solution (requires an update-grub to refresh /boot/grub/grub.cfg):

# $EDITOR /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet init=/bin/systemd" <--- Change this line

# update-grub

Workaround #2: Install systemd-sysv and put package "on hold".

The problem with "Essential flag" needs some discussion with the sysvinit maintainer.

Issue #2: agetty vs. getty

util-linux-ng has /sbin/agetty, Debian has renamed agetty to getty in its util-linux package (will be fixed for wheezy by Debian maintainer) (603786)

UPDATE: util-linux (2.17.2-4) in unstable ships both agetty and getty.

Issue #3: libnotify-0.7

Upstream systemd >=v12 requires libnotify 0.7 - this needs a revert as it is not available in Debian yet (603635)

UPDATE: libnotify-0.7 is now in experimental and the revert-patch is no more needed see upstream-fix here.

This issue is only a warning and can be ignored, we have it on TODO (see below "Make /etc/mtab a symlink to /proc/self/mounts. Requires a newer util-linux package which stores user options separately.").

The full error-message in dmesg:

[    5.784886] systemd[1]: /etc/mtab is not a symlink or not pointing to /proc/self/mounts. This is not supported anymore. Please make sure to replace this file by a symlink to avoid incorrect or misleading mount(8) output.

Workaround: 1. Create required symlink 2. Mask mtab and udev-mtab services (see also initscripts: /etc/init.d/mtab.sh and /etc/init.d/udev-mtab)

# ln -sf /proc/self/mounts /etc/mtab
# ls -l /etc/mtab
Output:
lrwxrwxrwx 1 root root 17 23. Nov 11:31 /etc/mtab -> /proc/self/mounts <--- Created new symlink

# ln -s /dev/null /etc/systemd/system/mtab.service      <--- Mask mtab.service
# ln -s /dev/null /etc/systemd/system/udev-mtab.service <--- Mask udev-mtab.service

Issue #5: Unsupported fsck -l option in Debian's util-linux

In systemd there are 3 fsck to be considered and have to work together. The fsck binary from util-linux(-ng) package which is a wrapper to the diverse fsck.$FS-Type (for example: fsck.ext4) binaries from e2fsprogs package. Last but not least systemd has its own systemd-fsck implementation. The fsck binary in Debian's util-linux has no support for "-l option", so -l is passed to the fsck.ext4 binary from e2fsprogs which requires "-l filename" (see also e2fsck(8)). This results in systemd-fsck error-code #16 and ending in maintenance mode.

Michael Biebl decided in his v15 package to revert Revert "Revert "fsck: add new -l switch to fsck mount options"" commit in systemd.

Another solution would be to debianize an upstream util-linux-ng GIT version which includes fsck: add support for whole-disk locking (-l option) commit. This is a post-v2.18 commit, so util-linux-ng v2.18 is also too old.

Native mount

With v12 or later you can use native (means systemd's) mount and fsck facility by activating it in /etc/systemd/system.conf.

# egrep 'MountAuto|SwapAuto' /etc/systemd/system.conf
Output:
MountAuto=yes
SwapAuto=yes

If you use Logical-Volume-Manager (LVM) and your swap partition is on a Logical-Volume (LV), you need to use the actual device (/dev/dm-X) in /etc/fstab until the lvm2 package has been updated to properly work together with udev (603710).

Check your /etc/fstab and via "udevadm info -q all -p /sys/block/<device>" (here: device: dm-1) command for symlink ("S:") entries:

# udevadm info -q all -p  /sys/block/dm-1 | grep "S:"
Output:
S: mapper/system-home
S: system/home
S: disk/by-id/dm-name-system-home
S: disk/by-id/dm-uuid-LVM-YRmqzcgoL4wzBxCENpzuiIGOdOYix99xtVy3dlXwJ9mOTftqSMri0eqKZiagJLqd
S: disk/by-uuid/700a75b0-b7a4-4ab1-9b62-f62faa2c785a
S: block/254:1

Debugging systemd

Sometimes it is necessary to investigate why systemd hangs on startup or on reboot/shutdown.

EXAMPLE:

  • When building a first v15 package a lot of people fell into the "fsck -l pitfall" (see Known Issues #5). Result: systemd-fsck gave back error-code #16 and got into maintenance mode (yay!).

Solution #0: Remove "quiet" from Kernel command line (so called "cmdline" or "grub line")

Solution #1: Increase verbosity via cmdline: Add "systemd.log_target=kmsg systemd.log_level=debug"

Of course you can have a "temporary" persistent solution:

[ /etc/default/grub ]
GRUB_CMDLINE_LINUX="systemd.log_target=kmsg systemd.log_level=debug" <--- Add here (by uncommenting you can easily switch to debug)

# update-grub

In addition enhance cmdline with "systemd.sysv_console=1" (0: disabled, 1: enabled).

Solution #2: Increase verbosity via /etc/systemd/system.conf

LogLevel=debug           <--- Uncomment this line and use "debug" (default: commented and "info")
LogTarget=syslog-or-kmsg <--- Uncomment this line (default: commented)
SysVConsole=yes          <--- Uncomment this line (default: commented)

HINT: "man system" and "man systemd.conf" (Note: File is system.conf vs. man-page system*d*.conf)

HINT: How to check Kernel command line parameters/options?

# cat /proc/cmdline

NOTE on ?LogLevel (see systemd(1) and systemd.conf(5)):

"Set log level. As argument this accepts a numerical log level or the well-known syslog(3) symbolic names (lowercase): emerg, alert, crit, err, warning, notice, info, debug."

HINT: Keep a copy of /sbin/init from sysvinit package in case of rescue (so you can use init=/sbin/init.sysvinit in cmdline)!

# cp -av /sbin/init /sbin/init.sysvinit <--- Before installing systemd-sysv package

Bugs and Bug-Tracking-Systems

TODO

  • Update more packages to ship systemd service files.
  • Draft a packaging policy involving systemd (upgrade / install / removal).
  • Provide integration for package maintainer tools: "dh_systemd"
  • invoke-rc.d/update-rc.d/service integration.
  • Get Essential flag removed from sysvinit.
  • Sort out what to do about pam_loginuid, and integration into the Debian PAM stack
  • Decide what to do about group:lock (/var/lock).
  • Make /etc/mtab a symlink to /proc/self/mounts. Requires a newer util-linux package which stores user options separately.
  • Make systemd-vconsole work. Investigate which of the console-* and kbd* packages are actually required and how to migrate the configuration.
  • Migration of /etc/inittab settings.
  • Enable and test cryptsetup support, get libcryptsetup moved to /lib.
  • Collaborative work: Check the whiteboard

WorkInProgress

  • Make /lib/init/rw a symlink to /var/run or install a lib-init-rw.automount lib-init-rw.mount unit file. For that to work, /var/run needs to be available early, even when /var is on a separate partition. Ubuntu uses a "showthrough" mount option, which is implemented in mountall using mount --bind and --move. NOTE: Michael Biebl has a workaround in his v15 (unofficial) package "Install a (auto)mount unit to mount /lib/init/rw early during boot."

Future plans

  • Communication channels: alioth project (+ mailing list) and/or a #debian-systemd IRC channel on OFTC
  • Announcement to the Debian mailing-lists: 1. Inform there is sth. awesome 2. Join the systemd party (use it and report, contribute to packaging or even upstream)

Where to get help?

As systemd is a very young project (see [1]), we would appreciate to use the existing upstream infrastructure like mailing-list [2], IRC and read Lennart's blog [3], etc. for following the development. Most people interested in systemd development (from diverse distributions) and Debian-specific packaging are around on IRC: #systemd (irc.freenode.net). Anyway, Debian-specific bugs should be sent to Debian-BTS (for example use report-bug tool).

  1. http://0pointer.de/blog/projects/systemd.html

  2. http://lists.freedesktop.org/mailman/listinfo/systemd-devel

  3. http://0pointer.de/blog/

Who is who?

Maintainer of the systemd package is Tollef Fog Heen (Mithrandir). Currently, it's discussed to get Michael Biebl (mbiebl) as co-maintainer. Michael and Sedat Dilek (dileks) contributed to the initial version of this wiki.

Resources

References