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)

This commit is contained in:
Laurent Bigonville 2019-07-27 13:25:06 +02:00
parent b493284ac5
commit b11ef489f7
8 changed files with 26 additions and 24 deletions

4
debian/changelog vendored
View File

@ -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 <bigon@debian.org> Sat, 27 Jul 2019 13:06:35 +0200
-- Laurent Bigonville <bigon@debian.org> Sat, 27 Jul 2019 13:18:34 +0200
nut (2.7.4-8) unstable; urgency=medium

View File

@ -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} \

View File

@ -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

View File

@ -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} \

View File

@ -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

View File

@ -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)

6
debian/rules vendored
View File

@ -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

View File

@ -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', '''