Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual

Page 274

Advertising
background image

KTD-S0057-I

Page 270 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide


#! /bin/sh

### BEGIN INIT INFO
# Provides:

serverd

# Required-Start:

$remote_fs

# Required-Stop:

$remote_fs

# Default-Start:

2 3 4 5

# Default-Stop:

0 1 6

# Short-Description: Provide routines for root access
# Description:

Provide routines for root access

### END INIT INFO

DAEMON=/usr/sbin/serverd

case "$1" in
start)

start-stop-daemon --start --quiet --exec $DAEMON

;;

stop)

start-stop-daemon --stop --quiet --exec $DAEMON

;;

restart|force-reload)

$0

stop

$0

start

;;

status)

;;

*)

echo "Usage: $N {start|stop|restart|force-reload|status}" >&2

exit

1

;;

esac

exit 0


and then copy this script into the directory

/etc/init.d

. You can start or stop the script manually with

sudo ./serv start

respectively

sudo ./serv stop

The use of the

rcconf

tool represents a very simple way to integrate the daemon into the boot process. If

you need more setting options the program

update-rc.d

is more suitable. By adopting this approach only

the client application has to be started manually. The rcconf tool can be obtained by

sudo apt-get install rcconf

Advertising
This manual is related to the following products: