system/webmin: Fix script.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Willy Sudiarto Raharjo 2023-02-18 09:08:45 +07:00
parent a4cd3b4dce
commit fb70acbb64
No known key found for this signature in database
GPG key ID: 3F617144D7238786
7 changed files with 46 additions and 3 deletions

View file

@ -22,6 +22,5 @@ preserve_perms() {
config $NEW
}
# Signal the startup script to do some post install configuration
# Signal the startup script to do some post install configuration
touch etc/webmin/FIRSTRUN

4
system/webmin/reload.new Normal file
View file

@ -0,0 +1,4 @@
#!/bin/sh
echo Reloading Webmin server in /usr/libexec/webmin
pidfile=`grep "^pidfile=" /etc/webmin/miniserv.conf | sed -e 's/pidfile=//g'`
kill -USR1 `cat $pidfile`

View file

@ -0,0 +1,3 @@
#!/bin/sh
/etc/webmin/stop --kill
/etc/webmin/start

View file

@ -0,0 +1,3 @@
#!/bin/sh
/etc/webmin/stop
/etc/webmin/start

10
system/webmin/start.new Normal file
View file

@ -0,0 +1,10 @@
#!/bin/sh
echo Starting Webmin server in /usr/libexec/webmin
trap '' 1
LANG=
export LANG
unset PERLIO
export PERLIO
PERLLIB=/usr/libexec/webmin
export PERLLIB
exec '/usr/libexec/webmin/miniserv.pl' $* /etc/webmin/miniserv.conf

21
system/webmin/stop.new Normal file
View file

@ -0,0 +1,21 @@
#!/bin/sh
if [ "$1" = "--kill" ]; then
echo Force stopping Webmin server in /usr/libexec/webmin
else
echo Stopping Webmin server in /usr/libexec/webmin
fi
pidfile=`grep "^pidfile=" /etc/webmin/miniserv.conf | sed -e 's/pidfile=//g'`
pid=`cat $pidfile 2>/dev/null`
if [ "$pid" != "" ]; then
kill $pid || exit 1
touch /var/log/webmin/stop-flag
if [ "$1" = "--kill" ]; then
sleep 1
((ps axf | grep "/usr/libexec/webmin\/miniserv\.pl" | awk '{print "kill -9 -- -" $1}' | bash) || kill -9 -- -$pid || kill -9 $pid) 2>/dev/null
fi
exit 0
else
if [ "$1" = "--kill" ]; then
(ps axf | grep "/usr/libexec/webmin\/miniserv\.pl" | awk '{print "kill -9 -- -" $1}' | bash) 2>/dev/null
fi
fi

View file

@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=webmin
VERSION=${VERSION:-2.013}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -138,6 +138,9 @@ if [ -e $PKG/etc ]; then
get_config_files $PKG/etc
fi
rm -f $PKG/etc/webmin/{reload.new,.reload-init,restart-by-force-kill.new,.restart-by-force-kill-init,restart.new,.restart-init,start.new,.start-init,stop.new,.stop-init}
install -m 0755 $CWD/*.new $PKG/etc/webmin
# Fix a few ownership issues
chown -R root:root $PKG/etc $PKG/var