|
From: Heiko Z. <smi...@us...> - 2005-05-11 01:29:59
|
Update of /cvsroot/devil-linux/build/config/etc/init.d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18815/config/etc/init.d Modified Files: Tag: rel-1-2-patches jail Added Files: Tag: rel-1-2-patches saprouter Log Message: - new jail command SYMLINK - added support for running a SAPRouter in a chroot jail Index: jail =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/init.d/jail,v retrieving revision 1.27.2.3 retrieving revision 1.27.2.4 diff -u -d -r1.27.2.3 -r1.27.2.4 --- jail 8 Dec 2004 01:15:45 -0000 1.27.2.3 +++ jail 11 May 2005 01:29:47 -0000 1.27.2.4 @@ -206,6 +206,11 @@ LINK ) ln -sf $PARAM $JAILDIR$PARAM ;; + SYMLINK ) + PARAM1=$(echo $PARAM | cut -d " " -f 1) + PARAM2=$(echo $PARAM | cut -d " " -f 2) + ln -sf $PARAM1 $JAILDIR$PARAM2 + ;; LINKROOT ) ln -sfn / $JAILDIR$PARAM ;; --- NEW FILE: saprouter --- #!/bin/bash # # $Source: /cvsroot/devil-linux/build/config/etc/init.d/Attic/saprouter,v $ # $Revision: 1.1.2.1 $ # $Date: 2005/05/11 01:29:47 $ # # http://www.devil-linux.org # ### BEGIN INIT INFO # Provides: saprouter # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 6 # Description: starts the saprouter daemon ### END INIT INFO # settings source /etc/sysconfig/config source /etc/sysconfig/saprouter # parameters NAME="SAPRouter" CONFIGNAME=SAPROUTER DAEMON=/saprouter PARAMETER="$SAPROUTER_PARAM" # source function library source /etc/init.d/functions eval START=\$START_$CONFIGNAME # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START=yes test "$START" = "yes" || exit 0 case "$1" in start) echo -n "Starting $NAME: " cd "$SAPROUTER_DIR" #$DAEMON $PARAMETER &> /dev/null /etc/init.d/jail start SAPROUTER nohup compartment --no-close-fd --chroot /var/data/saprouter --user saprouter --group saprouter $DAEMON $PARAMETER &> /dev/null & evaluate_retval ;; stop) echo -n "Shutting down $NAME: " killproc $DAEMON ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac |