network/murmur: Create piddir during init

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Ruben Schuller 2021-07-16 22:28:57 -05:00 committed by Willy Sudiarto Raharjo
parent 1c76d01f2d
commit 08be912ab0
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
2 changed files with 11 additions and 7 deletions

View File

@ -114,7 +114,7 @@ mkdir -p \
$PKG/etc/{logrotate.d,rc.d} \
$PKG/usr/bin \
$PKG/usr/man/man1 \
$PKG/var/{lib,log,run}/$PRGNAM
$PKG/var/{lib,log}/$PRGNAM
install -m 644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
@ -128,20 +128,21 @@ sed \
-e "s,uname=.*,uname=$MURMUR_USER," \
scripts/murmur.ini.system > $PKG/etc/$PRGNAM.ini.new
sed \
-i "s,PIDFILE=.*,PIDFILE=/var/run/$PRGNAM/$PRGNAM.pid," \
$PKG/etc/rc.d/rc.$PRGNAM.new
sed \
-e "s,@LOGFILE@,/var/log/$PRGNAM/$PRGNAM.log," \
-e "s,@USER@,$MURMUR_USER,g" \
-e "s,@GROUP@,$MURMUR_GROUP,g" \
$CWD/$PRGNAM.logrotate > $PKG/etc/logrotate.d/$PRGNAM.new
sed \
-e "s,@USER@,$MURMUR_USER,g" \
-e "s,@GROUP@,$MURMUR_GROUP,g" \
$CWD/rc.murmur > $PKG/etc/logrotate.d/rc.murmur.new
chown root:$MURMUR_GROUP $PKG/etc/$PRGNAM.ini.new
chmod o-rwx $PKG/etc/murmur.ini.new
chown $MURMUR_USER:$MURMUR_GROUP $PKG/var/{lib,log,run}/$PRGNAM
chown $MURMUR_USER:$MURMUR_GROUP $PKG/var/{lib,log}/$PRGNAM
chmod o-rwx $PKG/var/lib/$PRGNAM
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \

View File

@ -1,9 +1,12 @@
#!/bin/bash
PIDFILE=""
PIDFILE=/var/run/murmur/murmur.pid
murmur_start() {
echo -n "Starting Murmur Server: "
mkdir -p $(dirname $PIDFILE)
chown @USER@:@GROUP@ $(dirname $PIDFILE)
if [ ! -f $PIDFILE ]; then
/usr/bin/murmurd -ini /etc/murmur.ini & > /dev/null 2>&1
echo "OK"