Commits

Rodrigo Bistolfi committed 969d0c7

vasm, vlinit and vlconfig2 initial commits.

git-svn-id: http://vlcore.vectorlinux.com/svn/vlcore/vlinit@1308754de0-b482-494f-9fff-2d8ef087405e

  • Participants

Comments (0)

Files changed (101)

+# /etc/inittab
+# inittab This file describes how the INIT process should set up
+# the system in a certain run-level.
+#
+# Originall by Patrick volkerdi (Slackware)
+# Modified by Eko M. Budi for Vector Linux
+# 0 = halt
+# 1 = single user mode : minimum HW
+# 2 = multiuser text desktop : network
+# 3 = multiuser text server  : network, servers
+# 4 = multiuser GUI desktop  : network, X-window
+# 5 = multiuser GUI server   : network, servers, X-window
+# 6 = reboot
+#
+# This is only for VL Dynamite
+# 7/8 = autologin boot !     :  HACKING :P
+#
+# Default runlevel. (Do not set to 0 or 6 !)
+id:2:initdefault:
+
+# Single User Mode (runs when system boots).
+is:S:sysinit:/etc/rc.d/rc.S 
+
+# Multi User Mode 
+im:234578:wait:/etc/rc.d/rc.M
+
+# Script to run when switching runlevel
+i0:0:wait:/etc/rc.d/rc.vlinit
+i1:1:wait:/etc/rc.d/rc.vlinit
+i2:2:wait:/etc/rc.d/rc.vlinit
+i3:3:wait:/etc/rc.d/rc.vlinit
+i4:4:wait:/etc/rc.d/rc.vlinit
+i5:5:wait:/etc/rc.d/rc.vlinit
+i6:6:wait:/etc/rc.d/rc.vlinit
+i7:7:wait:/etc/rc.d/rc.vlinit
+i8:8:wait:/etc/rc.d/rc.vlinit
+
+# Local initialisation in the end of multiuser
+il:234578:wait:/etc/rc.d/rc.local
+
+# Kill basic services
+k0:0:wait:/etc/rc.d/rc.K   # Halt
+k1:1:wait:/etc/rc.d/rc.K   # Single user
+k6:6:wait:/etc/rc.d/rc.K   # Reboot
+
+#ud::once:/sbin/update
+
+# What to do at the "Three Finger Salute".
+#ca::ctrlaltdel:/sbin/ctrlaltdel
+ca::ctrlaltdel:/sbin/shutdown -a -t3 -r now
+
+# What to do when power fails (shutdown to single user).
+pf::powerfail:/sbin/shutdown -f -h +2 "THE POWER IS FAILING"
+
+# If power is back before shutdown, cancel the running shutdown.
+pg:0123456:powerokwait:/sbin/shutdown -c "THE POWER IS BACK"
+
+# If power comes back in single user mode, return to multi user mode.
+ps:S:powerokwait:/sbin/init 2
+
+# NOTE NOTE NOTE adjust this to your getty or you will not be
+# able to login !!
+#
+# Note: for 'agetty' you use linespeed, line.
+# for 'getty_ps' you use line, linespeed and also use 'gettydefs'
+# 0 is for User Mode Linux only
+# 1 is used for autologin, so it is not activated on level 78
+#0:12345:respawn:/sbin/mingetty tty0
+1:2345:respawn:/sbin/mingetty tty1
+2:234578:respawn:/sbin/mingetty tty2
+3:234578:respawn:/sbin/mingetty tty3
+4:234578:respawn:/sbin/mingetty tty4
+5:234578:respawn:/sbin/mingetty tty5
+6:234578:respawn:/sbin/mingetty tty6
+
+# Separate console for runlevel 1
+# So when switching to runlevel 1 everyone will be loged out
+c1:1:respawn:/sbin/mingetty tty1
+c2:1:respawn:/sbin/mingetty tty2
+c3:1:respawn:/sbin/mingetty tty3
+c4:1:respawn:/sbin/mingetty tty4
+c5:1:respawn:/sbin/mingetty tty5
+c6:1:respawn:/sbin/mingetty tty6
+
+# The getties in multi user mode on consoles an serial lines.
+#
+# Serial lines
+#s1:12345:respawn:/sbin/agetty 19200 ttyS0 vt100
+#s2:12345:respawn:/sbin/agetty 38400 ttyS1 vt102
+
+# Dialup lines
+#d1:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0 vt100
+#d2:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS1 vt100
+
+## Launch X for run level 4/5
+ix:45:respawn:/etc/rc.d/rc.X
+
+# End of /etc/inittab

File etc/rc.d/diamond

+#!/bin/sh
+
+ERROLOG="/var/run/$SERVER.log"
+CMDFILE="/var/run/$SERVER.sh"
+PIDFILE="/var/run/$SERVER.pid"
+
+echo $CMDLINE > $CMDFILE
+
+case "$1" in 
+	start)
+		if [ ! -e $PIDFILE ]; then
+			echo -ne "Starting $SERVER \n"
+			. $CMDFILE >> $ERROLOG
+			TMP=`pidof $APPS`
+			if [ "$?" == "0" ]; then
+				echo $TMP > $PIDFILE
+			else
+				echo $TMP >> $ERROLOG
+			fi
+		else
+			echo "$SERVER already running"
+		fi
+
+	;;
+	
+	stop)
+		echo  "Stoping $SERVER"
+		kill  `cat $PIDFILE` >> $ERROLOG
+		rm -f $PIDFILE       >> $ERROLOG
+	;;
+	
+	restart)
+		echo "Restarting $SERVER"
+		$0  stop  >> $ERROLOG
+		$0  start >> $ERROLOG
+	;;
+	
+	status)
+		if [ -e $PIDFILE  ]; then
+			echo -e "$SERVER \t is running at pid `cat $PIDFILE`"
+			exit 2
+		else
+			echo -e "$SERVER \t isn't running"
+			exit 3
+		fi
+	;;
+	
+	*)
+		echo "Usage $0 {start|stop|restart|status}"
+	;;
+esac
+exit 0

File etc/rc.d/functions

