I have encrypted swap partition configured in /etc/crypttab: > swap /dev/sda2 /dev/urandom swap,cipher=aes,hash=sha256,size=256 Based on this systemd generates two units: - systemd-cryptsetup@swap.service (calls cryptsetup and mkswap) - dev-mapper-swap.device (requires systemd-cryptsetup@swap.service). Starting systemd-cryptsetup@swap.service succeeds, but > systemctl start dev-mapper-swap.device hangs indefinitely. In the journal I see that systemd-cryptsetup@swap.service successfully executes all commands and is marked started. But dev-mapper-swap.device does not start and there is no clue what blocks it. Another non-swap encrypted partition can be started without any hangs or delays. I'm ready to provide any additional info to help investigating this issue.
systemd version is 208-r2. Recently migrated from OpenRC in order to use GNOME 3.8. emerge --info: Portage 2.2.7 (default/linux/amd64/13.0/desktop/gnome/systemd, gcc-4.7.3, glibc-2.16.0, 3.10.17-gentoo x86_64) ================================================================= System uname: Linux-3.10.17-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8600_@_2.40GHz-with-gentoo-2.2 KiB Mem: 4113644 total, 1199484 free KiB Swap: 0 total, 0 free Timestamp of tree: Mon, 09 Dec 2013 18:30:01 +0000 ld GNU ld (GNU Binutils) 2.23.1 app-shells/bash: 4.2_p45 dev-java/java-config: 2.1.12-r1 dev-lang/python: 2.7.5-r3, 3.3.2-r2 dev-util/cmake: 2.8.11.2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.11.6, 1.13.4 sys-devel/binutils: 2.23.1 sys-devel/gcc: 4.7.3-r1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.9 (virtual/os-headers) sys-libs/glibc: 2.16.0 Repositories: gentoo sunrise sublime-text portage-local Installed sets: @system ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/sunrise /var/lib/layman/sublime-text /usr/local/portage" USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cdr cli colord cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode evo exif fam firefox flac gdbm gif gnome gnome-keyring gnome-online-accounts gstreamer gtk iconv introspection jpeg lcms libnotify libsecret mad mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses nls nptl opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt3support readline sdl session socialweb spell sse sse2 sse3 ssl ssse3 startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vdpau wxwidgets x264 xcb xinerama xml xulrunner xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="canon ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en ru ru_RU" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_3" PYTHON_TARGETS="python3_3 python2_7" RUBY_TARGETS="ruby20" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Please post "emerge --info" and "equery b dev-mapper-swap.device" outputs
Output of "emerge --info" is already posted. > equery b dev-mapper-swap.device finds nothing. > find / -name 'dev-mapper-swap.device*' yields two directories: /run/systemd/generator/dev-mapper-swap.device.d /run/systemd/generator/dev-mapper-swap.device.requires First one has one file 50-job-timeout-sec-0.conf with content: # Automatically generated by systemd-cryptsetup-generator [Unit] JobTimeoutSec=0 Second one contains symlink to systemd-cryptsetup@swap.service.
This looks related: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=731796 Boot still hangs for me after making the suggested change to /lib/udev/rules.d/10-dm.rules, though.
Maybe reporting to systemd upstream could help us: https://bugs.freedesktop.org/enter_bug.cgi?product=systemd
According to the Debian bug report, upstream ships the necessary rule. (The file is provided by lvm2, not systemd.)
Adding > OPTIONS+="watch" to /lib/udev/rules.d/10-dm.rules does not fix the hang for me either. So probably the problem is somewhere else. I'll report it upstream.
I guess you tried also lvm2-2.02.104
Just created https://bugs.freedesktop.org/show_bug.cgi?id=72957 sys-fs/lvm2-2.02.103
Rebuilding the kernel with CONFIG_UEVENT_HELPER_PATH="" fixed the problem for me. More information at https://bugzilla.redhat.com/show_bug.cgi?id=759402. In short: * CONFIG_UEVENT_HELPER_PATH defaults to "/sbin/hotplug", even though udev superseded hotplug in 2006. * kobject_uevent_env returns an error if /proc/sys/kernel/hotplug (set from CONFIG_UEVENT_HELPER_PATH) contains an invalid path. * libdevmapper sees the error and falls back to creating the device node itself, unless the application passes DM_UDEV_DISABLE_LIBRARY_FALLBACK to dm_task_set_cookie. udev gets confused. * This was reported as http://code.google.com/p/cryptsetup/issues/detail?id=170, but closed WontFix. Could this be added to the kernel config checks in the systemd ebuild?
Setting CONFIG_UEVENT_HELPER_PATH="" fixes the hang for me too. Thanks, Thomas!
@kernel-misc: how can we check for CONFIG_UEVENT_HELPER_PATH="" with linux-info.eclass? (I know how to check for options enabled/disabled, but this is about the value of the variable being empty) Thanks!
I've noticed that sys-fs/lvm2 ebuild already has such check for UEVENT_HELPER_PATH emptiness. It can be copied to systemd ebuild.
If lvm2 already has a check for it, why would we duplicate this in the systemd ebuild?
(In reply to Mike Gilbert from comment #14) > If lvm2 already has a check for it, why would we duplicate this in the > systemd ebuild? Per systemd readme we should add a check anyway as looks like it can cause other problems unrelated with lvm2: /usr/share/doc/systemd-208-r2/README.bz2 Legacy hotplug slows down the system and confuses udev: CONFIG_UEVENT_HELPER_PATH="" OK with adding the check then?
Ah, I thought it was just an LVM2 problem. Yeah, that's fine then.
+ 28 Dec 2013; Pacho Ramos <pacho@gentoo.org> -systemd-204-r2.ebuild, + -systemd-204-r3.ebuild, -systemd-207-r2.ebuild, -systemd-208-r1.ebuild, + systemd-208-r2.ebuild, systemd-9999.ebuild: + Update config checks also solving bug #493874 by Alexey Vladykin, drop old. + I saw a few more options were missed, the only ones that I left were: For systemd-bootchart a kernel with procfs support and several proc output options enabled is required: CONFIG_PROC_FS CONFIG_SCHEDSTATS CONFIG_SCHED_DEBUG As wasn't sure about that debugging stuff for that functionality that I am unsure many people will use :/
The problem was not solved for me just by clearing CONFIG_UEVENT_HELPER_PATH kernel option, because something is setting the value of /proc/sys/kernel/hotplug to "/sbin/mdev": # cat /proc/sys/kernel/hotplug /sbin/mdev # gunzip -c /proc/config.gz | grep CONFIG_UEVENT_HELPER_PATH CONFIG_UEVENT_HELPER_PATH="" Setting CONFIG_UEVENT_HELPER_PATH in kernel to /usr/bin/udevadm does not change the value of /proc/sys/kernel/hotplug, I need to create a symlink to work around this problem: cd /sbin && ln -s /usr/bin/udevadm mdev Anyone knows what is causing this strange behavior? ========================= Portage 2.2.7 (default/linux/amd64/13.0/desktop/kde/systemd, gcc-4.7.3, glibc-2.17, 3.12.6-gentoo x86_64) ================================================================= System uname: Linux-3.12.6-gentoo-x86_64-Intel-R-_Core-TM-_i7-2720QM_CPU_@_2.20GHz-with-gentoo-2.2 KiB Mem: 8060740 total, 6299700 free KiB Swap: 8388604 total, 8388604 free Timestamp of tree: Mon, 06 Jan 2014 19:45:01 +0000 ld GNU ld (GNU Binutils) 2.23.2 app-shells/bash: 4.2_p45 dev-lang/python: 2.7.5-r3, 3.3.2-r2 dev-util/cmake: 2.8.11.2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.11.6, 1.12.6, 1.13.4 sys-devel/binutils: 2.23.2 sys-devel/gcc: 4.7.3-r1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.9 (virtual/os-headers) sys-libs/glibc: 2.17 Repositories: gentoo x-portage ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE freedist as-is CC-Sampling-Plus-1.0" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=corei7-avx -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=corei7-avx -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/" LANG="de_DE.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j9" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/hdd/tmp/" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 avx berkdb bluetooth branding bzip2 cairo cdda cdr cli cracklib crypt cryptsetup cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk iconv idn ipv6 jpeg kde kipi lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt3support qt4 readline sdl semantic-desktop session spell sse sse2 sse4_1 ssl ssse3 startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="intel nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
(In reply to Fabian Köster from comment #18) It looks like both genkernel and genkernel-next set /proc/sys/kernel/hotplug in their initramfs startup code. Are you using either of those? I see that the /etc/init.d/udev init script does this: echo "" >/proc/sys/kernel/hotplug Perhaps we should do something similar in systemd to clean up after the initramfs?
(In reply to Mike Gilbert from comment #19) > > It looks like both genkernel and genkernel-next set /proc/sys/kernel/hotplug > in their initramfs startup code. Are you using either of those? Yes, I use genkernel-next. Thanks for the hint! > I see that the /etc/init.d/udev init script does this: > > echo "" >/proc/sys/kernel/hotplug > > Perhaps we should do something similar in systemd to clean up after the > initramfs? To me this sounds the right thing to do. Should I file a separate bug on this issue?
No, we can handle it here I think, anyway, will CC genkernel-next people to ensure if we really need to have mdev there (if I don't misremember there were plans on switching to "udev" in genkernel-next...) Also, can you try if you have the same problem with latest genkernel-next version from testing?
*** Bug 496970 has been marked as a duplicate of this bug. ***
Some references: genkernel setting mdev as the hotplug handler: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=blob;f=defaults/linuxrc;h=d6d0eaab1dedc6ca1f17462244a30462e36dff6e;hb=HEAD#l329 genkernel-next setting udev as the hotplug handler https://github.com/Sabayon/genkernel-next/blob/8ae92b7601003e7ee6ad35e954df797363d8b66c/defaults/initrd.d/00-devmgr.sh#L20 genkernel-next setting mdev as the hotplug handler https://github.com/Sabayon/genkernel-next/blob/8ae92b7601003e7ee6ad35e954df797363d8b66c/defaults/initrd.d/00-devmgr.sh#L29 I looked at dracut as well, but it does not appear to set the hotplug handler. Instead, it starts systemd-udevd as a daemon.
Hi all, I have a similar problem and my report has been reported as diplicate of this bug. ( #496970 ) However my situation is different in one point: hotplug is not set but swap partition is not activated: cova@calvin ~ $ cat /proc/sys/kernel/hotplug cova@calvin ~ $ at the same time, boot process does not hangs but simply I got no swap enabled at the end. Maybe the problem is similar, but I'm not sure if the problem is exactly the same. No problem in performing other tests if needed. Thanks
I can drop the bits pointed out by Mike in #c23 from genkernel-next. I wonder why they're there in the first place, since mdev is clearly not the hotplug handler after the pivot_root in the 99% of the cases.
Just noticed, it is also necessary to have USE=udev on cryptsetup. Otherwise systemd also hangs when encrypted swap is listed in /etc/fstab.
What is the status of this with latest versions of systemd, genkernel-next, lvm2...
I'm not sure if what I'm encountering is the same as this bug or not, but if not it's very similar. I can't get systemd to work with *any* encrypted devices. The volumes do get decrypted successfully, but the associated systemd .device jobs never finish. The bootup process hangs forever on "A start job is running for...*.device"
This should be ok finally with recent genkernel-next and systemd versions