From b11ef489f7826d31a23a87f354e8783b73a74318 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 27 Jul 2019 13:25:06 +0200 Subject: [PATCH] Move pidfiles from /var/run/nut to /run/nut, there is nothing else to do since /var/run is a symlink to /run for some times now (policy 3.9.3) --- debian/changelog | 4 +++- debian/nut-client.init | 4 ++-- debian/nut-client.postinst | 14 +++++++------- debian/nut-server.init | 4 ++-- debian/nut-server.postinst | 14 +++++++------- debian/nut-server.prerm | 2 +- debian/rules | 6 +++--- debian/tests/test-nut.py | 2 +- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index c3dd553..8cd74df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,8 +22,10 @@ nut (2.7.4-9) UNRELEASED; urgency=medium * debian/libnutclient0.symbols: Adjust the symbols due to C++ changes * debian/patches/0011-use-pkgconfig-module.patch: Use pkg-config module names instead of listing the libraries, to please lintian + * Move pidfiles from /var/run/nut to /run/nut, there is nothing else to do + since /var/run is a symlink to /run for some times now (policy 3.9.3) - -- Laurent Bigonville Sat, 27 Jul 2019 13:06:35 +0200 + -- Laurent Bigonville Sat, 27 Jul 2019 13:18:34 +0200 nut (2.7.4-8) unstable; urgency=medium diff --git a/debian/nut-client.init b/debian/nut-client.init index 15a9f75..88026b5 100755 --- a/debian/nut-client.init +++ b/debian/nut-client.init @@ -19,7 +19,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nut-client DESC="NUT - power device monitor and shutdown controller" CONFIG=/etc/nut/nut.conf -pid_dir=/var/run/nut +pid_dir=/run/nut upsmon_pid=${pid_dir}/upsmon.pid upsmon=/sbin/upsmon log=">/dev/null 2>/dev/null" @@ -50,7 +50,7 @@ if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then exit 0 fi -# Check if /var/run/nut exists and has the correct perms +# Check if /run/nut exists and has the correct perms check_var_directory() { [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ && chown root:nut ${pid_dir} \ diff --git a/debian/nut-client.postinst b/debian/nut-client.postinst index 5d68dae..65c99e3 100644 --- a/debian/nut-client.postinst +++ b/debian/nut-client.postinst @@ -43,15 +43,15 @@ case "$1" in done fi - # make sure that /var/run/nut exists and has the correct ownerships - if [ ! -d /var/run/nut ] ; then - mkdir -p /var/run/nut + # make sure that /run/nut exists and has the correct ownerships + if [ ! -d /run/nut ] ; then + mkdir -p /run/nut fi - if [ -d /var/run/nut ] ; then - chown root:nut /var/run/nut - chmod 770 /var/run/nut + if [ -d /run/nut ] ; then + chown root:nut /run/nut + chmod 770 /run/nut if which restorecon >/dev/null 2>&1; then - restorecon /var/run/nut + restorecon /run/nut fi fi diff --git a/debian/nut-server.init b/debian/nut-server.init index c539bd5..a222747 100644 --- a/debian/nut-server.init +++ b/debian/nut-server.init @@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nut-server DESC="NUT - power devices information server and drivers" CONFIG=/etc/nut/nut.conf -pid_dir=/var/run/nut +pid_dir=/run/nut upsd_pid=${pid_dir}/upsd.pid upsd=/sbin/upsd upsdrvctl=/sbin/upsdrvctl @@ -48,7 +48,7 @@ if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then exit 0 fi -# Check if /var/run/nut exists and has the correct perms +# Check if /run/nut exists and has the correct perms check_var_directory() { [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ && chown root:nut ${pid_dir} \ diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index c28f935..a153bca 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -45,15 +45,15 @@ case "$1" in done fi - # make sure that /var/run/nut exists and has the correct ownerships - if [ ! -d /var/run/nut ] ; then - mkdir -p /var/run/nut + # make sure that /run/nut exists and has the correct ownerships + if [ ! -d /run/nut ] ; then + mkdir -p /run/nut fi - if [ -d /var/run/nut ] ; then - chown root:nut /var/run/nut - chmod 770 /var/run/nut + if [ -d /run/nut ] ; then + chown root:nut /run/nut + chmod 770 /run/nut if which restorecon >/dev/null 2>&1; then - restorecon /var/run/nut + restorecon /run/nut fi fi diff --git a/debian/nut-server.prerm b/debian/nut-server.prerm index b68c6d8..2cb4d5a 100644 --- a/debian/nut-server.prerm +++ b/debian/nut-server.prerm @@ -21,7 +21,7 @@ case "$1" in [ -L /usr/doc/nut ] && rm -f /usr/doc/nut # do stop the daemon on remove invoke-rc.d nut stop && sleep 1 - [ -d /var/run/nut ] && rm -rf /var/run/nut/ + [ -d /run/nut ] && rm -rf /run/nut/ ;; upgrade) diff --git a/debian/rules b/debian/rules index 4da65a8..02144ba 100755 --- a/debian/rules +++ b/debian/rules @@ -28,12 +28,12 @@ DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-cgi \ --with-dev \ --enable-static \ - --with-statepath=/var/run/nut \ - --with-altpidpath=/var/run/nut \ + --with-statepath=/run/nut \ + --with-altpidpath=/run/nut \ --with-drvpath=/lib/nut \ --with-cgipath=/usr/lib/cgi-bin/nut \ --with-htmlpath=/usr/share/nut/www \ - --with-pidpath=/var/run/nut \ + --with-pidpath=/run/nut \ --datadir=/usr/share/nut \ --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ --with-user=nut --with-group=nut diff --git a/debian/tests/test-nut.py b/debian/tests/test-nut.py index c34256c..068caeb 100644 --- a/debian/tests/test-nut.py +++ b/debian/tests/test-nut.py @@ -99,7 +99,7 @@ class NutTestCommon(testlib.TestlibCase): and standard settings for local monitoring ''' self.tmpdir = "" - self.rundir = "/var/run/nut" + self.rundir = "/run/nut" testlib.cmd(['/bin/rm -f' + self.powerdownflag]) testlib.config_replace('/etc/nut/ups.conf', '''