summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/lsb/lsb/lsb_start_daemon
blob: de62c2344dcf99a8c180840e09cb4c547cc075a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

. /etc/init.d/functions

nice=
force=
pidfile=
user=
check=
RETVAL=
while [ "$1" != "${1##[-+]}" ]; do
	case $1 in
	     -f)
	     	force="--force"
		shift
		;;
	     -n)
	     	nice=$2
		shift 2
		;;
	     -p)
		pidfile="--pidfile $2"
		shift 2
		;;
	     -u)
	        user="--user $2"
		shift 2
		;;
	     -c)
	        check="--check $2"
		shift 2
		;;
	      *)     
 		echo "Unknown Option $1"
 		echo "Options are:"
 		echo "-f" 
		echo "-p {pidfile}"
		echo "-n [+/-nicelevel]"
		echo "-u {user}"
		echo "-c {base}"
	        exit 1;;	
	esac
done
LSB=LSB-1.1 daemon ${force:-} ${nice:-} ${pidfile:-} ${user:-} ${check:-} $*
exit $?