+#!/bin/sh
+# 
+# Standard functions for launching daemons
+
+COL_SUCCESS="echo -en \\033[70G"
+COL_FAILURE="echo -en \\033[70G"
+NORMAL="echo -en \\033[0;39m"
+SUCCESS="echo -en \\033[1;32m"
+FAILURE="echo -en \\033[1;31m"
+
+echon ()
+{
+   echo -n $@
+}
+
+# The evaluate_retval function evaluates the return value of the process
+# that was run just before this function was called. If the return value
+# was 0, indicating success, the print_status function is called with
+# the 'success' parameter. Otherwise the print_status function is called
+# with the failure parameter
+
+evaluate_retval()
+{
+    if [ $? = 0 ]
+    then
+            print_status success
+    else
+            print_status failure
+    fi
+}
+
+#
+# The print_status prints [  OK  ] or [FAILED] to the screen. OK appears
+# in the colour defined by the SUCCESS variable and FAILED appears in
+# the colour defined by the FAILURE variable. Both are printed starting
+# in the column defined by the COL variable.
+
+print_status()
+{
+#
+# If no parameters are given to the print_status function, print usage
+# information.
+#
+        if [ $# = 0 ]
+        then
+                echo "Usage: print_status {success|failure}"
+                return 1
+        fi
+
+        case "$1" in
+                success)
+                        $COL_SUCCESS
+                        echo -n "[  "
+                        $SUCCESS
+                        echo -n "OK"
+                        $NORMAL
+                        echo "  ]"
+			true
+                        ;;
+                failure)
+                        $COL_FAILURE
+                        echo -n "["
+                        $FAILURE
+                        echo -n "FAILED"
+                        $NORMAL
+                        echo "]"
+                        false
+			;;
+        esac
+}
+
+#
+# The loadproc function starts a process (often a daemon) with
+# proper error checking
+loadproc()
+{
+
+#
+# If no parameters are given to the print_status function, print usage
+# information.
+#
+
+        if [ $# = 0 ]
+        then
+                echo "Usage: loadproc {program}"
+                exit 1
+        fi
+#
+# Find the basename of the first parameter (the daemon's name without
+# the path
+# that was provided so /usr/sbin/syslogd becomes plain 'syslogd' after
+# basename ran)
+#
+
+        base=$(/usr/bin/basename $1)
+#
+# the pidlist variable will contains the output of the pidof command.
+# pidof will try to find the PID's that belong to a certain string;
+# $base in this case
+#
+
+        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+
+        pid=""
+
+        for apid in $pidlist
+        do
+                if [ -d /proc/$apid ]
+                then
+                        pid="$pid $apid"
+                fi
+        done
+#
+# If the $pid variable contains anything (from the previous for loop) it
+# means the daemon is already running
+#
+        
+	if [ ! -n "$pid" ]
+        then
+#
+# Empty $pid variable means it's not running, so we run $* (all
+# parameters giving to this function from the script) and then check the
+# return value
+#
+                $*
+                evaluate_retval
+        else
+#
+# The variable $pid was not empty, meaning it was already running. We
+# print [FAILED] now
+#
+                print_status failure
+        fi
+
+}
+
+#
+# The killproc function kills a process with proper error checking
+#
+killproc()
+{
+
+#
+# If no parameters are given to the print_status function, print usage
+# information.
+#
+
+        if [ $# = 0 ]
+        then
+                echo "Usage: killproc {program} [signal]"
+                exit 1
+        fi
+
+#
+# Find the basename of the first parameter (the daemon's name without
+# the path
+# that was provided so /usr/sbin/syslogd becomes plain 'syslogd' after
+# basename ran)
+#
+
+        base=$(/usr/bin/basename $1)
+
+#
+# Check if we gave a signal to kill the process with (like -HUP, -TERM,
+# -KILL, etc) to this function (the second parameter). If no second
+# parameter was provided set the nolevel variable. Else set the
+# killlevel variable to the value of $2 (the second parameter)
+#
+
+        if [ "$2" != "" ]
+        then
+                killlevel=-$2
+        else
+                nolevel=1
+        fi
+
+#
+# the pidlist variable will contains the output of the pidof command.
+# pidof will try to find the PID's that belong to a certain string;
+# $base in this case
+#
+
+        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+
+        pid=""
+
+        for apid in $pidlist
+        do
+                if [ -d /proc/$apid ]
+                then
+                        pid="$pid $apid"
+                fi
+        done
+
+#
+# If $pid contains something from the previous for loop it means one or
+# more PID's were found that belongs to the processes to be killed
+#
+        if [ -n "$pid" ]
+        then
+#
+# If no kill level was specified we'll try -TERM first and then sleep
+# for 2 seconds to allow the kill to be completed
+#
+                if [ "$nolevel" = 1 ]
+                then
+                        /bin/kill -TERM $pid
+#
+# If after -TERM the PID still exists we'll wait 2 seconds before
+# trying to kill it with -KILL. If the PID still exist after that, wait
+# two more seconds. If the PIDs still exist by then it's safe to assume
+# that we cannot kill these PIDs.
+#
+
+                        if /bin/ps h $pid >/dev/null 2>&1
+                        then
+                                /bin/sleep 2
+                                if /bin/ps h $pid > /dev/null 2>&1
+                                then
+                                        /bin/kill -KILL $pid
+                                        if /bin/ps h $pid > /dev/null 2>&1
+                                        then
+                                                /bin/sleep 2
+                                        fi
+                                fi
+                        fi
+                        /bin/ps h $pid >/dev/null 2>&1
+                        if [ $? = 0 ]
+                        then
+#
+# If after the -KILL it still exists it can't be killed for some reason
+# and we'll print [FAILED]
+#
+                                print_status failure
+                        else
+#
+# It was killed, remove possible stale PID file in /var/run and 
+# print [  OK  ]
+#
+                                /bin/rm -f /var/run/$base.pid
+                                print_status success
+                        fi
+                else
+#
+# A kill level was provided. Kill with the provided kill level and wait
+# for 2 seconds to allow the kill to be completed
+#
+                        /bin/kill $killlevel $pid
+                        if /bin/ps h $pid > /dev/null 2>&1
+                        then
+                                /bin/sleep 2
+                        fi
+                        /bin/ps h $pid >/dev/null 2>&1
+                        if [ $? = 0 ]
+                        then
+#
+# If ps' return value is 0 it means it ran ok which indicates that the
+# PID still exists. This means the process wasn't killed properly with
+# the signal provided. Print [FAILED]
+#
+                                print_status failure
+                        else
+#
+# If the return value was 1 or higher it means the PID didn't exist
+# anymore which means it was killed successfully. Remove possible stale
+# PID file and print [  OK  ]
+#
+                                /bin/rm -f /var/run/$base.pid
+                                print_status success
+                        fi
+                fi
+        else
+#
+# The PID didn't exist so we can't attempt to kill it. Print [FAILED]
+#
+                print_status failure
+        fi
+}
+
+#
+# The reloadproc functions sends a signal to a daemon telling it to
+# reload it's configuration file. This is almost identical to the
+# killproc function with the exception that it won't try to kill it with
+# a -KILL signal (aka -9)
+#
+
+reloadproc()
+{
+
+#
+# If no parameters are given to the print_status function, print usage
+# information.
+#
+
+        if [ $# = 0 ]
+        then
+                echo "Usage: reloadproc {program} [signal]"
+                exit 1
+        fi
+
+#
+# Find the basename of the first parameter (the daemon's name without
+# the path that was provided so /usr/sbin/syslogd becomes plain 'syslogd' 
+# after basename ran)
+#
+
+        base=$(/usr/bin/basename $1)
+
+#
+# Check if we gave a signal to send to the process (like -HUP)
+# to this function (the second parameter). If no second
+# parameter was provided set the nolevel variable. Else set the
+# killlevel variable to the value of $2 (the second parameter)
+#
+
+
+        if [ -n "$2" ]
+        then
+                killlevel=-$2
+        else
+                nolevel=1
+        fi
+
+#
+# the pidlist variable will contains the output of the pidof command.
+# pidof will try to find the PID's that belong to a certain string;
+# $base in this case
+#
+
+        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+
+        pid=""
+
+        for apid in $pidlist
+        do
+                if [ -d /proc/$apid ]
+                then
+                        pid="$pid $apid"
+                fi
+        done
+
+#
+# If $pid contains something from the previous for loop it means one or
+# more PID's were found that belongs to the processes to be reloaded
+#
+
+        if [ -n "$pid" ]
+        then
+
+#
+# If nolevel was set we will use the default reload signal SIGHUP.
+#
+
+                if [ "$nolevel" = 1 ]
+                then
+                        /bin/kill -SIGHUP $pid
+                        evaluate_retval
+                else
+#
+# Else we will use the provided signal
+#
+
+                        /bin/kill $killlevel $pid
+                        evaluate_retval
+                fi
+        else
+#
+# If $pid is empty no PID's have been found that belong to the process
+# and print [FAILED]
+#
+
+                print_status failure
+        fi
+}
+
+
+
+#
+# The checkloadproc functions start a daemon if it is not running
+
+checkloadproc()
+{
+#
+# If no parameters are given to the print_status function, print usage
+# information.
+#
+
+        if [ $# = 0 ]
+        then
+                echo "Usage: checkloadproc {program} [ param ..]"
+                exit 1
+        fi
+
+#
+# Find the basename of the first parameter (the daemon's name without
+# the path that was provided so /usr/sbin/syslogd becomes plain 'syslogd' 
+# after basename ran)
+#
+
+        base=$(/usr/bin/basename $1)
+
+#
+# the pidlist variable will contains the output of the pidof command.
+# pidof will try to find the PID's that belong to a certain string;
+# $base in this case
+#
+
+        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+
+        pid=""
+
+        for apid in $pidlist
+        do
+                if [ -d /proc/$apid ]
+                then
+                        pid="$pid $apid"
+                fi
+        done
+
+#
+# If $pid contains something from the previous for loop it means one or
+# more PID's were found that belongs to the processes. Dont start it
+#
+        if [ -n "$pid" ]
+        then
+            print_status success
+	else
+# Start it
+            loadproc $*
+        fi
+}
+
+#
+# The statusproc function will try to find out if a process is running
+# or not
+#
+
+statusproc()
+{
+
+#
+# If no parameters are given to the print_status function, print usage
+# information.
+#
+
+        if [ $# = 0 ]
+        then
+                echo "Usage: status {program}"
+                return 1
+        fi
+
+#
+# $pid will contain a list of PID's that belong to a process
+#
+
+        pid=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $1)
+        if [ -n "$pid" ]
+        then
+#
+# If $pid contains something, the process is running, print the contents
+# of the $pid variable
+#
+                echo "$1 running with Process ID $pid"
+                return 0
+        fi
+
+#
+# If $pid doesn't contain it check if a PID file exists and inform the
+# user about this stale file.
+#
+
+        if [ -f /var/run/$1.pid ]
+        then
+                pid=$(/usr/bin/head -1 /var/run/$1.pid)
+                if [ -n "$pid" ]
+                then
+                        echo "$1 not running but /var/run/$1.pid exists"
+                        return 1
+                fi
+        else
+                echo "$1 is not running"
+		return 1
+        fi
+
+}
+
+# End /etc/init.d/functions

File etc/rc.d/functions-display

+#!/bin/sh
+# Begin /etc/init.d/functions
+
+# log utilities
+INITLOG=/var/log/boot.log
+
+#Set YES if you want a "rainbow-technicolor" initialization
+export  RCINITCOLORS="YES" 
+
+# Set onlcr to avoid staircase effect.
+stty onlcr 0>&1
+
+# Echo with color
+echoc()
+{
+if [ "$RCINITCOLORS" = "NO" ] ; then
+	echo "$1"
+else
+
+	case "$2" in
+		black)
+			echo "$1"
+		;;
+		red)
+			echo "$1"
+		;;
+		green)
+			echo "$1"
+		;;
+		yellow)
+			echo "$1"
+		;;
+		blue)
+			echo "$1"
+		;;
+		magenta)
+			echo "$1"
+		;;
+		cyan)
+			echo "$1"
+		;;
+		white)
+			echo "$1"
+		;;
+		*)
+			echo "$1"
+		;;
+	esac
+fi
+}
+
+## Echo not newline
+echon()
+{
+   echo -n $*
+}
+
+# Echo and log not newline
+echonl()
+{
+   echo -n $*
+   echo -n $* >> $INITLOG
+}
+
+# Echo and log
+echol()
+{
+   echo $*
+   echo $* >> $INITLOG
+}
+
+# Echo color and log
+echocl()
+{
+   echoc "$1" $2
+   echo "$1" >> $INITLOG
+}
+
+evaluate_retvall()
+{
+   evaluate_retval | tee -a $INITLOG
+}
+
+# Set a few variables that influence the text that's printed on the
+# screen. The SET_COL variable starts the text in column number 70 (as
+# defined by the COL variable). NORMAL prints text in normal mode.
+# SUCCESS prints text in a green colour and FAILURE prints text in a red
+# colour
+#
+
+COL=70
+SET_COL="echo -en \\033[${COL}G"
+NORMAL="echo -en \\033[0;39m"
+SUCCESS="echo -en \\033[1;32m"
+FAILURE="echo -en \\033[1;31m"
+
+#
+# The evaluate_retval function evaluates the return value of the process
+# that was run just before this function was called. If the return value
+# was 0, indicating success, the print_status function is called with
+# the 'success' parameter. Otherwise the print_status function is called
+# with the failure parameter.
+#
+
+evaluate_retval()
+{
+        if [ $? = 0 ]
+        then
+                print_status success
+        else
+                print_status failure
+        fi
+}
+
+#
+# The print_status prints [  OK  ] or [FAILED] to the screen. OK appears
+# in the colour defined by the SUCCESS variable and FAILED appears in
+# the colour defined by the FAILURE variable. Both are printed starting
+# in the column defined by the COL variable.
+#
+
+print_status()
+{
+
+#
+# If no parameters are given to the print_status function, print usage
+# information.
+#
+
+        if [ $# = 0 ]
+        then
+                echo "Usage: print_status {success|failure}"
+                return 1
+        fi   
+
+        case "$1" in
+                success)
+                        $SET_COL
+                        echo -n "[  "
+                        $SUCCESS
+                        /etc/rc.d/rc.text success "OK"
+                        echo -n "OK"
+                        $NORMAL
+                        echo "  ]"
+                        ;;
+                failure)
+                        $SET_COL
+                        echo -n "["
+                        $FAILURE
+                        /etc/rc.d/rc.text failure "FAILED"
+                        echo -n "FAILED"
+                        $NORMAL
+                        echo "]"
+                        ;;
+        esac
+
+}
+
+
+get_uptime()
+{
+    cat /proc/uptime | cut -f1 -d ' '
+}
+
+
+
+# End /etc/init.d/functions

