X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=distrib%2Fdebian%2Finitpost;h=9b1fb1f1f13ff008248c66c0e71a790391064fe3;hb=1184d03b7f9334fe8a17ed868faa052cc842138d;hp=cf42fe94f570b157965f5ff333dad0c68832311b;hpb=8314751ea70853c629cbfc1c8f3ce2ea9647de3f;p=util-vserver.git diff --git a/distrib/debian/initpost b/distrib/debian/initpost index cf42fe9..9b1fb1f 100755 --- a/distrib/debian/initpost +++ b/distrib/debian/initpost @@ -21,10 +21,11 @@ cfgdir="$1" vdir="$cfgdir"/vdir . "$2" +. "$_LIB_VSERVER_BUILD_FUNCTIONS" # vserver name -NAME=$(< "$cfgdir"/name) +NAME="$cfgdir" # go to vdir for chroot-sh @@ -103,22 +104,41 @@ if $_CHROOT_SH testfile /etc/init.d/sendsigs; then -e 's/^\(\s\+splash_back\)$/#\1/' fi -# from here on we need to do things live in the server -$_CHROOT_SH truncate /vserver-config.sh < "$__DISTRIBDIR"/etch/vserver-config.sh -$_CHROOT_SH chmod 0755 /vserver-config.sh - echo echo ">>> Executing post install script ... " echo # start vserver before we can exec anything inside it -vserver $NAME start +$_VSERVER "$NAME" stop &>/dev/null || : +startSleepingGuest "$NAME" 30 # run the configure commands from within the server -vserver $NAME exec /vserver-config.sh -$_CHROOT_SH rm /vserver-config.sh +export LANG=C LC_ALL=C + +$_CHROOT_SH testfile /usr/sbin/locale-gen && \ + $_VSERVER "$NAME" exec /usr/sbin/locale-gen + +have_halt= +test "$(cat "$cfgdir"/apps/init/style 2>/dev/null)" != "plain" || \ + have_halt=halt + +pushd etc/init.d &>/dev/null +for i in *; do + case "$i" in + (sysklogd|syslog-ng|rsyslog|dsyslog) + ;; + (README|skeleton|sendsigs|single|rc|rc.local|rcS) + ;; + ($have_halt) + ;; + (*) + $_VSERVER "$NAME" exec update-rc.d -f "$i" remove + ;; + esac +done +popd &>/dev/null # stop the vserver -vserver $NAME stop +stopSleepingGuest "$NAME" &>/dev/null || : popd &>/dev/null