aboutsummaryrefslogtreecommitdiffstats
path: root/main/cups
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-06-27 21:02:10 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-06-27 21:07:45 +0200
commit17183b65a8fd709b62a9b51524dd57a107111a09 (patch)
tree18a1b0e1fadff50d06d476b4eeca748c009fecc0 /main/cups
parentdb0a0d6a6a85307625cfa634d1785c659f252566 (diff)
downloadaports-17183b65a8fd709b62a9b51524dd57a107111a09.tar.bz2
aports-17183b65a8fd709b62a9b51524dd57a107111a09.tar.xz
main/cups: improve runscript
Diffstat (limited to 'main/cups')
-rw-r--r--main/cups/APKBUILD4
-rw-r--r--main/cups/cups.logrotate12
-rw-r--r--main/cups/cupsd.initd40
3 files changed, 40 insertions, 16 deletions
diff --git a/main/cups/APKBUILD b/main/cups/APKBUILD
index 9a676bd9f7..aa99f662df 100644
--- a/main/cups/APKBUILD
+++ b/main/cups/APKBUILD
@@ -122,7 +122,7 @@ _mv() {
}
sha512sums="0f3e2aa8e514dad056b4878b0657491d35796b62021092cd5dd480b67a8423fc0fdb822ccb4bc72a454c3ced20c160c8631d44c182c87a3993b882df904aaec7 cups-2.2.3-source.tar.gz
-162fe69ee46962f7ce07a9a2a75154682088895c4749c9bcfc54bb2aa861f48d7d1a8e3223f78a197319a3a405626ffe996615f6eb23168afcefabab343d5be0 cups.logrotate
-b5c6cec757457773904d47b06fb3a3d70c316e5abac7e35164261f9d98d7275140c6f14337a848eb4c15034d91e4c859af93865531f26bd97defe3ec21ca90a8 cupsd.initd
+cf64211da59e79285f99d437c02fdd7db462855fb2920ec9563ba47bd8a9e5cbd10555094940ceedeb41ac805c4f0ddb9147481470112a11a76220d0298aef79 cups.logrotate
+2c2683f755a220166b3a1653fdd1a6daa9718c8f0bbdff2e2d5e61d1133306260d63a83d3ff41619b5cf84c4913fae5822b79553e2822858f38fa3613f4c7082 cupsd.initd
7a8cd9ac33b0dd4627c72df4275db8ccd7cf8e201bce3833719b42f532f526bb347b842e3ea1ef0d61855b5c6e1088b5d20b68942f2c2c0acf504d8d9728efd3 cups-no-export-ssllibs.patch
98bb97f4af69ea286fc3d398b8e57c32440e6b2d49fb7f79b418a4fe7f13441f3a610f65d3433d10d971ade808233c0b29b4d66160623ccaae919179384be918 default-config-no-gssapi.patch"
diff --git a/main/cups/cups.logrotate b/main/cups/cups.logrotate
index 9c49bbdaff..a50b058a3c 100644
--- a/main/cups/cups.logrotate
+++ b/main/cups/cups.logrotate
@@ -1,8 +1,8 @@
/var/log/cups/*log {
- missingok
- notifempty
- delaycompress
- postrotate
- /bin/kill -HUP `cat /var/run/cups.pid 2>/dev/null` 2>/dev/null || true
- endscript
+ missingok
+ notifempty
+ delaycompress
+ postrotate
+ /etc/init.d/cupsd --quiet --ifstarted reload
+ endscript
}
diff --git a/main/cups/cupsd.initd b/main/cups/cupsd.initd
index 17ff3b1881..ff09987842 100644
--- a/main/cups/cupsd.initd
+++ b/main/cups/cupsd.initd
@@ -1,20 +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
- need dbus
before nfs
+ need dbus
after logger
}
-start() {
- ebegin "Starting cupsd"
- start-stop-daemon --start --quiet --exec /usr/sbin/cupsd
- eend $?
+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
}
-stop() {
- ebegin "Stopping cupsd"
- start-stop-daemon --stop --quiet --exec /usr/sbin/cupsd
+reload() {
+ ebegin "Reloading $name"
+ start-stop-daemon --signal HUP --pidfile "$pidfile"
eend $?
}