turn on login console
[build.git] / config.lxc / nodeimage.post
1 #!/bin/bash
2
3 vdir=$1
4 if [ -z "${vdir}" ] ; then
5         echo "ERROR: $0"
6         echo "Provide the directory of the root filesystem to operate on"
7         exit
8 fi
9
10 # Cleanup yum config entirely, waiting for the config files to populate this
11 rm -rf ${vdir}/etc/yum.conf ${vdir}/etc/yum.repos.d
12
13 # Tweaking services
14 # turn ON openvswitch as it is required for the privatebridge nm plugin
15 chroot ${vdir} systemctl enable openvswitch.service || :
16 # enabling network as it ends up turned off on systems that come with NetworkManager, starting with fedora9
17 chroot ${vdir} systemctl enable network.service || :
18 # and turn off NetworkManager if present, as it quite obviously messes with network
19 chroot ${vdir} systemctl disable NetworkManager.service || :
20 # tentatively turn on getty on tty1
21 chroot ${vdir} systemctl enable getty@tty1.service || :
22
23 # Disable splaying of cron.
24 echo > ${vdir}/etc/sysconfig/crontab
25
26 # Add site_admin account
27 chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
28
29 # Add a logrotate script for btmp, which logs failed ssh logins, which can
30 # grow unbounded on public plnodes and fill the root fs.
31 cat <<EOF > ${vdir}/etc/logrotate.d/btmp
32 /var/log/btmp {
33     weekly
34     minsize 1M
35     create 0600 root utmp
36     rotate 2
37     compress
38     notifempty
39 }
40 EOF
41
42 #################### historical notes - see config.planetlab/nodeimage.post
43 # xxx turning OFF selinux
44 # there used to be some code for that in the historical/vserver version
45 # none of that code seems applicable in f16 any longer
46 #
47 # also a horrible hack to the network initscripts has been removed