File etc/rc.d/functions-network

+#!/bin/sh
+# This is a standard inet initialisation
+# it supposed to to be sourced by inet0 .. inet9 script
+# and also inetboot
+# 
+# GNU GPL  (c) Eko M. Budi, 2004
+#          (c) Vector Linux, 2004
+#
+
+###########################################################
+## The sourcer must set these settings
+#DEVICE=eth0
+#DHCP="no"
+#IPADDR="192.168.1.1"
+#NETMASK="255.255.255.0"
+#GATEWAY="192.168.1.254"
+#PROBE="no"
+
+###########################################################
+## The script
+
+PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
+start()
+{
+if [ "$DHCP" = "yes" ]; then
+   ## DYNAMIC IP
+   echo "Starting network ${DEVICE} using a DHCP server..."
+   ## increase DELAY if using wireless
+   if [ -x /etc/rc.d/rc.wireless ]; then
+      DELAY=20
+   else
+      DELAY=10
+   fi
+   ## use HOSTNAME if available
+   NETNAME=`cat /etc/HOSTNAME 2>/dev/null`
+   if [ "$NETNAME" ]; then
+     dhcpcd -t $DELAY -h ${NETNAME} -d $DEVICE
+   else
+     dhcpcd -t $DELAY -d $DEVICE
+   fi
+   if [ $? != 0 ]; then
+      echo "FAILED"
+      return 1
+   fi
+   # show the status
+   ifconfig $DEVICE
+   return $?
+else
+   ## STATIC
+   # Test IPADDR, if invalid, skip
+   IPMASK=`ipmask $NETMASK $IPADDR`
+   if [ ! $? = 0 ]; then
+     echo "Invalid IP/NETMASK = $IPADDR/$NETMASK"
+     return 1
+   fi     
+   BROADCAST=`echo $IPMASK | cut -d " " -f 1`
+   NETWORK=`echo $IPMASK | cut -d " " -f 2`
+ 
+   # Going up ..
+   echo "Starting network ${DEVICE} as ${IPADDR}/${NETMASK}..."
+   ifconfig ${DEVICE} ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
+   if [ $? != 0 ]; then
+      return 1
+   fi
+   
+   # if PROBE is defined, try the gateway 3 times
+   if [ "$GATEWAY" ]; then
+     if [ "$PROBE" = "yes" ]; then
+        echo "Probing the gateway $GATEWAY "
+        for ii in 1 2 3; do
+          sleep 1
+          ping -c 1 -w $ii $GATEWAY > /dev/null
+    	  if [ $? = 0 ]; then
+            break;
+          fi
+          if [ $ii = 3 ]; then
+            echo " FAILED !!!"
+	    echo Canceling network $DEVICE ...
+	    ifconfig $DEVICE down
+	    return 1	
+	  fi
+        done
+     fi
+
+     # set the default gateway if it is not defined yet
+     route | grep -e "^default" &> /dev/null
+     if [ $? != 0 ]; then
+       echo "Setting up gateway $GATEWAY ..."
+       route add default gw ${GATEWAY} netmask 0.0.0.0 $DEVICE
+     fi
+  fi
+  return 0
+fi
+
+}
+
+stop() {
+   # stop the default gateway if it is ours
+   current_gw=`route -n | grep -e "^0.0.0.0" | cut -f 2 -d ' '`
+   if [ "$current_gw" = "$GATEWAY" ]; then
+      echo "Deleting gateway $GATEWAY..."
+      route del default
+   fi
+   # stop the interface
+   echo "Stopping network $DEVICE ..."
+   if [ "$DHCP" = "yes" ]; then
+     dhcpcd -k $DEVICE
+   else
+     ifconfig $DEVICE down 
+   fi
+}
+
+status() {
+   ifconfig $DEVICE
+}
+
+case $1 in
+start)
+   start
+   ;;
+stop)
+   stop
+   ;;
+restart)
+   $0 stop
+   sleep 1
+   $0 start
+   ;;
+reload)
+   ;;
+status)
+   status 
+   ;;
+*)
+   echo "Usage: $0 {start|stop|restart|reload|status}"
+esac
+

