Changeset 1191
- Timestamp:
- Jan 4, 2009, 3:24:38 PM (9 years ago)
- Location:
- trunk/runit/servicedirs
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/runit/servicedirs/atftpd/run
r967 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 4 if [ -z "$RUN" ] ; then 5 export RUN=0 6 exec chpst -e ./env ./run 7 fi 3 8 4 9 OPTIONS="--daemon --no-fork --logfile /dev/stdout --tftpd-timeout 30 --retry-timeout 5 --no-tsize --no-blksize --no-multicast --maxthread 1000 --verbose=7" 5 10 export OPTIONS 6 11 7 run_tftpd() { 8 # check that root directory exists 9 if [ ! -d "$ROOT" ] ; then 10 echo "ROOT directory '$ROOT' does not exist." 11 exit 1 12 fi 13 # check if address is specified 14 if [ "$ADDRESS" ] ; then 15 OPTIONS="$OPTIONS --bind-address $ADDRESS" 16 fi 17 # check if port is specified 18 if [ "$PORT" ] ; then 19 OPTIONS="$OPTIONS --port $PORT" 20 fi 21 # check if user is specified 22 if [ "$USER" ] ; then 23 OPTIONS="$OPTIONS --user $USER" 24 fi 25 # check if group is specified 26 if [ "$GROUP" ] ; then 27 OPTIONS="$OPTIONS --group $GROUP" 28 fi 29 echo "starting atftpd:" 30 echo "in.tftpd $OPTIONS $ROOT" 31 exec in.tftpd $OPTIONS "$ROOT" 32 } 33 export -f run_tftpd 12 # check that root directory exists 13 if [ ! -d "$ROOT" ] ; then 14 echo "ROOT directory '$ROOT' does not exist." 15 exit 1 16 fi 17 # check if address is specified 18 [ "$ADDRESS" ] && OPTIONS="$OPTIONS --bind-address $ADDRESS" 19 # check if port is specified 20 [ "$PORT" ] && OPTIONS="$OPTIONS --port $PORT" 21 # check if user is specified 22 [ "$USER" ] && OPTIONS="$OPTIONS --user $USER" 23 # check if group is specified 24 [ "$GROUP" ] && OPTIONS="$OPTIONS --group $GROUP" 34 25 35 exec chpst -e ./env sh -c run_tftpd 26 echo "starting atftpd:" 27 echo "in.tftpd $OPTIONS $ROOT" 28 exec in.tftpd $OPTIONS "$ROOT" -
trunk/runit/servicedirs/dhclient/run
r975 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 3 4 run_dhclient() { 5 e xec dhclient -d $INTERFACES6 } 7 export -f run_dhclient 4 if [ ! -s env/INTERFACES ] ; then 5 echo "no interfaces specified." 6 exit 1 7 fi 8 8 9 9 # check that the interface exists before running 10 10 for iface in $(cat env/INTERFACES) ; do 11 ip addr show $iface > /dev/null || exit 111 ip addr show $iface > /dev/null 12 12 done 13 13 14 exec chpst -e ./env sh -c run_dhclient14 exec chpst -e ./env sh -c 'exec dhclient -d $INTERFACES' -
trunk/runit/servicedirs/dhcp/run
r808 r1191 1 1 #!/bin/sh 2 2 exec 2>&1 3 exec chpst -e ./env dhcpd -f -d $INTERFACES3 exec chpst -e ./env sh -c 'exec dhcpd -f -d $INTERFACES' -
trunk/runit/servicedirs/gpm/run
r816 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 3 … … 6 6 CFG=/etc/gpm.conf 7 7 8 test -x $GPM || exit 08 test -x $GPM || exit 1 9 9 10 10 cmdln= … … 13 13 if [ -f $CFG ]; then 14 14 . $CFG 15 if [ -n "$device" ]; then cmdln="$cmdln -m $device"; fi 16 if [ -n "$type" ]; then cmdln="$cmdln -t $type"; fi 17 if [ -n "$responsiveness" ]; then cmdln="$cmdln -r $responsiveness"; fi 18 if [ -n "$sample_rate" ]; then cmdln="$cmdln -s $sample_rate"; fi 15 [ -n "$device" ] && cmdln="$cmdln -m $device" 16 [ -n "$type" ] && cmdln="$cmdln -t $type" 17 [ -n "$responsiveness" ] && cmdln="$cmdln -r $responsiveness" 18 [ -n "$sample_rate" ] && cmdln="$cmdln -s $sample_rate" 19 19 20 # Yes, this /IS/ correct! There is no space after -R!!!!!! 20 21 # I reserve the right to throw manpages at anyone who disagrees. 21 if [ -n "$repeat_type" ] && [ "$repeat_type" != "none" ]; then22 cmdln="$cmdln -R$repeat_type"23 fi24 if [ -n "$append" ]; then cmdln="$cmdln $append"; fi 22 [ -n "$repeat_type" ] && [ "$repeat_type" != "none" ] && \ 23 cmdln="$cmdln -R$repeat_type" 24 [ -n "$append" ] && cmdln="$cmdln $append" 25 25 26 # If both the second device and type are specified, use it. 26 if [ -n "$device2" ] && [ -n "$type2" ] ; then 27 cmdln="$cmdln -M -m $device2 -t $type2" 28 fi 27 [ -n "$device2" ] && [ -n "$type2" ] && \ 28 cmdln="$cmdln -M -m $device2 -t $type2" 29 29 fi 30 30 -
trunk/runit/servicedirs/mpd/run
r812 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 3 … … 6 6 MPD_OPTS="--no-daemon --stdout" 7 7 8 if [ -r /etc/default/mpd ]; then 9 . /etc/default/mpd 8 echo "Starting Music Player Daemon: " 9 10 [ -r /etc/default/mpd ] && . /etc/default/mpd 11 12 # check the config 13 if ! (grep -q db_file $MPDCONF && grep -q pid_file $MPDCONF); then 14 echo "$MPDCONF must have db_file and pid_file set; not starting." 15 exit 1 10 16 fi 11 17 12 check_conf () { 13 if ! (grep -q db_file $MPDCONF && grep -q pid_file $MPDCONF); then 14 echo "$MPDCONF must have db_file and pid_file set; not starting." 15 exit 016 fi17 } 18 # check the db file 19 DBFILE=`sed -n -e 's/^[[:space:]]*db_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF` 20 if [ ! -f "$DBFILE" ]; then 21 echo "creating $DBFILE... " 22 $DAEMON --create-db "$MPDCONF" > /dev/null 23 fi 18 24 19 check_dbfile () {20 DBFILE=`sed -n -e 's/^[[:space:]]*db_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF`21 if [ ! -f "$DBFILE" ]; then22 echo "creating $DBFILE... "23 $DAEMON --create-db "$MPDCONF" > /dev/null24 fi25 }26 27 echo "Starting Music Player Daemon: "28 check_conf29 check_dbfile30 25 exec chpst -u mpd $DAEMON $MPD_OPTS "$MPDCONF" -
trunk/runit/servicedirs/ntp/run
r972 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 3 4 if [ -f /etc/default/ntp ] ; then 5 . /etc/default/ntp 6 fi 4 [ -f /etc/default/ntp ] && . /etc/default/ntp 7 5 8 6 echo "starting ntpd..." -
trunk/runit/servicedirs/nullmailer/run
r874 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 3 -
trunk/runit/servicedirs/ssh/run
r972 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 3 4 if [ -f /etc/default/ssh ] ; then 5 . /etc/default/ssh 6 fi 4 [ -f /etc/default/ssh ] && . /etc/default/ssh 7 5 8 6 # make sure priviledge seperation chroot directory exists -
trunk/runit/servicedirs/tftpd-hpa/run
r967 r1191 1 #!/bin/sh 1 #!/bin/sh -e 2 2 exec 2>&1 3 4 if [ -z "$RUN" ] ; then 5 export RUN=0 6 exec chpst -e ./env ./run 7 fi 3 8 4 9 OPTIONS="-L -s -v" 5 10 export OPTIONS 6 11 7 run_tftpd() { 8 # check that root directory exists 9 if [ ! -d "$ROOT" ] ; then 10 echo "ROOT directory '$ROOT' does not exist." 11 exit 1 12 fi 13 # check if address is specified 14 if [ "$ADDRESS" ] ; then 15 OPTIONS="$OPTIONS -a $ADDRESS" 16 fi 17 if [ "$USER" ] ; then 18 OPTIONS="$OPTIONS -u $USER" 19 fi 20 echo "starting tftpd-hpa:" 21 echo "in.tftpd $OPTIONS $ROOT" 22 exec in.tftpd $OPTIONS "$ROOT" 23 } 24 export -f run_tftpd 12 # check that root directory exists 13 if [ ! -d "$ROOT" ] ; then 14 echo "ROOT directory '$ROOT' does not exist." 15 exit 1 16 fi 17 # check if address is specified 18 [ "$ADDRESS" ] && OPTIONS="$OPTIONS -a $ADDRESS" 19 # check if user is specified 20 [ "$USER" ] && OPTIONS="$OPTIONS -u $USER" 25 21 26 exec chpst -e ./env sh -c run_tftpd 22 echo "starting tftpd-hpa:" 23 echo "in.tftpd $OPTIONS $ROOT" 24 exec in.tftpd $OPTIONS "$ROOT"
Note: See TracChangeset
for help on using the changeset viewer.