Package: ircd-hybrid
Version: 1:7.2.2.dfsg.2-6
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch jaunty
(This bug was originally filed by Richard Kettlewell as
https://bugs.launchpad.net/ubuntu/+source/ircd-hybrid/+bug/337715.)
The next version of the Debian Policy Manual will include the following
requirement:
/var/run and /var/lock may be mounted as temporary filesystems, so the
init.d scripts must handle this correctly. This will typically amount
to creating any required subdirectories dynamically when the init.d
script is run, rather than including them in the package and relying
on dpkg to create them.
ircd-hybrid does not currently handle this correctly. Here's a patch to
make it do so.
* Create /var/run/ircd on start/restart rather than relying on the
directory shipped in the package, since /var/run may be a tmpfs
(LP: #337715).
Thanks,
--
Colin Watson [[email protected]]
diff -u ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.postinst.in ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.postinst.in
--- ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.postinst.in
+++ ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.postinst.in
@@ -33,7 +33,7 @@
# owned by irc. Or the initscript will get owned. If it's already this
# way, this operation makes no difference.
- chown irc:irc /var/run/ircd /var/log/ircd /etc/ircd-hybrid
+ chown irc:irc /var/log/ircd /etc/ircd-hybrid
chmod 770 /etc/ircd-hybrid
if [ "$RET" = "true" ]; then
diff -u ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.init ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.init
--- ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.init
+++ ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.init
@@ -36,6 +36,8 @@
if [ "$START" = "yes" ]
then
echo -n "Starting $DESC: $NAME"
+ mkdir -p -m 755 /var/run/ircd
+ chown irc:irc /var/run/ircd
start-stop-daemon --start --quiet \
-u irc -c irc --exec $DAEMON -- -pidfile /var/run/ircd/$NAME.pid \
> /dev/null
@@ -74,6 +76,8 @@
--exec $DAEMON -- -pidfile /var/run/ircd/$NAME.pid
sleep 1
fi
+ mkdir -p -m 755 /var/run/ircd
+ chown irc:irc /var/run/ircd
start-stop-daemon --start --quiet \
-u irc -c irc --exec $DAEMON -- -pidfile /var/run/ircd/$NAME.pid \
> /dev/null
diff -u ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.dirs ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.dirs
--- ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.dirs
+++ ircd-hybrid-7.2.2.dfsg.2/debian/ircd-hybrid.dirs
@@ -1,3 +1,2 @@
-var/run/ircd
var/log/ircd
usr/share/lintian/overrides
diff -u ircd-hybrid-7.2.2.dfsg.2/debian/rules ircd-hybrid-7.2.2.dfsg.2/debian/rules
--- ircd-hybrid-7.2.2.dfsg.2/debian/rules
+++ ircd-hybrid-7.2.2.dfsg.2/debian/rules
@@ -277,7 +277,7 @@
dh_fixperms -a
- chown irc:irc debian/ircd-hybrid/var/run/ircd debian/ircd-hybrid/var/log/ircd
+ chown irc:irc debian/ircd-hybrid/var/log/ircd
chown -R irc:irc $(I_ETC)
chmod -R 660 $(I_ETC)
ifdef USE_OPENSSL
@@ -285,7 +285,6 @@
cp debian/cert.cnf $(I_ETC)
endif
chmod ug+x $(I_ETC)
- chmod 755 debian/ircd-hybrid/var/run/ircd
chmod -x $(I_DOC)/examples/simple.conf
dh_installinit -a -n