diff options
author | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-02-18 09:08:45 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-02-18 09:13:42 +0700 |
commit | fb70acbb6420f3f1e57a23fa0768f0580f968f9c (patch) | |
tree | 5a183f5c328108586bf1f2ff2f7102d6385581f3 /system/webmin | |
parent | a4cd3b4dce4ac81f7109262805402b5bdd737764 (diff) |
system/webmin: Fix script.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/webmin')
-rw-r--r-- | system/webmin/doinst.sh | 3 | ||||
-rw-r--r-- | system/webmin/reload.new | 4 | ||||
-rw-r--r-- | system/webmin/restart-by-force-kill.new | 3 | ||||
-rw-r--r-- | system/webmin/restart.new | 3 | ||||
-rw-r--r-- | system/webmin/start.new | 10 | ||||
-rw-r--r-- | system/webmin/stop.new | 21 | ||||
-rw-r--r-- | system/webmin/webmin.SlackBuild | 5 |
7 files changed, 46 insertions, 3 deletions
diff --git a/system/webmin/doinst.sh b/system/webmin/doinst.sh index 74d778aaebea..9eb3f70183a3 100644 --- a/system/webmin/doinst.sh +++ b/system/webmin/doinst.sh @@ -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 - diff --git a/system/webmin/reload.new b/system/webmin/reload.new new file mode 100644 index 000000000000..a345c0c1ee58 --- /dev/null +++ b/system/webmin/reload.new @@ -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` diff --git a/system/webmin/restart-by-force-kill.new b/system/webmin/restart-by-force-kill.new new file mode 100644 index 000000000000..5aab610e96ea --- /dev/null +++ b/system/webmin/restart-by-force-kill.new @@ -0,0 +1,3 @@ +#!/bin/sh +/etc/webmin/stop --kill +/etc/webmin/start diff --git a/system/webmin/restart.new b/system/webmin/restart.new new file mode 100644 index 000000000000..f1511b017bae --- /dev/null +++ b/system/webmin/restart.new @@ -0,0 +1,3 @@ +#!/bin/sh +/etc/webmin/stop +/etc/webmin/start diff --git a/system/webmin/start.new b/system/webmin/start.new new file mode 100644 index 000000000000..72f55ae6a7e6 --- /dev/null +++ b/system/webmin/start.new @@ -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 diff --git a/system/webmin/stop.new b/system/webmin/stop.new new file mode 100644 index 000000000000..a540974bddec --- /dev/null +++ b/system/webmin/stop.new @@ -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 diff --git a/system/webmin/webmin.SlackBuild b/system/webmin/webmin.SlackBuild index 9eb5d149329d..68ab2e6eb5db 100644 --- a/system/webmin/webmin.SlackBuild +++ b/system/webmin/webmin.SlackBuild @@ -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 |