summaryrefslogtreecommitdiff
path: root/system/cups/cupsd.initd
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 22:04:15 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 22:04:15 -0600
commit17903174be7191424fd7f7b90303a00198b54623 (patch)
tree6cad8fdec5153ea6926eee35304900c19884b560 /system/cups/cupsd.initd
parent129370fc1900bc981d529ab7d4a82b6668c72183 (diff)
downloadpackages-17903174be7191424fd7f7b90303a00198b54623.tar.gz
packages-17903174be7191424fd7f7b90303a00198b54623.tar.bz2
packages-17903174be7191424fd7f7b90303a00198b54623.tar.xz
packages-17903174be7191424fd7f7b90303a00198b54623.zip
system/cups: disable Avahi, enable PAM
Diffstat (limited to 'system/cups/cupsd.initd')
-rw-r--r--system/cups/cupsd.initd44
1 files changed, 44 insertions, 0 deletions
diff --git a/system/cups/cupsd.initd b/system/cups/cupsd.initd
new file mode 100644
index 000000000..ff0998784
--- /dev/null
+++ b/system/cups/cupsd.initd
@@ -0,0 +1,44 @@
+#!/sbin/openrc-run
+
+name="CUPS"
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+description_checkconfig="Test the configuration file"
+description_reload="Reload"
+
+: ${cfgfile:="/etc/cups/cupsd.conf"}
+
+command="/usr/sbin/cupsd"
+command_args="-f -c $cfgfile"
+command_background="yes"
+
+pidfile="/run/cups/$RC_SVCNAME.pid"
+
+depend() {
+ use net
+ before nfs
+ need dbus
+ after logger
+}
+
+checkconfig() {
+ $command $command_args -t >/dev/null 2>&1 \
+ || $command $command_args -t
+}
+
+start_pre() {
+ checkconfig || return 1
+
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
+ checkpath -q -d -m 0755 -o root:lp /run/cups
+ checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
+}
+
+reload() {
+ ebegin "Reloading $name"
+ start-stop-daemon --signal HUP --pidfile "$pidfile"
+ eend $?
+}