File etc/rc.d/functions-service

+#!/bin/sh
+# The daemons description
+#
+# GNU-GPL (c) Eko M. Budi, 2004
+#         (c) Vector Linux, 2004
+
+# return default run_level (2 - 5) and order for known daemons.
+# The recomendation :
+#   00-09 = reserved
+#   10-19 = hardware (pcmcia,hotplug,...)
+#   20-29 = networking (network,firewall,portmap,...)
+#   30-39 = network client (netfs, cups, ...)
+#   40-49 = local services (log, cron, ...)
+#   50-69 = intranet servers (nfs, smb, ...)
+#   70-89 = internet servers (inet, http, ...)
+#   90-99 = additional services (at, gpm, ...)
+#
+# Note that this scheme lists full services.
+# However, Vector Linux decides to move fundamental services to rc.M
+# including: hardware, networking, and some network clients (netfs).
+# The reasons are for speed and stability.
+#
+
+service_order()
+{
+case $1 in
+  ## Lets start the syslog first
+  syslog|log)
+    echo 2345 10
+    ;;
+  pcmcia)
+    echo 2345 11
+    ;;
+  hotplug|usb)
+    echo 2345 12
+    ;;
+  kudzu)
+    echo 2345 13;
+    ;;
+  alsasound|alsa)
+    echo 2345 14
+    ;;
+  apm|apmd|acpid)
+    echo 2345 18
+    ;;
+  # Start networking ...
+  # for paranoid admins to close the doors before changing their clothes ;)
+  paranoid|paranoid_firewall)
+    echo 2345 20
+    ;;
+  network)
+    echo 2345 21
+    ;;
+  umlnet|wlan|pppd)
+    echo 2345 22
+    ;;
+  # firewall that opens the things
+  firewall*|portsentry|gshield)
+    echo 2345 23
+    ;;
+  dhcpd)
+    echo 2345 24
+    ;;
+  bind|named|dnsmasq)
+    echo 2345 25
+    ;;
+  ## Start client networking ...
+  rpc|portmap)
+    echo 2345 30
+    ;;
+  ypbind)
+    echo 2345 31
+    ;;
+  netfs)
+    echo 2345 32
+    ;;
+  lisa)
+    echo 45 33
+    ;;
+  printer|lpd|lp|cups)
+    echo 2345 39
+    ;;
+  hplip)
+    echo 2345 35
+    ;;    
+  ## Local daemons
+  cron)
+    echo 2345 40
+    ;;
+  at)
+    echo 2345 41
+    ;;
+  quota)
+    echo 2345 42
+    ;;
+  acc|accounting)
+    echo 2345 43
+    ;;
+  ## Now turn on INTRANET server daemons
+  inetd|inet|xinetd|xinet)
+    echo 2345 50
+    ;;
+  sshd|ssh|openssh)
+    echo 2345 51
+    ;;
+  nisd|nis|yp)
+    echo 35 52
+    ;;
+  nfsd)
+    echo 35 53
+    ;;
+  samba|smbd|nmbd)
+    echo 2345 54
+    ;;
+  database|mysql|postgress)
+    echo 2345 55
+    ;;
+  xfstt)
+    echo 35 69
+    ;;
+  ## INTERNET server daemons can up now ...
+  ftpd|proftp|proftpd)
+    echo 35 71
+    ;;
+  smptd|sendmail|postfix|qmail)
+    echo 35 72
+    ;;
+  imap|imapd)
+    echo 35 73
+    ;;
+  nntp|nntpd)
+    echo 35 74
+    ;;
+  identd|oidentd|midentd)
+    echo 35 79
+    ;;
+  httpd|apache)
+    echo 35 80
+    ;;
+  lampp|xampp)
+    echo 35 80
+    ;;
+  jboss)
+    echo 35 87
+    ;;
+  jsp|tomcat|jetty)
+    echo 35 88
+    ;;
+  ## additional local jobs
+  gpm)
+    echo 2345 91
+    ;;
+  *) # find_next_order()
+    ii=99
+    while [ $ii -gt 50 ]; do
+	if [ -f $1/S${ii}* ]; then
+	    let ii=$ii+1
+	    break
+	fi
+	let ii=$ii-1
+    done
+    echo 2345 $ii
+    ;;
+  esac
+}
+
+# return daemon description
+service_desc()
+{
+case $1 in
+apm|apmd)
+  echo "Advanced Power Management"
+  ;;
+acpid)
+  echo "Advanced Config & Power Interface"
+  ;;
+alsa|alsasound)
+  echo "Advanced Linux Sound system"
+  ;;
+syslog|log) 
+  echo "system and kernel loggers"
+  ;;
+at)
+  echo "exact time tasks scheduler"
+  ;;
+cron)
+  echo "periodic tasks scheduler"
+  ;;
+portmap)
+  echo "network portmap, needed by NIS and NFS." 
+  ;;
+gpm)
+  echo "console mouse daemon"
+  ;;
+lp|lpd)
+  echo "classic Linux printing system"
+  ;;
+inetd|inet|xinet|xinetd)
+  echo "internet service super server"
+  ;;
+dhcp|dhcpd)
+  echo "DHCP server"
+  ;;
+cups)
+  echo "Common Unix Printer Service"
+  ;;
+ssh|sshd) 
+  echo "Secure shell daemon"
+  ;;
+lampp|xampp) 
+  echo "Combo Apache+MySQL+PHP+Postfix"
+  ;;
+portsentry|gshield)  
+  echo "Protect network ports from outside attack"
+  ;;
+xfstt)
+  echo "TrueType font server for X. Not needed for XFree 4."
+  ;;
+apache|http|httpd|monkey|nanoweb)
+  echo "HTTP web server"
+  ;;
+mysql|postgresql)
+  echo "SQL database server"
+  ;;
+nisd|nis|ypserv|yp)
+  echo "Server of Network Information Services"
+  ;;
+yp|ypbind)
+  echo "Client for Network Information Service"
+  ;;
+netfs)
+  echo "Mount remote NFS/SAMBA directories"
+  ;; 
+nfs|nfsd)
+  echo "Network File Server"
+  ;;
+lisa)
+  echo "LAN Information Server"
+  ;;
+postfix|qmail|sendmail)
+  echo "mail server daemon"
+  ;;
+squid|tinyproxy)
+  echo "HTTP/FTP proxy server"
+  ;;
+dnsmasq)
+  echo "Light DNS and DHCP server"
+  ;;
+named|bind)
+  echo "BIND Domain Name Server"
+  ;;
+quota)
+  echo "Limit disk usage for users"
+  ;;
+network)
+  echo "Initialize TCP/IP networking"
+  ;;
+firewall)
+  echo "Filter and masquerade TCP/IP Networking"
+  ;;
+paranoid)
+  echo "Initial firewall"
+  ;;
+identd|oidentd|midentd)
+  echo "ident server for IRC (chatting)"
+  ;;
+*)
+  echo "$1 daemon"
+esac
+}

