temporary directory /etc/hotplug "fixed"

reboot and shutdown via "at"
remove some packages for development systems
set default runlevel to 3
export some environment settings (LANG and TERM) for "chroot"
is_init_running migrated to "at"
This commit is contained in:
lars 2005-08-08 22:31:11 +00:00
parent f49d0d7cf5
commit c54e5975a6
5 changed files with 21 additions and 6 deletions

View file

@ -180,9 +180,9 @@ function is_crypto_mounted()
function is_init_running() function is_init_running()
{ {
ps -e | grep -q -E "$MKFS_DATA|$WIPE" #ps -e | grep -q -E "$MKFS_DATA|$WIPE"
# this line is good for the "at" stuff - see cryptobox.pl # this line is good for the "at" stuff - see cryptobox.pl
[ -n "`at -l`" ] [ -n "$(at -l)" ]
} }

View file

@ -28,6 +28,13 @@ mount -n --bind "$TMP_DIR" "$MNT_DST"
[ ! -e /proc/mounts ] && mount -n -t proc proc /proc [ ! -e /proc/mounts ] && mount -n -t proc proc /proc
# default language setting - prevents dpkg error messages
export LANG=C
# set default terminal (good if you are running in a screen session)
export TERM=linux
# execute parameters as commandline
if [ $# -gt 0 ] if [ $# -gt 0 ]
then "$@" then "$@"
else bash else bash

View file

@ -14,12 +14,16 @@ set -eu
RUNTIMEDIR=/opt/dfsruntime/runtimerd RUNTIMEDIR=/opt/dfsruntime/runtimerd
TUNDEV=$RUNTIMEDIR/dev/net/tun TUNDEV=$RUNTIMEDIR/dev/net/tun
SECURITY_REMOVE_PACKAGES="ssh strace telnet unzip tar zip wget ppp pppconfig nvi nano gzip curl bzip2 aptitude tasksel pppoe pppoeconf elinks" SECURITY_REMOVE_PACKAGES="ssh strace unzip tar zip wget nvi nano gzip curl bzip2 aptitude tasksel elinks"
DEVEL_REMOVE_PACKAGES="exim4-daemon-light exim4-config exim4-base netkit-inetd telnet ppp pppconfig pppoe pppoeconf"
function configure_normal() function configure_normal()
# the usual stuff - not optimized for security # the usual stuff - not optimized for security
{ {
# set default runlevel to 3
sed -i 's/^id:2:initdefault/id:3:initdefault/' /etc/inittab
######### devices ########## ######### devices ##########
# create tun device for running under qemu # create tun device for running under qemu
if [ ! -e "$TUNDEV" ] if [ ! -e "$TUNDEV" ]
@ -45,6 +49,10 @@ function configure_normal()
# allow nput of password # allow nput of password
sed -i 's/^PasswordAuthentication.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config sed -i 's/^PasswordAuthentication.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config
fi fi
# remove unnecessary packages - return true, if no packages were
# removed
dpkg --force-all -P $DEVEL_REMOVE_PACKAGES 2>&1 | grep -v "which isn't installed." || true
} }

View file

@ -195,14 +195,14 @@ sub box_init
sub system_poweroff() sub system_poweroff()
{ {
&umount_vol(); &umount_vol();
system("{sleep 5; /sbin/poweroff; } </dev/null &>/dev/null &"); system("echo /sbin/poweroff | at now + 1 minutes >>$LOG_FILE 2>&1");
} }
sub system_reboot() sub system_reboot()
{ {
&umount_vol(); &umount_vol();
system("{sleep 5; /sbin/reboot; } </dev/null &>/dev/null &"); system("echo /sbin/reboot | at now + 1 minutes >>$LOG_FILE 2>&1");
} }

View file

@ -144,7 +144,7 @@ ramdisk_files = /etc/resolv.conf
/etc/network /etc/network
/var/lib/misc /var/lib/misc
/var/lib/urandom /var/lib/urandom
/etc/hotpug /etc/hotplug
/var/spool/cron /var/spool/cron
# Directories to create on live fs # Directories to create on live fs