aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackbuilds.org>2021-07-16 00:24:41 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-07-17 09:50:24 +0700
commitb8a65d7cf79e92f2160a90697bd7168eead74998 (patch)
treeb946ebb2c51067df04ceb56567816c1e637bc7d6
parent2bd6efa3b4a967ed074a372776645846271b59be (diff)
network/elemental-ircd: Create piddir during init
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--network/elemental-ircd/elemental-ircd.SlackBuild2
-rw-r--r--network/elemental-ircd/rc.elemental-ircd12
2 files changed, 9 insertions, 5 deletions
diff --git a/network/elemental-ircd/elemental-ircd.SlackBuild b/network/elemental-ircd/elemental-ircd.SlackBuild
index 68bb43d55961a..c1f031480260c 100644
--- a/network/elemental-ircd/elemental-ircd.SlackBuild
+++ b/network/elemental-ircd/elemental-ircd.SlackBuild
@@ -90,7 +90,7 @@ CXXFLAGS="$SLKCFLAGS" \
--enable-ipv6 \
--enable-epoll \
--with-logdir="/var/log/$PRGNAM" \
- --with-rundir=/var/run
+ --with-rundir="/var/run/$PRGNAM"
make
make install DESTDIR=$PKG
diff --git a/network/elemental-ircd/rc.elemental-ircd b/network/elemental-ircd/rc.elemental-ircd
index 56726817936bb..25fa62013b687 100644
--- a/network/elemental-ircd/rc.elemental-ircd
+++ b/network/elemental-ircd/rc.elemental-ircd
@@ -3,12 +3,16 @@
# elemental-ircd startup script for Slackware
IRCD_USER="@IRCD_UNAME@"
-PIDFILE="/var/run/elemental-ircd/ircd.pid"
-PID=`cat $PIDFILE 2>/dev/null`
+
+# Don't edit PIDFILE ; it's set in configure by --with-rundir
+PIDFILE=/var/run/elemental-ircd/ircd.pid
+PID=$(cat $PIDFILE 2>/dev/null)
ircd_start() {
echo "Starting elemental-ircd."
- su - $IRCD_USER -c "/usr/bin/ircd -pidfile $PIDFILE"
+ mkdir -p $(dirname $PIDFILE)
+ chown $IRCD_USER:$IRCD_GROUP $(dirname $PIDFILE)
+ su - $IRCD_USER -c /usr/bin/ircd
}
ircd_stop() {
@@ -23,7 +27,7 @@ ircd_reload() {
kill -HUP $PID
echo " done."
else
- echo "ircd doesn't seem to be running."
+ echo "elemental-ircd doesn't seem to be running."
exit 1
fi
}