diff --git a/system/webmin/doinst.sh b/system/webmin/doinst.sh index 74d778aaeb..9eb3f70183 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 0000000000..a345c0c1ee --- /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 0000000000..5aab610e96 --- /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 0000000000..f1511b017b --- /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 0000000000..72f55ae6a7 --- /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 0000000000..a540974bdd --- /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 9eb5d14932..68ab2e6eb5 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