File etc/rc.d/init.d/bluetooth

+#!/bin/sh
+#
+# Start/stop the Bluetooth daemons
+#
+# This version has been modified by SukkoPera, taking inspiration from then
+# Debian init script, to add support for register-passkeys.  Modified by
+# Patrick Volkerding to add "restart" support, and cleaned up a tiny bit.
+
+set -e
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC="Bluetooth subsystem"
+
+# The register-passkeys script was originally written by Debian:
+REGISTER_PASSKEYS=/usr/lib/bluetooth/register-passkeys
+
+HCID_NAME=hcid
+SDPD_NAME=sdpd
+HIDD_NAME=hidd
+HID2HCI_NAME=hid2hci
+RFCOMM_NAME=rfcomm
+PAND_NAME=pand
+DUND_NAME=dund
+
+HCID_EXEC="`which $HCID_NAME || true`"
+SDPD_EXEC="`which $SDPD_NAME || true`"
+HIDD_EXEC="`which $HIDD_NAME || true`"
+HID2HCI_EXEC="`which $HID2HCI_NAME || true`"
+RFCOMM_EXEC="`which $RFCOMM_NAME || true`"
+PAND_EXEC="`which $PAND_NAME || true`"
+DUND_EXEC="`which $DUND_NAME || true`"
+
+HCID_ENABLE=true
+SDPD_ENABLE=true
+HIDD_ENABLE=false
+HID2HCI_ENABLE=false
+RFCOMM_ENABLE=true
+DUND_ENABLE=false
+PAND_ENABLE=false
+
+HCID_CONFIG="/etc/bluetooth/hcid.conf"
+RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"
+
+HIDD_OPTIONS=""
+DUND_OPTIONS=""
+PAND_OPTIONS=""
+
+[ -e /etc/rc.d/rc.bluetooth.conf ] && . /etc/rc.d/rc.bluetooth.conf
+
+bluetooth_start() {
+        echo -n "Starting $DESC: "
+        if $HCID_ENABLE && [ -x "$HCID_EXEC" -a -f "$HCID_CONFIG" ] ; then
+                $HCID_EXEC -f $HCID_CONFIG
+                echo -n " $HCID_NAME"
+        fi
+        if $SDPD_ENABLE && [ -x "$SDPD_EXEC" ] ; then
+                $SDPD_EXEC
+                echo -n " $SDPD_NAME"
+        fi
+        if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then
+                $HIDD_EXEC $HIDD_OPTIONS --server || true
+                echo -n " $HIDD_NAME"
+        fi
+        if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then
+                $HID2HCI_EXEC --tohci > /dev/null 2>&1 || true
+                echo -n " $HID2HCI_NAME"
+        fi
+        if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" ] ; then
+                $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true
+                echo -n " $RFCOMM_NAME"
+        fi
+        if $DUND_ENABLE && [ -x "$DUND_EXEC" -a -n "$DUND_OPTIONS" ] ; then
+                $DUND_EXEC $DUND_OPTIONS
+                echo -n " $DUND_NAME"
+        fi
+        if $PAND_ENABLE && [ -x "$PAND_EXEC" -a -n "$PAND_OPTIONS" ] ; then
+                $PAND_EXEC $PAND_OPTIONS
+                echo -n " $PAND_NAME"
+        fi
+        if [ -x $REGISTER_PASSKEYS ]; then
+                $REGISTER_PASSKEYS
+                echo -n " passkeys"
+        fi
+        echo "."
+}
+
+bluetooth_stop() {
+        echo -n "Stopping $DESC: "
+        killall $PAND_NAME > /dev/null 2>&1 || true
+        echo -n " $PAND_NAME"
+        killall $DUND_NAME > /dev/null 2>&1 || true
+        echo -n " $DUND_NAME"
+        if [ -x "$RFCOMM_EXEC" ] ; then
+                $RFCOMM_EXEC release all > /dev/null 2>&1 || true
+                echo -n " $RFCOMM_NAME"
+        fi
+        killall $HIDD_NAME > /dev/null 2>&1 || true
+        echo -n " $HIDD_NAME"
+        killall $SDPD_NAME > /dev/null 2>&1 || true
+        echo -n " $SDPD_NAME"
+        killall $HCID_NAME > /dev/null 2>&1 || true
+        echo -n " $HCID_NAME"
+        echo "."
+}
+
+case "$1" in
+  start)
+        bluetooth_start
+	;;
+  stop)
+        bluetooth_stop
+	;;
+  restart)
+        bluetooth_stop
+        sleep 1
+        bluetooth_start
+        ;;
+  *)
+	echo "Usage: $0 start|stop|restart" >&2
+	exit 1
+	;;
+esac
+
+exit 0

