diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-03-23 04:19:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-03-23 04:19:44 +0000 |
commit | c5283d322accc6097afec74eab24550829788bab (patch) | |
tree | b99ce668128d82a026eaa31461643f9173f9b77b /net-dns/dnsmasq/files | |
parent | 5510d9d7d1c93c2ea71a2bd6f0666168808d5dd6 (diff) |
gentoo resync : 23.03.2018
Diffstat (limited to 'net-dns/dnsmasq/files')
-rw-r--r-- | net-dns/dnsmasq/files/dnsmasq-init-dhcp-r3 (renamed from net-dns/dnsmasq/files/dnsmasq-init-dhcp-r1) | 12 | ||||
-rw-r--r-- | net-dns/dnsmasq/files/dnsmasq-init-r4 (renamed from net-dns/dnsmasq/files/dnsmasq-init-r2) | 14 | ||||
-rw-r--r-- | net-dns/dnsmasq/files/dnsmasq.logrotate | 8 |
3 files changed, 27 insertions, 7 deletions
diff --git a/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r1 b/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r3 index b62630f7140b..5a356b22b259 100644 --- a/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r1 +++ b/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r3 @@ -1,8 +1,8 @@ #!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -extra_started_commands="reload" +extra_started_commands="reload rotate" pidfile="/var/run/dnsmasq.pid" command="/usr/sbin/dnsmasq" @@ -24,6 +24,12 @@ start_pre() { reload() { ebegin "Reloading ${RC_SVCNAME}" - kill -HUP "$(cat "${pidfile}")" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} + +rotate() { + ebegin "Reopening ${RC_SVCNAME} log file" + start-stop-daemon --signal USR2 --pidfile "${pidfile}" eend $? } diff --git a/net-dns/dnsmasq/files/dnsmasq-init-r2 b/net-dns/dnsmasq/files/dnsmasq-init-r4 index ed487b9fd1bb..559cb1e89d47 100644 --- a/net-dns/dnsmasq/files/dnsmasq-init-r2 +++ b/net-dns/dnsmasq/files/dnsmasq-init-r4 @@ -1,8 +1,8 @@ #!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -extra_started_commands="reload" +extra_started_commands="reload rotate" pidfile="/var/run/dnsmasq.pid" command="/usr/sbin/dnsmasq" @@ -17,7 +17,13 @@ depend() { } reload() { - ebegin "Reloading ${SVCNAME}" - kill -HUP $(cat "${pidfile}") + ebegin "Reloading ${RC_SVCNAME}" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} + +rotate() { + ebegin "Reopening ${RC_SVCNAME} log file" + start-stop-daemon --signal USR2 --pidfile "${pidfile}" eend $? } diff --git a/net-dns/dnsmasq/files/dnsmasq.logrotate b/net-dns/dnsmasq/files/dnsmasq.logrotate new file mode 100644 index 000000000000..75372feef7be --- /dev/null +++ b/net-dns/dnsmasq/files/dnsmasq.logrotate @@ -0,0 +1,8 @@ +/var/log/dnsmasq.log { + create 640 dnsmasq root + notifempty + missingok + postrotate + test -r /var/run/dnsmasq.pid && kill -USR2 "$(head -n1 /var/run/dnsmasq.pid)" + endscript +} |