[systemd-devel] No maintenance shell on local fs failure (/bin/sh: no such file or directory)

Frank Steiner fsteiner-mail1 at bio.ifi.lmu.de
Fri Jan 15 02:40:29 PST 2016


In case someone else steps in this;

Frank Steiner wrote

> Hi,
> 
> on one of my serves I have a LVM that, due to an error in my lvm.conf,
> couldn't be mounted on boot. But I didn't get a  maintenance shell as
> I usually got on other servers, the output just stopped after complaining
> with
> [ TIME ] Timed out waiting for device dev-mapper-exportraidcu...tcurry2.device.
> [DEPEND] Dependency failed for /export.
> [DEPEND] Dependency failed for Local File Systems.
> ...
> 
> So I debugged this and could grep the output from a serial console.
> It seem that the rootfs vanishes at some point, because I see such
> messages:
> 
> About to execute: /bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\nto boot into default mode.'
> Forked /bin/echo as 4290
> Failed at step CHDIR spawning /bin/echo: No such file or directory
> ...

This didn't mean that /bin/echo was not found, but the CHDIR failed!
That was caused by /root being a symbolic link to /local/home/root
(we strictly separate any user data including root from the system, so
that we can reformat / on reinstalling or upgrading the system).
But /usr/lib/systemd/system/emergency.service contains:

[Service]
Environment=HOME=/root
WorkingDirectory=/root
...

and because /root was a link pointing to nowhere (/local is not mounted
when starting the emergency service, only /) the chdir failed.

I solved this buy changing the lines to
Environment=HOME=/
WorkingDirectory=/

Although we could change /root to being an empty dir and using a bind mount,
the links are safer at the moment due to several problems with bind mounts,
including IBMs Tivoli not being able to handle them correctly.

I don't think that having /root should be a mandatory requirement
for starting an emergency shell, so maybe the service file should 
indeed be changed in the official release?

cu,
Frank


-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *


More information about the systemd-devel mailing list