Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 625518 - net-fs/autofs-5.1.3 - missing /usr/lib/systemd/system/autofs.service
Summary: net-fs/autofs-5.1.3 - missing /usr/lib/systemd/system/autofs.service
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 625954
  Show dependency tree
 
Reported: 2017-07-18 14:09 UTC by Juergen Rose
Modified: 2017-07-22 17:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2017-07-18 14:09:32 UTC
After installation of autofs-5.1.3 autofs does not work anymore. I have a broken link /etc/systemd/system/multiuser-usr.target.wants/autofs to /usr/lib/systemd/system/autofs.service.

With autofs-5.1.2 this file is installed with autofs:

root@cheetahnew:/usr/src/linux(71)# qfile -v /usr/lib/systemd/system/autofs.service 
net-fs/autofs-5.1.2 (/usr/lib/systemd/system/autofs.service)
root@cheetahnew:/usr/src/linux(72)# qlist autofs | grep service
/usr/lib/systemd/system/autofs.service
root@cheetahnew:/usr/src/linux(73)# qlist -Iv systemd
sys-apps/gentoo-systemd-integration-7
sys-apps/systemd-233-r4


With autofs-5.1.3 and systemd-234-r1  /lib/systemd/system/autofs.service is installed and some links under etc/systemd/system/multiuser-usr.target.wants are broken.

(BTW. /usr/lib/systemd/system/systemd-networkd.service is missing too.)
Comment 1 Mike Gilbert gentoo-dev 2017-07-18 14:19:56 UTC
Please define "does not work". What do you expect to happen, and what actually happens?

