Skip to content

Instantly share code, notes, and snippets.

@tobert
Created January 5, 2011 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobert/765741 to your computer and use it in GitHub Desktop.
Save tobert/765741 to your computer and use it in GitHub Desktop.
Gutted rc.sysinit for EL5 running under LXC
#!/bin/bash
# Print a text banner.
echo -en $"\t\tWelcome to "
read -r redhat_release < /etc/redhat-release
PRODUCT=`sed "s/CentOS \(.*\) release.*/\1/" /etc/redhat-release`
echo -e "\\033[0;36m$PRODUCT\\033[0;39m"
# Clean up utmp/wtmp
> /var/run/utmp
touch /var/log/wtmp
chgrp utmp /var/run/utmp /var/log/wtmp
chmod 0664 /var/run/utmp /var/log/wtmp
rm -f /var/lock/subsys/*
rm -f /var/run/*.pid
cat /proc/mounts > /etc/mtab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment