Bug 64014 - systemd-nspawn only checks for etc/os-release
Summary: systemd-nspawn only checks for etc/os-release
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium major
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-28 09:38 UTC by János Illés
Modified: 2013-05-06 19:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description János Illés 2013-04-28 09:38:44 UTC
After the latest systemd upgrade, systemd-nspawn refused to run my
debootstrapped Debian Squeeze directory because it “doesn't look like an OS
root directory”.

It turned out that the OS detection logic changed from checking for the
DIR/bin/sh file to check the existence of DIR/etc/os-release file, so the
solution was easy enough, I had to create that file. 

However, I don't think /etc/os-release is widespread enough to use it
exclusively, maybe systemd-nspawn could fallback to check /bin/sh if os-release
doesn't exists. 

Or, if you stick to this decision, please put it in the man page or add a more
verbose error message, because I had to use strace to find out which file was
missing.
Comment 1 Michael Mercier 2013-05-03 16:24:29 UTC
I have exactly the same issue. I think it is not a minor bug because if you don't known the workaround, it does not work at all for Debian (which is really common).
Comment 2 Lennart Poettering 2013-05-06 19:07:44 UTC
Actually, /etc/os-release is pretty universal these days, even Debian 7 and Ubuntu have it both. The older the distros get the more you have to modify them anyway before they run cleanly in a container, hence requiring the user to create this file on these older OSes doesn't sound like too much.

I have now changed git to document this behaviour in both the man page and the error message you get:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=f8964235e69f58225dec378437b1789744cd22a9


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.