summaryrefslogtreecommitdiff
path: root/support/dktools/initd-printqd.in
blob: be38047e14a28ddc32e6e0af2716de6de42903a4 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
:


# Standard directory variables from autoconf
prefix=@prefix@
datarootdir=@datarootdir@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libexecdir=@libexecdir@
datadir=${datarootdir}
sysconfdir=@sysconfdir@
scd=$(sysconfdir)
libdir=@libdir@
sharedlibdir=$(libdir)/shared
mandir=@mandir@
includedir=@includedir@
localstatedir=@localstatedir@

RUNDIR=${localstatedir}/run/printqd
LOGDIR=${localstatedir}/log/printqd
DBDIR=${localstatedir}/printqd
LPUSER=@LPUSER@
LPGROUP=@LPGROUP@

. ${sysconfdir}/rc.d/init.d/functions

start() {
	[ -d $RUNDIR ] || mkdir -p $RUNDIR
	[ -d $LOGDIR ] || mkdir -p $LOGDIR
	[ -d $DBDIR  ] || mkdir -p $DBDIR
	chown -R ${LPUSER}:${LPGROUP} $RUNDIR
	chown -R ${LPUSER}:${LPGROUP} $LOGDIR
	chown -R ${LPUSER}:${LPGROUP} $DBDIR
	chmod -R 770 $RUNDIR
	chmod -R 770 $LOGDIR
	chmod -R 770 $DBDIR
	${sbindir}/printqd
}

stop() {
	killproc printqd
}

case "$*" in
"start")
	start
;;
"stop")
	stop
;;
"restart")
	stop
	sleep 1
	start
	sleep 1
;;

esac