templates: CentOS fixes

Issues fixed: - lxc-centos died about a missing /run directory - lxc-centos complained about some config files it couldn't modify - the new container got stuck at startup time for a minute (literally), waiting for systemd-remount-fs startup script Of course it still works for RHEL 6, CentOS 6 and 7 as well. I did not verify earlier CentOS or RHEL releases. Signed-off-by: 's avatarHarald Dunkel <harald.dunkel@aixigo.de> Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 08fbe494
...@@ -351,7 +351,7 @@ EOF ...@@ -351,7 +351,7 @@ EOF
# prevent mingetty from calling vhangup(2) since it fails with userns. # prevent mingetty from calling vhangup(2) since it fails with userns.
# Same issue as oracle template: prevent mingetty from calling vhangup(2) # Same issue as oracle template: prevent mingetty from calling vhangup(2)
# commit 2e83f7201c5d402478b9849f0a85c62d5b9f1589. # commit 2e83f7201c5d402478b9849f0a85c62d5b9f1589.
sed -i 's|mingetty|mingetty --nohangup|' $rootfs_path/etc/init/tty.conf test -f $rootfs_path/etc/init/tty.conf && sed -i 's|mingetty|mingetty --nohangup|' $rootfs_path/etc/init/tty.conf
if [ ${root_display_password} = "yes" ] if [ ${root_display_password} = "yes" ]
then then
...@@ -381,13 +381,18 @@ EOF ...@@ -381,13 +381,18 @@ EOF
configure_centos_init() configure_centos_init()
{ {
sed -i 's|.sbin.start_udev||' ${rootfs_path}/etc/rc.sysinit test -f ${rootfs_path}/etc/rc.sysinit && sed -i 's|.sbin.start_udev||' ${rootfs_path}/etc/rc.sysinit
sed -i 's|.sbin.start_udev||' ${rootfs_path}/etc/rc.d/rc.sysinit test -f ${rootfs_path}/etc/rc.d/rc.sysinit && sed -i 's|.sbin.start_udev||' ${rootfs_path}/etc/rc.d/rc.sysinit
if [ "$release" = "6" ]; then if [ "$release" = "6" ]; then
chroot ${rootfs_path} chkconfig udev-post off chroot ${rootfs_path} chkconfig udev-post off
fi fi
chroot ${rootfs_path} chkconfig network on chroot ${rootfs_path} chkconfig network on
if [ "$release" = "7" ]; then
# don't wait for the timeout
chroot ${rootfs_path} chkconfig systemd-remount-fs off
fi
if [ -d ${rootfs_path}/etc/init ] if [ -d ${rootfs_path}/etc/init ]
then then
# This is to make upstart honor SIGPWR # This is to make upstart honor SIGPWR
...@@ -462,6 +467,9 @@ EOF ...@@ -462,6 +467,9 @@ EOF
force_mknod 666 $INSTALL_ROOT/dev/null c 1 3 force_mknod 666 $INSTALL_ROOT/dev/null c 1 3
force_mknod 666 $INSTALL_ROOT/dev/urandom c 1 9 force_mknod 666 $INSTALL_ROOT/dev/urandom c 1 9
# create /run directory, just in case it is missing (e.g. RHEL7)
mkdir -p $INSTALL_ROOT/run
$YUM install $PKG_LIST $YUM install $PKG_LIST
# create symlink for /var/run -> ../run # create symlink for /var/run -> ../run
......
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