Commit bf7d3153 by Michael H. Warfield Committed by Serge Hallyn

lxc-fedrora: New patch for systemd detection and init configuration.

Satoshi Matsumoto certainly had the right idea and in spotting a bug in the lxc-fedora template for systemd detection. Heart was in the right spot but patch was not what we needed. I've looked the patch code over for systemd support and init/upstart support and modified the logic appropriately. If /etc/systemd/system exists, we'll do the right thing by systemd. If /etc/rc.sysinit exists, we'll do the right thing by init / upstart. If both are installed, we'll trying and accommodate both in case someone is playing games with the two (I've done this). Patch was trivial, just took more time to actually test it and create some containers with it and verify them, than it did to code them. Signed-off-by: 's avatarMichael H. Warfield <mhw@WittsEnd.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 3d5e9f48
...@@ -567,13 +567,20 @@ if [ $? -ne 0 ]; then ...@@ -567,13 +567,20 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
type /bin/systemd >/dev/null 2>&1 # If the systemd configuration directory exists - set it up for what we need.
if [ $? -ne 0 ]; then if [ -d ${rootfs_path}/etc/systemd/system ]
configure_fedora_init then
else
configure_fedora_systemd configure_fedora_systemd
fi fi
# This configuration (rc.sysinit) is not inconsistent with the systemd stuff
# above and may actually coexist on some upgraded systems. Let's just make
# sure that, if it exists, we update this file, even if it's not used...
if [ -f ${rootfs_path}/etc/rc.sysinit ]
then
configure_fedora_init
fi
if [ ! -z $clean ]; then if [ ! -z $clean ]; then
clean || exit 1 clean || exit 1
exit 0 exit 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment