1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-06-16 06:25:23 +00:00

Added systemd support for Debian package

This commit is contained in:
Kim Holviala 2016-11-13 14:51:06 +02:00
parent 72f95a844a
commit f85c0bf159
5 changed files with 11 additions and 4 deletions

1
debian/dirs vendored
View File

@ -2,3 +2,4 @@ usr/sbin
var/gopher
var/log/gophernicus
usr/lib/gophernicus/filters
lib/systemd/system

9
debian/postinst vendored
View File

@ -34,8 +34,13 @@ if [ "$1" = "configure" ]; then
sed -i -e "s|__PACKAGE__|$PACKAGE|g" $DEFAULT
sed -i -e "s|__LOGDIR__|$LOGDIR|g" $DEFAULT
if [ -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then
/usr/sbin/update-inetd --add "gopher\t\tstream\ttcp\tnowait\t$USER\t/usr/sbin/$BINARY\t$BINARY -h $HOSTNAME -l $LOGDIR/server.log -f /usr/lib/$PACKAGE/filters"
if [ -x /usr/bin/deb-systemd-helper -a -d /run/systemd/system ]; then
/usr/bin/deb-systemd-helper enable gophernicus.socket
/usr/bin/deb-systemd-invoke start gophernicus.socket
else
if [ -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then
/usr/sbin/update-inetd --add "gopher\t\tstream\ttcp\tnowait\t$USER\t/usr/sbin/$BINARY\t$BINARY -h $HOSTNAME -l $LOGDIR/server.log -f /usr/lib/$PACKAGE/filters"
fi
fi
fi

2
debian/postrm vendored
View File

@ -4,7 +4,7 @@ if [ "$1" = "purge" -a -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then
/usr/sbin/update-inetd --remove "#<off># gopher"
fi
if [ -d "/run/systemd/system" ]; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi

2
debian/prerm vendored
View File

@ -4,7 +4,7 @@ if [ -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then
/usr/sbin/update-inetd --disable gopher
fi
if [ -x "/usr/bin/deb-systemd-helper" ]; then
if [ -x /usr/bin/deb-systemd-helper ]; then
/usr/bin/deb-systemd-helper disable gophernicus.socket >/dev/null
fi

1
debian/rules vendored
View File

@ -44,6 +44,7 @@ install: build
ln -s /usr/share/doc/gophernicus/ $(DEST)/var/gopher/docs
ln -s /usr/bin/php5 $(DEST)/usr/lib/gophernicus/filters/php
cp $(CURDIR)/gophermap $(DEST)/usr/lib/gophernicus/
cp $(CURDIR)/gophernicus.socket $(CURDIR)/gophernicus@.service $(DEST)/lib/systemd/system/
# Build architecture-independent files here.
binary-indep: build install