Unit files are moved to /lib/systemd/system as a result of rebuilds after upgrading to systemd-234. The broken symlinks should not be a problem; systemd actually ignores the symlink target for links in foo.target.wants/.
Comment 2 Juergen Rose 2017-07-18 14:51:03 UTC
(In reply to Mike Gilbert from comment #1)
> Please define "does not work". What do you expect to happen, and what
> actually happens?
> 
> Unit files are moved to /lib/systemd/system as a result of rebuilds after
> upgrading to systemd-234. The broken symlinks should not be a problem;
> systemd actually ignores the symlink target for links in foo.target.wants/.

I wanted to switch the network without rebooting. I.e. I switched several configuration files or directories /etc/host, /etc/systemd/network, /etc/pine.conf, /etc/samba/smb.conf, /etc/ntp.conf, ... . Then I tried to run my network switch script, which restarts several services like systemd-resoolved, systemd-networkd, wpa_supplicant@wlan0, rpcbind, nfs-idmapd, nfs-mountd, rpc-gssd, smbd, nfs-server, ntp, cups, sshd, ... 

This script fails now, I do not have any network connection. Furthermore the reboot/shutdown button of gnome disappeared. Then I tried to isolate the errors. The first thing a found, were the broken links under /etc/systemd/system/multiuser-usr.target.wants. 
I will remove the broken links, reboot and continue to investigate.
Comment 3 Mike Gilbert gentoo-dev 2017-07-18 14:58:45 UTC
Removing the broken symlinks should be unnecessary, and will likely not resolve any problems.

Rebooting sounds like a good idea.
Comment 4 Richard Freeman gentoo-dev 2017-07-18 15:05:57 UTC
(In reply to Mike Gilbert from comment #3)
> Removing the broken symlinks should be unnecessary, and will likely not
> resolve any problems.
> 
> Rebooting sounds like a good idea.

Seems likely.  After upgrading the units would have all moved, but the systemd that is running is probably looking in the old location for them, since it wasn't built otherwise.
Comment 5 Juergen Rose 2017-07-18 15:08:02 UTC
'systemctl reboot' fails as well:

root@lynx:/root(18)# systemctl reboot
Failed to set wall message, ignoring: Unit dbus-org.freedesktop.login1.service not found.
Failed to reboot system via logind: Unit dbus-org.freedesktop.login1.service not found.
Failed to start reboot.target: Unit reboot.target not found.


'shutdown -h now' fails with:

The system is going down for system halt NOW!
shudown: timeout opening/writing control channel /dev/initctl
init: timeout opening/writing control channel /dev/initctl
Comment 6 Juergen Rose 2017-07-18 15:20:50 UTC
After hard reset booting fails with:

>> Initializing root device...
>> Detecting root:  /dev/sdb6
>> Mounting /dev/sdb6 as root...
>> Detected fstype: ext4
>> Using mount fstype: ext4
>> Using mount opts: -o ro
EXT4-fs (sdb6): INFO: recovery required on readonly filesystem
EXT4-fs (sdb6): write access will be enabled during recovery
EXT4-fs (sdb6): orphan cleanup on reaonly fs
EXT4-fs (sdb6): 197 orphan inodes deleted
EXT4-fs (sdb6): recovery complete
EXT4-fs (sdb6): mounted filesystem with ordered data mode. Opts: (null)
!! The filesystem /dev/sdb6, mounted at /newroot does not contain a valid init=/usr/lib/systemd/systemd
!! Could not find the root block device in /dev/sdb6
...

If I enter 'shell', I see two files under /lib/systemd/
libsystemd-shared-234.so
and
systemd-udev.

Should I replace the real_init=/usr/lib/systemd/systemd by /lib/systemd/systemd-udev in /boot/grub/grub.cfg?
Comment 7 Mike Gilbert gentoo-dev 2017-07-18 15:21:21 UTC
Try "systemctl daemon-reexec" instead. That will load the new version into memory, along with the updated paths.

I think you tried to do too much with systemd without having restarted it.
Comment 8 Juergen Rose 2017-07-18 15:21:31 UTC
After hard reset booting fails with:

>> Initializing root device...
>> Detecting root:  /dev/sdb6
>> Mounting /dev/sdb6 as root...
>> Detected fstype: ext4
>> Using mount fstype: ext4
>> Using mount opts: -o ro
EXT4-fs (sdb6): INFO: recovery required on readonly filesystem
EXT4-fs (sdb6): write access will be enabled during recovery
EXT4-fs (sdb6): orphan cleanup on reaonly fs
EXT4-fs (sdb6): 197 orphan inodes deleted
EXT4-fs (sdb6): recovery complete
EXT4-fs (sdb6): mounted filesystem with ordered data mode. Opts: (null)
!! The filesystem /dev/sdb6, mounted at /newroot does not contain a valid init=/usr/lib/systemd/systemd
!! Could not find the root block device in /dev/sdb6
...

If I enter 'shell', I see two files under /lib/systemd/
libsystemd-shared-234.so
and
systemd-udev.

Should I replace the real_init=/usr/lib/systemd/systemd by /lib/systemd/systemd-udev in /boot/grub/grub.cfg?
Comment 9 Mike Gilbert gentoo-dev 2017-07-18 15:25:05 UTC
(In reply to Juergen Rose from comment #6)
> Should I replace the real_init=/usr/lib/systemd/systemd by
> /lib/systemd/systemd-udev in /boot/grub/grub.cfg?

Looks similar to bug 625462, only with genkernel instead of dracut. Updating the boot config to init=/lib/systemd/systemd should resolve the issue.

I will revbump systemd soon with relative symlinks since those tend to work better for path checking.
Comment 10 Juergen Rose 2017-07-18 15:25:18 UTC
Booting with real_init=/lib/systemd/systemd-udev fails as well.
Comment 11 Mike Gilbert gentoo-dev 2017-07-18 15:30:27 UTC
(In reply to Juergen Rose from comment #10)
> Booting with real_init=/lib/systemd/systemd-udev fails as well.

Of course; udev is not an init system. Get rid of the "-udev".
Comment 12 Juergen Rose 2017-07-18 15:41:47 UTC
(In reply to Mike Gilbert from comment #9)
> (In reply to Juergen Rose from comment #6)
> > Should I replace the real_init=/usr/lib/systemd/systemd by
> > /lib/systemd/systemd-udev in /boot/grub/grub.cfg?
> 
> Looks similar to bug 625462, only with genkernel instead of dracut. Updating
> the boot config to init=/lib/systemd/systemd should resolve the issue.
> 
> I will revbump systemd soon with relative symlinks since those tend to work
> better for path checking.

Booting with init=/lib/systemd/systemd worked. After booting and cleaning /etc/systemd/system/multiuser-usr.target.wants/ (systemctl disable systemd-networkd;  systemctl enable systemd-networkd;  systemctl disable autofs;  systemctl eable autofs;  ...) I see that there is now again a /usr/lib/systemd/systemd which is a link to lib/systemd/systemd.

Do I have to modify 
GRUB_CMDLINE_LINUX_DEFAULT="dolvm domdadm real_init=/usr/lib/systemd/systemd rootfstype=ext4"
in /etc/default/grub to

GRUB_CMDLINE_LINUX_DEFAULT="dolvm domdadm real_init=/lib/systemd/systemd rootfstype=ext4"

and recreate /boot/grub/grub.cfg or is this not necessary?
Comment 13 Mike Gilbert gentoo-dev 2017-07-18 15:44:12 UTC
(In reply to Juergen Rose from comment #12)
> Do I have to modify 
> GRUB_CMDLINE_LINUX_DEFAULT="dolvm domdadm real_init=/usr/lib/systemd/systemd
> rootfstype=ext4"
> in /etc/default/grub to
> 
> GRUB_CMDLINE_LINUX_DEFAULT="dolvm domdadm real_init=/lib/systemd/systemd
> rootfstype=ext4"
> 
> and recreate /boot/grub/grub.cfg or is this not necessary?

Yes, I would suggest making the change you have proposed above.
Comment 14 Juergen Rose 2017-07-18 15:45:41 UTC
(In reply to Juergen Rose from comment #12)
...
> autofs;  systemctl eable autofs;  ...) I see that there is now again a
> /usr/lib/systemd/systemd which is a link to lib/systemd/systemd.
> 
> Do I have to modify 
> GRUB_CMDLINE_LINUX_DEFAULT="dolvm domdadm real_init=/usr/lib/systemd/systemd
> rootfstype=ext4"
> in /etc/default/grub to
> 
> GRUB_CMDLINE_LINUX_DEFAULT="dolvm domdadm real_init=/lib/systemd/systemd
> rootfstype=ext4"
> 
> and recreate /boot/grub/grub.cfg or is this not necessary?

Booting with an unmodified /etc/default/grub failed with the same error as before.
Comment 15 Juergen Rose 2017-07-18 16:01:27 UTC
Booting with the modified /etc/default/grub works.
Comment 16 Mike Gilbert gentoo-dev 2017-07-18 18:57:15 UTC
I don't think there's any bug in autofs here, so I'm closing this.