From 67d008d2f55ba2ec0b36b4493e27c94c8ab37149 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 13 Feb 2013 09:25:16 +0100 Subject: [PATCH] first stab at a systemd-compliant nodeimage post script - should turn on openvswitch --- config.lxc/nodeimage.post | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 config.lxc/nodeimage.post diff --git a/config.lxc/nodeimage.post b/config.lxc/nodeimage.post new file mode 100644 index 00000000..3231bc5c --- /dev/null +++ b/config.lxc/nodeimage.post @@ -0,0 +1,45 @@ +#!/bin/bash + +vdir=$1 +if [ -z "${vdir}" ] ; then + echo "ERROR: $0" + echo "Provide the directory of the root filesystem to operate on" + exit +fi + +# Cleanup yum config entirely, waiting for the config files to populate this +rm -rf ${vdir}/etc/yum.conf ${vdir}/etc/yum.repos.d + +# Tweaking services +# turn ON openvswitch as it is required for the privatebridge nm plugin +chroot ${vdir} systemctl enable openvswitch.service || : +# enabling network as it ends up turned off on systems that come with NetworkManager, starting with fedora9 +chroot ${vdir} systemctl enable network.service || : +# and turn off NetworkManager if present, as it quite obviously messes with network +chroot ${vdir} systemctl disable NetworkManager || : + +# Disable splaying of cron. +echo > ${vdir}/etc/sysconfig/crontab + +# Add site_admin account +chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin + +# Add a logrotate script for btmp, which logs failed ssh logins, which can +# grow unbounded on public plnodes and fill the root fs. +cat < ${vdir}/etc/logrotate.d/btmp +/var/log/btmp { + weekly + minsize 1M + create 0600 root utmp + rotate 2 + compress + notifempty +} +EOF + +#################### historical notes - see config.planetlab/nodeimage.post +# xxx turning OFF selinux +# there used to be some code for that in the historical/vserver version +# none of that code seems applicable in f16 anylonger + +# also a horrible hack to the network initscripts has been removed -- 2.47.0