summaryrefslogtreecommitdiffstats
path: root/cups/cups
blob: 81aae6992ef4d54bd2f7b92df9d077128c1faef2 (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
#!/bin/sh
# Begin $rc_base/init.d/cups

#$LastChangedBy: bdubbs $
#$Date: 2007/09/26 14:15:13 $
#$Id: cups,v 1.1 2007/09/26 14:15:13 install Exp $
# Start or stop the CUPS server based upon the first argument to the script.

. /etc/sysconfig/rc
. $rc_functions
newgroup=lp
newuser=lp
newid=9
getent group $newgroup > /dev/null || /usr/sbin/groupadd -g $newid $newgroup
getent passwd $newuser > /dev/null || /usr/sbin/useradd -g $newgroup \
-u $newid -d /dev/null -c "Print Service User" -s /bin/false -u $newid $newuser
case $1 in
	start)
		boot_mesg "Starting CUPS Printserver..."
		loadproc /usr/sbin/cupsd
		;;

	stop)
		boot_mesg "Stopping CUPS Printserver..."
		killproc /usr/sbin/cupsd
		;;

	reload)
		boot_mesg "Reloading CUPS Printserver..."
		reloadproc /usr/sbin/cupsd
		;;

	restart)
		$0 stop
		sleep 1
		$0 start
		;;

	status)
		statusproc /usr/sbin/cupsd
		;;

	*)
		echo "Usage: $0 {start|stop|reload|restart|status}"
		exit 1
		;;
esac

# End $rc_base/init.d/cups