summaryrefslogtreecommitdiff
path: root/user/cups/cupsd.initd
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:19 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:56 -0500
commitb1eb50599e4db7eb4501af75cbbfa22007081ea5 (patch)
treec94a34c882cc17adedd781e8c5f34349b2a62416 /user/cups/cupsd.initd
parentb9e85bbdcf38547ef2ca4e5c2a6e6293bbcd2752 (diff)
downloadpackages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.gz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.bz2
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.xz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.zip
The New Plan
all pkgs needed to bootstrap -> system others -> user
Diffstat (limited to 'user/cups/cupsd.initd')
-rw-r--r--user/cups/cupsd.initd44
1 files changed, 44 insertions, 0 deletions
diff --git a/user/cups/cupsd.initd b/user/cups/cupsd.initd
new file mode 100644
index 000000000..ff0998784
--- /dev/null
+++ b/user/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 $?
+}