Description of problem: $tmpfilesdir variable is empty in dracut script if systemd-devel package is not installed because of 2 incorrect tests in /usr/bin/dracut +1282 and +1283 It should be a [[ -d "/path" ]] and not [[ -f "/path" ]] which fail for obvious reasons. Result is dracut-tmpfiles.conf is incorrectly place in / of the initramfs instead of wanted : /lib/tmpfiles.d /usr/lib/tmpfiles.d (and likely /etc/tmpfiles.d if systemd-devel is installed) Code of the install procedure is placed at last line in /usr/lib/dracut/modules.d/98dracut-systemd/module-setup.sh I am in the case where I need to add some content in this configuration file which shoudn't be placed there. Version-Release number of selected component (if applicable): dracut-044-3.mga6 How reproducible: Alway Steps to Reproduce: 1. KVER=`ls -d /lib/modules/4.* | sort | tail -n 1 | perl -pne 's%^/lib/modules/%%;s%/$%%'` 2. mkinitrd -v -f /boot/initrd-$KVER.img $KVER 3. Ctrl+z before it finish and look in /var/tmp/dracut.XXXXXX/initramfs/ dir (or place a debug read in /usr/bin/dracut or extract archive)
URL: (none) => https://bugzilla.redhat.com/show_bug.cgi?id=1343230
Posted upstream ? https://bugzilla.redhat.com/show_bug.cgi?id=1343230
Same problem with $tmpfilesdir/systemd.conf in /usr/lib/dracut/modules.d/00systemd/module-setup.sh whitch will never be installed. It's assumed in this case that tmpfilesdir should be set to /usr/lib/tmpfiles.d by default.
This seems to be a bug in the fallback code in 3a04bddeed15c810865aa49a2575bf13e651272d which sets the defaults. Fixed in svn/cauldron and patch sent upstream.
Status: NEW => RESOLVEDCC: (none) => mageiaResolution: (none) => FIXED
There is a trailing bug in this module too : /usr/lib/dracut/modules.d/00systemd/module-setup.sh It miss a directive : egrep '^utmp:' /etc/group >> "$initdir/etc/group" After line 186 for /usr/lib/tmpfiles.d/systemd.conf line 11 witch fail here for me. Can u plz add it too ?
Status: RESOLVED => REOPENEDResolution: FIXED => (none)
(In reply to Raphael Gertz from comment #4) > Can u plz add it too ? Sure, but can you say what the utmp group is needed for so I can write a commit message properly?
As well as the root group : egrep '^root:' /etc/group >> "$initdir/etc/group"
(In reply to Raphael Gertz from comment #6) > As well as the root group : > egrep '^root:' /etc/group >> "$initdir/etc/group" Sure, but again, can you say what those groups are needed for, i.e. what component they log errors for etc. Just so I can put it in the commit message and it'll be allowed in (I know I'll be asked this question!).
To summary if possible add : egrep '^utmp:' /etc/group >> "$initdir/etc/group" egrep '^root:' /etc/group >> "$initdir/etc/group" In /usr/lib/dracut/modules.d/00systemd/module-setup.sh +186 Those two groups are present in /usr/lib/tmpfiles.d/systemd.conf. The root group is also required by /usr/lib/tmpfiles.d/dracut-tmpfiles.conf for debug log in case of failed dracut boot. In my case I have some service early service depending on systemd-tmpfiles-setup.service whose are failing with this error : systemd-tmpfiles[594]: [/usr/lib/tmpfiles.d/systemd.conf:11] Unknown group 'utmp'. Not sure if it's a bug related to mageia specific configuration of /usr/lib/tmpfiles.d/systemd.conf which was silently failing or my configuration which depend on this service early. This service can only started through deps so it's really anoying to understand why it is failing for 2 missing groups. A better fix would be to parse all the group and user of $tmpfilesdir files and add them in passwd and group, but I have no idea how to simply write that yet. Is that enough explanation ? I have no idea how to explain better...
The command generating the error is : /usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
(In reply to Raphael Gertz from comment #8) > A better fix would be to parse all the group and user of $tmpfilesdir files > and add them in passwd and group, but I have no idea how to simply write > that yet. Cool, this should be possible. There is code in dracut-init.sh to parse users/groups from udev rules, so it should be easy enough to extend to also parse tmpfiles snippets. I'll see if I can squeeze that in today, but otherwise I'll just put those two groups in directly. > Is that enough explanation ? I have no idea how to explain better... Yes, perfect, thank you :)
With in journal -ab (just in case) : systemd[1]: systemd-tmpfiles-setup.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: Failed to start Create Volatile File and Directories. systemd[1]: systemd-tmpfiles-setup.service: Unit entered failed state. systemd[1]: systemd-tmpfiles-setup.service: Failed with result 'exit-code'.
If you want to use that code it's likely you will need to extract the user+group in two modules. For /usr/lib/tmpfiles.d/systemd.conf in /usr/lib/dracut/modules.d/00systemd/module-setup.sh+186 For /usr/lib/tmpfiles.d/dracut-tmpfiles.conf in /usr/lib/dracut/modules.d/98dracut-systemd/module-setup.sh+61
OK, I've added the patch now (just the simple one and will leave it up to upstream to do a better, more generic one should they see fit). There is a discussion just now about whether or not to drop a require from dracut so I won't bother pushing to cauldron for now as I suspect tmb may do so in due course. Fixing for now but if it doesn't appear or you notice more users/groups missing just reopen.
Status: REOPENED => RESOLVEDResolution: (none) => FIXED