File etc/rc.d/init.d/cron

+#!/bin/sh
+# description: runs jobs periodically
+#
+# (c) 2004, Eko M. Budi, for Vector Linux
+# Released under GNU GPL
+
+# Include the functions declared in the /etc/rc.d/functions file
+source /etc/rc.d/functions
+
+# path to binary
+ROOT="/usr/sbin"
+# name of binary to run
+APP="crond"
+#runtime options
+OPT=""
+#server name
+SERVER="Cron daemon"
+
+case "$1" in
+        start)
+                echon "Starting $SERVER..............."
+                loadproc $ROOT/$APP $OPT
+                ;;
+
+        stop)
+                echon "Stopping $SERVER.............."
+                killproc $ROOT/$APP
+                ;;
+
+        reload)
+                echon "Reloading $SERVER............"
+                reloadproc $ROOT/$APP
+                ;;
+
+        restart)
+                $0 stop
+                /bin/sleep 1
+                $0 start
+                ;;
+
+        status)
+                statusproc $APP
+                ;;
+
+        *)
+                echo "Usage: $0 {start|stop|reload|restart|status}"
+                exit 1
+        ;;
+
+esac
+
+# End /etc/init.d/

File etc/rc.d/init.d/cups

+#!/bin/sh
+#
+# "$Id: cups.sh.in 6649 2007-07-11 21:46:42Z mike $"
+#
+#   Startup/shutdown script for the Common UNIX Printing System (CUPS).
+#
+#   Copyright 2007 by Apple Inc.
+#   Copyright 1997-2007 by Easy Software Products, all rights reserved.
+#
+#   These coded instructions, statements, and computer programs are the
+#   property of Apple Inc. and are protected by Federal copyright
+#   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+#   which should have been included with this file.  If this file is
+#   file is missing or damaged, see the license at "http://www.cups.org/".
+#
+
+#### OS-Dependent Information
+
+#
+#   Linux chkconfig stuff:
+#
+#   chkconfig: 235 99 00
+#   description: Startup/shutdown script for the Common UNIX \
+#                Printing System (CUPS).
+#
+
+#
+#   NetBSD 1.5+ rcorder script lines.  The format of the following two
+#   lines is very strict -- please don't add additional spaces!
+#
+# PROVIDE: cups
+# REQUIRE: DAEMON
+#
+
+
+#### OS-Dependent Configuration
+
+case "`uname`" in
+	IRIX*)
+		IS_ON=/sbin/chkconfig
+
+		if $IS_ON verbose; then
+			ECHO=echo
+		else
+			ECHO=:
+		fi
+		ECHO_OK=:
+		ECHO_ERROR=:
+		;;
+
+	*BSD*)
+        	IS_ON=:
+		ECHO=echo
+		ECHO_OK=:
+		ECHO_ERROR=:
+		;;
+
+	Darwin*)
+		. /etc/rc.common
+
+		if test "${CUPS:=-YES-}" = "-NO-"; then
+			exit 0
+		fi
+
+        	IS_ON=:
+		ECHO=ConsoleMessage
+		ECHO_OK=:
+		ECHO_ERROR=:
+		;;
+
+	Linux*)
+		IS_ON=/bin/true
+		if test -f /etc/init.d/functions; then
+			. /etc/init.d/functions
+			ECHO=echo
+			ECHO_OK="echo_success"
+			ECHO_ERROR="echo_failure"
+		else
+			ECHO=echo
+			ECHO_OK=:
+			ECHO_ERROR=:
+		fi
+		;;
+
+	*)
+		IS_ON=/bin/true
+		ECHO=echo
+		ECHO_OK=:
+		ECHO_ERROR=:
+		;;
+esac
+
+#### OS-Independent Stuff
+
+#
+# Set the timezone, if possible...  This allows the scheduler and
+# all child processes to know the local timezone when reporting
+# dates and times to the user.  If no timezone information is
+# found, then Greenwich Mean Time (GMT) will probably be used.
+#
+
+for file in /etc/TIMEZONE /etc/rc.config /etc/sysconfig/clock; do
+	if test -f $file; then
+	        . $file
+	fi
+done
+
+if test "x$ZONE" != x; then
+	TZ="$ZONE"
+fi
+
+if test "x$TIMEZONE" != x; then
+	TZ="$TIMEZONE"
+fi
+
+if test "x$TZ" != x; then
+	export TZ
+fi
+
+#
+# Don't use TMPDIR environment variable from init script, as that can
+# cause cupsd to set TempDir to a user's temporary directory instead
+# of the default...
+#
+
+unset TMPDIR
+
+
+#
+# Make sure we have the standard program directories in the path
+# since some operating systems (this means YOU HP-UX!) don't
+# provide a standard path on boot-up...
+#
+
+if test "x$PATH" = x; then
+	PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+else
+	PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"
+fi
+
+export PATH
+
+#
+# See if the CUPS server (cupsd) is running...
+#
+
+case "`uname`" in
+	HP-UX* | AIX* | SINIX*)
+		pid=`ps -e | awk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
+		;;
+	IRIX* | SunOS*)
+		pid=`ps -e | nawk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
+		;;
+	UnixWare*)
+		pid=`ps -e | awk '{if (match($6, ".*/cupsd$") || $6 == "cupsd") print $1}'`
+		. /etc/TIMEZONE
+		;;
+	OSF1*)
+		pid=`ps -e | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
+		;;
+	Linux* | *BSD* | Darwin*)
+		pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
+		;;
+	*)
+		pid=""
+		;;
+esac
+
+#
+# Start or stop the CUPS server based upon the first argument to the script.
+#
+
+case $1 in
+	start | restart | reload)
+		if $IS_ON cups; then
+			if test "$pid" != ""; then
+				kill -HUP $pid
+			else
+				prefix=/
+				exec_prefix=/usr
+				/usr/sbin/cupsd
+				if test $? != 0; then
+					$ECHO_FAIL
+					$ECHO "cups: unable to $1 scheduler."
+					exit 1
+				fi
+			fi
+			$ECHO_OK
+			$ECHO "cups: ${1}ed scheduler."
+		fi
+		;;
+
+	stop)
+		if test "$pid" != ""; then
+			kill $pid
+			$ECHO_OK
+			$ECHO "cups: stopped scheduler."
+		fi
+		;;
+
+	status)
+		if test "$pid" != ""; then
+			echo "cups: scheduler is running."
+		else
+			echo "cups: scheduler is not running."
+		fi
+		;;
+
+	start_msg)
+		# HP-UX non-standard...
+		echo "Starting CUPS Server"
+		;;
+
+	stop_msg)
+		# HP-UX non-standard...
+		echo "Starting CUPS Server"
+		;;
+
+	*)
+		echo "Usage: cups {reload|restart|start|status|stop}"
+		exit 1
+		;;
+esac
+
+#
+# Exit with no errors.
+#
+
+exit 0
+
+
+#
+# End of "$Id: cups.sh.in 6649 2007-07-11 21:46:42Z mike $".
+#

File etc/rc.d/init.d/firewall

+#!/bin/sh
+# description: runs vleasytables firewall
+#
+# (c) 2004, Eko M. Budi, for Vector Linux
+# Released under GNU GPL
+
+# Include the functions declared in the /etc/rc.d/functions file
+source /etc/rc.d/functions
+
+# path to binary
+ROOT="/etc/rc.d/"
+# name of binary to run
+APP="rc.firewall"
+#runtime options
+OPT=""
+#server name
+SERVER="Firewall"
+
+case "$1" in
+        start)
+                echon "Starting $SERVER..............."
+                sh $ROOT/$APP $OPT start
+                ;;
+
+        stop)
+                echon "Stopping $SERVER.............."
+                sh $ROOT/$APP stop
+                ;;
+
+        reload)
+                echon "Reloading $SERVER............"
+                sh $ROOT/$APP restart
+                ;;
+
+        restart)
+                $0 stop
+                /bin/sleep 1
+                $0 start
+                ;;
+
+        status)
+                statusproc $APP
+                ;;
+
+        *)
+                echo "Usage: $0 {start|stop|reload|restart|status}"
+                exit 1
+        ;;
+
+esac
+
+# End /etc/init.d/

File etc/rc.d/init.d/fuse

+#! /bin/sh
+#
+# fuse		Init script for Filesystem in Userspace
+#
+# Author:	Miklos Szeredi <miklos@szeredi.hu>
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+SCRIPTNAME=/etc/init.d/fuse
+DESC="FUSE"
+MOUNTPOINT=/sys/fs/fuse/connections
+
+# Gracefully exit if the package has been removed.
+test -x `which fusermount` || exit 0
+
+error()
+{
+	echo "Error $1" >&2
+	exit 1
+}
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	if ! grep -qw fuse /proc/filesystems; then
+		modprobe fuse >/dev/null 2>&1 || error "loading fuse module"
+	fi
+	if grep -qw fusectl /proc/filesystems && \
+	   ! grep -qw $MOUNTPOINT /proc/mounts; then
+		mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 || \
+			error "mounting control filesystem"
+	fi
+	echo "done."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	if grep -qw $MOUNTPOINT /proc/mounts; then
+		umount $MOUNTPOINT >/dev/null 2>&1 || \
+			error "unmounting control filesystem"
+	fi
+	if grep -qw "^fuse" /proc/modules; then
+		rmmod fuse >/dev/null 2>&1 || error "unloading fuse module"
+	fi
+	echo "done."
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop}" >&2
+	exit 1
+	;;
+esac
+
+exit 0

File etc/rc.d/init.d/gpm

+#!/bin/sh
+# description: console mouse driver
+#
+# (c) 2004, Eko M. Budi, for Vector Linux
+# Released under GNU GPL
+
+#
+# Include the functions declared in the /etc/rc.d/functions file
+source /etc/rc.d/functions
+
+# path to binary
+ROOT="/usr/sbin"
+# name of binary to run
+APP="gpm"
+#device
+DEV="-m /dev/mouse"
+#runtime options
+# Use normal mouse
+OPT="-t ps2"
+# Use wheel mouse
+#OPT="-t imps2"
+
+#server name & description
+SERVER="Console mouse daemon"
+
+case "$1" in
+        start)
+                echon "Starting $SERVER............"
+                loadproc $ROOT/$APP $DEV $OPT
+                ;;
+        reload)
+                echon "Reloading $SERVER..........."
+                checkloadproc $ROOT/$APP $DEV $OPT
+                ;;
+        stop)
+                echon "Stopping $SERVER............"
+                killproc $ROOT/$APP
+                ;;
+        restart)
+                $0 stop
+                /bin/sleep 1
+                $0 start
+                ;;
+        status)
+                statusproc $ROOT/$APP
+                ;;
+        *)
+                echo "Usage: $0 {start|stop|reload|restart|status}"
+                exit 1
+        ;;
+
+esac
+
+# End /etc/init.d/

File etc/rc.d/init.d/ifplugd

+#!/bin/bash
+# $Id: ifplugd.init.in 86 2004-01-26 15:34:24Z lennart $
+
+# This file is part of ifplugd.
+#
+# ifplugd is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# ifplugd is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with ifplugd; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+# ifplugd      Brings up/down network automatically
+#
+# chkconfig: 2345 11 89
+# description: Brings networks interfaces up and down automatically when \
+#              the cable is removed / inserted
+#
+# processname: /usr/sbin/ifplugd
+# config: /etc/ifplugd/ifplugd.conf
+
+### BEGIN INIT INFO
+# Provides:          ifplugd
+# Required-Start:    $network
+# X-UnitedLinux-Should-Start:
+# Required-Stop:     $network
+# X-UnitedLinux-Should-Stop: $
+# Default-Start:     3 5
+# Default-Stop:      0 1 2 6
+# Short-Description: ifplugd daemon
+# Description:       Start ifplugd
+### END INIT INFO
+
+CFG=/etc/ifplugd/ifplugd.conf
+
+IFPLUGD=/usr/sbin/ifplugd
+test -x $IFPLUGD || exit 0
+
+if [ `id -u` != "0" ] && [ "$1" = "start" -o "$1" = "stop" ] ; then
+  echo "You must be root to start, stop or restart ifplugd."
+  exit 1
+fi
+
+[ -f $CFG ] && . $CFG
+
+VERB="$1"
+shift
+
+[ "x$*" != "x" ] && INTERFACES="$*"
+
+[ "x$INTERFACES" = "xauto" ] && INTERFACES="`cat /proc/net/dev | awk '{ print $1 }' | egrep '^(eth|wlan)' | cut -d: -f1`"
+
+case "$VERB" in
+    start)
+        echo -n "Starting Network Interface Plugging Daemon:"
+        for IF in $INTERFACES ; do
+            A="`eval echo \$\{ARGS_${IF}\}`"
+            [ -z "$A" ] && A="$ARGS"
+            $IFPLUGD -i $IF $A
+            echo -n " $IF"
+        done
+        echo "."
+        ;;
+    stop)
+        echo -n "Stopping Network Interface Plugging Daemon:"
+        for IF in $INTERFACES ; do 
+            $IFPLUGD -k -i $IF
+            echo -n " $IF"
+        done
+        echo "."
+        ;;
+    status)
+        for IF in $INTERFACES ; do
+            $IFPLUGD -c -i $IF
+        done
+        ;;
+    suspend)
+        echo -n "Suspending Network Interface Plugging Daemon:"
+        for IF in $INTERFACES ; do
+            $IFPLUGD -S -i $IF
+            echo -n " $IF"
+        done
+        echo "."    
+        ;;
+    resume)
+        echo -n "Resuming Network Interface Plugging Daemon:"
+        for IF in $INTERFACES ; do
+            $IFPLUGD -R -i $IF
+            echo -n " $IF"
+        done
+        echo "."    
+        ;;
+    force-reload|restart)
+        $0 stop $INTERFACES
+        sleep 3
+        $0 start $INTERFACES
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart|force-reload|status|suspend|resume}"
+        exit 1
+esac
+
+exit 0

File etc/rc.d/init.d/inetd

+#!/bin/sh
+# description: internet super server
+
+# Include the functions declared in the /etc/rc.d/functions file
+source /etc/rc.d/functions
+
+# path to binary
+ROOT="/usr/sbin"
+# name of binary to run
+APP="inetd"
+#runtime options
+OPT=""
+#server name
+SERVER="Internet super server"
+
+case "$1" in
+        start)
+                echon "Starting $SERVER.........."
+                loadproc $ROOT/$APP $OPT
+                ;;
+
+        stop)
+                echon "Stopping $SERVER.........."
+                killproc $ROOT/$APP
+                ;;
+
+        reload)
+                echon "Reloading $SERVER........."
+                reloadproc $ROOT/$APP
+                ;;
+
+        restart)
+                $0 stop
+                /bin/sleep 1
+                $0 start
+                ;;
+
+        status)
+                statusproc $APP
+                ;;
+
+        *)
+                echo "Usage: $0 {start|stop|reload|restart|status}"
+                exit 1
+        ;;
+
+esac
+
+# End /etc/init.d/

File etc/rc.d/init.d/portmap

+#!/bin/sh
+#
+# Include the functions declared in the /etc/init.d/functions file
+#
+ROOT="/usr/sbin"
+source /etc/rc.d/functions
+
+case "$1" in
+        start)
+                echon "Starting rpc portmap......"
+                loadproc /sbin/rpc.portmap
+
+                echon "Starting rpc mountd......."
+                loadproc $ROOT/rpc.mountd
+		
+		echon "Starting rpc network filesystem daemon...."
+		loadproc $ROOT/rpc.nfsd
+                ;;
+
+        stop)
+                echon "Stopping rpc portmap......"
+                killproc rpc.portmap
+
+                echon "Stopping rpc mountd......."
+                killproc rpc.mountd
+		
+		echon "Stopping rpc network filesystem daemon...."
+		killproc rpc.nfsd
+	        ;;
+	reload)	
+		echon "Reloading rpc services ...."
+		evaluate_retval
+	        ;;
+
+        restart)
+                $0 stop
+                /bin/sleep 1
+                $0 start
+                ;;
+        status)
+                statusproc rpc.mountd
+                statusproc rpc.nfsd
+                ;;
+        *)
+                echo "Usage: $0 {start|stop|restart|reload|status}"
+                exit 1
+        ;;
+
+esac
+
+
+# End /etc/init.d/sysklogd

File etc/rc.d/init.d/samba

+#!/bin/sh
+# description: SAMBA daemon
+#
+# GNU GPL (c) Eko M. Budi, 2004
+#         (c) Vector Linux. 2004
+
+# Include the functions declared in the /etc/rc.d/functions file
+source /etc/rc.d/functions
+
+#server name & description
+SMBSERVER="SAMBA Network File/Printer sharing server"
+NMBSERVER="SAMBA Netbios name server"
+
+SMBD=/usr/sbin/smbd
+NMBD=/usr/sbin/nmbd
+
+case "$1" in
+        start)
+                echon "Starting $SMBSERVER....."
+                loadproc $SMBD -D
+                echon "Starting $NMBSERVER....."
+		loadproc $NMBD -D
+                ;;
+        stop)
+                echon "Stopping $NMBSERVER....."
+		killproc $NMBD 
+                echon "Stopping $SMBSERVER....."
+                killproc $SMBD 
+                ;;