Package: systemd Version: 29-1 Severity: minor Tags: sid Hi,
I have a weird issue with systemd I cannot quite grasp. I think this is a bug, but maybe someone more experienced can shed some light on it. My new Mailserver-to-be is a KVM VM (on a Squeeze host), that has been installed as a minimal squeeze system, then fully upgraded to wheezy, and then added sid with a lower preference to be able to install systemd (basically util-linux, udev and systemd come from unstable). After installing Postfix each shutdown of the VM is delayed by 90 seconds. I've made a stab at debugging and I think there could be a systemd bug involved. When looking at the process table while the system is shutting down, it is spending the 90 seconds with the following processes: root 922 0.0 0.2 124720 2096 pts/0 Ss 21:39 0:00 -bash root 986 0.0 0.1 19000 1012 ? Ss 21:40 0:00 /lib/systemd/systemd-initctl root 987 0.0 0.0 4060 544 ? Ss 21:40 0:00 /sbin/ifdown eth0 root 988 0.0 0.0 4144 580 ? S 21:40 0:00 /bin/sh -c run-parts /etc/network/if-down.d root 989 0.0 0.0 4044 576 ? S 21:40 0:00 run-parts /etc/network/if-down.d root 991 0.0 0.0 4144 580 ? S 21:40 0:00 /bin/sh -e /etc/network/if-down.d/postfix root 998 0.0 0.0 4144 656 ? S 21:40 0:00 /bin/sh -e /etc/init.d/postfix reload root 1125 0.0 0.0 16676 652 ? Ss 21:40 0:00 /lib/systemd/systemd-kmsg-syslogd root 1326 0.0 0.1 19116 976 ? S 21:40 0:00 /bin/systemctl reload postfix.service basically it is spending 90 seconds in systemctl reload postfix.service, which is executed by /etc/network/if-down.d/postfix through redirection of /etc/init.d/postfix. systemctl at this point: root@mail:~# systemctl UNIT LOAD ACTIVE SUB JOB DESCRIPTION dev-hugepages.automount loaded active waiting Huge Pages File System Automount Point dev-mqueue.automount loaded active waiting POSIX Message Queue File System Automount Point lib-init-rw.automount loaded active waiting Debian early rw Automount Point proc-sys...misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point sys-kern...ebug.automount loaded active waiting Debug File System Automount Point sys-kern...rity.automount loaded active waiting Security File System Automount Point sys-devi...ock-sr0.device loaded active plugged QEMU_DVD-ROM sys-devi...et-eth0.device loaded active plugged Virtio network device sys-devi...da-vda1.device loaded active plugged /sys/devices/pci0000:00/0000:00:04.0/virtio1/block/vda/vda1 sys-devi...da-vda2.device loaded active plugged /sys/devices/pci0000:00/0000:00:04.0/virtio1/block/vda/vda2 sys-devi...da-vda5.device loaded active plugged /sys/devices/pci0000:00/0000:00:04.0/virtio1/block/vda/vda5 sys-devi...ock-vda.device loaded active plugged /sys/devices/pci0000:00/0000:00:04.0/virtio1/block/vda sys-devi...y-ttyS0.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS0 sys-devi...y-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS1 sys-devi...y-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2 sys-devi...y-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3 sys-devi...ty-tty0.device loaded active plugged /sys/devices/virtual/tty/tty0 sys-devi...ty-tty1.device loaded active plugged /sys/devices/virtual/tty/tty1 sys-devi...y-tty10.device loaded active plugged /sys/devices/virtual/tty/tty10 sys-devi...y-tty11.device loaded active plugged /sys/devices/virtual/tty/tty11 sys-devi...y-tty12.device loaded active plugged /sys/devices/virtual/tty/tty12 sys-devi...ty-tty2.device loaded active plugged /sys/devices/virtual/tty/tty2 sys-devi...ty-tty3.device loaded active plugged /sys/devices/virtual/tty/tty3 sys-devi...ty-tty4.device loaded active plugged /sys/devices/virtual/tty/tty4 sys-devi...ty-tty5.device loaded active plugged /sys/devices/virtual/tty/tty5 sys-devi...ty-tty6.device loaded active plugged /sys/devices/virtual/tty/tty6 sys-devi...ty-tty7.device loaded active plugged /sys/devices/virtual/tty/tty7 sys-devi...ty-tty8.device loaded active plugged /sys/devices/virtual/tty/tty8 sys-devi...ty-tty9.device loaded active plugged /sys/devices/virtual/tty/tty9 -.mount loaded active mounted / media.mount loaded active mounted stop Media Directory systemd-...d-console.path loaded active waiting stop Dispatch Password Requests to Console Directory Watch systemd-...word-wall.path loaded active waiting stop Forward Password Requests to Wall Directory Watch console-setup.service loaded active exited LSB: Set console font and keymap [email protected] loaded deactivating stop stop Start ifup for eth0 ifupdown-clean.service loaded active exited LSB: Clean old interface status info during boot. ifupdown.service loaded active exited stop LSB: Prepare the system for taking up interfaces. kbd.service loaded active exited LSB: Prepare console keyboard-setup.service loaded active exited LSB: Set preliminary keymap mountoverflowtmp.service loaded active exited LSB: mount emergency /tmp. networking.service loaded active exited stop LSB: Raise network interfaces. postfix.service loaded inactive dead reload LSB: start and stop the Postfix Mail Transport Agent reboot.service loaded inactive dead start Reboot remount-rootfs.service loaded active exited stop Remount Root FS ssh.service loaded failed failed LSB: OpenBSD Secure Shell server systemd-initctl.service loaded active running /dev/initctl Compatibility Daemon systemd-...yslogd.service loaded active running Syslog Kernel Log Buffer Bridge systemd-logger.service loaded active running Stdio Syslog Bridge systemd-...s-load.service loaded active exited stop Load Kernel Modules systemd-...pi-vfs.service loaded active exited stop Remount API VFS systemd-sysctl.service loaded active exited stop Apply Kernel Variables systemd-...-setup.service loaded active exited Recreate Volatile Files and Directories systemd-...utdown.service loaded inactive dead start Notify Audit System and Update UTMP about System Shutdown udev-trigger.service loaded active exited udev Coldplug all Devices udev.service loaded active running udev Kernel Device Manager syslog.socket loaded active running Syslog Socket systemd-initctl.socket loaded active running /dev/initctl Compatibility Named Pipe systemd-logger.socket loaded active running Stdio Syslog Bridge Socket systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket udev-control.socket loaded active listening udev Control Socket udev-kernel.socket loaded active listening udev Kernel Socket dev-disk...68bd493be.swap loaded active active stop /dev/disk/by-uuid/e7e860ca-18ba-4aa3-a495-f9968bd493be basic.target loaded active active stop Basic System final.target loaded inactive dead start Final Step local-fs.target loaded active active stop Local File Systems reboot.target loaded inactive dead start Reboot shutdown.target loaded inactive dead start Shutdown sockets.target loaded active active stop Sockets swap.target loaded active active stop Swap sysinit.target loaded active active stop System Initialization syslog.target loaded active active Syslog umount.target loaded inactive dead start Unmount All Filesystems systemd-...es-clean.timer loaded active waiting stop Daily Cleanup of Temporary Directories I think it is a systemd bug, because I have found two ways to solve this problem: a) add export _SYSTEMCTL_SKIP_REDIRECT="true" to /etc/network/if-down.d/postfix to avoid the systemctl redirection in the initscript. Which makes me believe it is not the code in the initscript itself that is creating this delay b) add sleep 1 to the top of this script. I think the problem is a race condition. I think systemd treats postfix.service as stopped and continues to deactivating [email protected]. Which executes the ifdown- script. At least at the beginning of this script postfix must still be running, otherwise it would not execute postfix reload at all. It seems that issuing reload on a service that has just died (or is in process of dying) could cause this problem. Do you need any more information to reproduce this? Bernhard -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (900, 'testing'), (800, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.39-2-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages systemd depends on: ii initscripts 2.88dsf-13.11 scripts for initializing and shutt ii libaudit0 1.7.13-1.2 Dynamic library for security audit ii libc6 2.13-10 Embedded GNU C Library: Shared lib ii libcap2 1:2.21-2 support for getting/setting POSIX. ii libcryptsetup1 2:1.3.0-3 libcryptsetup shared library ii libdbus-1-3 1.4.12-5 simple interprocess messaging syst ii libpam0g 1.1.3-2 Pluggable Authentication Modules l ii libselinux1 2.0.98-1.1 SELinux runtime shared libraries ii libudev0 172-1 libudev shared library ii libwrap0 7.6.q-21 Wietse Venema's TCP wrappers libra ii udev 172-1 /dev/ and hotplug management daemo ii util-linux 2.19.1-4 Miscellaneous system utilities Versions of packages systemd recommends: pn libpam-systemd <none> (no description available) Versions of packages systemd suggests: ii python 2.6.7-1 interactive high-level object-orie pn systemd-gui <none> (no description available) -- no debconf information -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

