mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Fix to work-around if Webmin 1.994 is running outside of systemd
This commit is contained in:
21
setup.sh
21
setup.sh
@@ -676,10 +676,23 @@ echo "pidfile=\`grep \"^pidfile=\" $config_dir/miniserv.conf | sed -e 's/pidfile
|
||||
echo "kill -USR1 \`cat \$pidfile\`" >>$config_dir/.reload-init
|
||||
if [ -x "$systemctlcmd" ]; then
|
||||
current_version=`cat "$config_dir/version" 2>/dev/null`
|
||||
ancient_version=`echo $current_version 1.993 | awk '{if ($1 < $2) print 1; else print 0}'`
|
||||
if [ "$ancient_version" = "1" ];then
|
||||
echo "$config_dir/.stop-init" >>$config_dir/.reload-init
|
||||
echo "$config_dir/start" >>$config_dir/.reload-init
|
||||
if [ "$current_version" != "" ]; then
|
||||
ancient_version=`echo $current_version 1.994 | awk '{if ($1 < $2) print 1; else print 0}'`
|
||||
# If upgrading from ancient version
|
||||
if [ "$ancient_version" = "1" ]; then
|
||||
echo "$config_dir/.stop-init" >>$config_dir/.reload-init
|
||||
echo "$config_dir/start" >>$config_dir/.reload-init
|
||||
fi
|
||||
# If Webmin 1.994 is started outside of systemd, and
|
||||
# has no pid file (possible if upgraded from < 1.990)
|
||||
if [ "$current_version" = "1.994" ] && [ ! -f "$var_dir/miniserv.pid" ]; then
|
||||
echo "if [ ! -f \"\$pidfile\" ]; then" >>$config_dir/.reload-init
|
||||
# If started with systemd (with KillMode=none)
|
||||
echo " $config_dir/stop" >>$config_dir/.reload-init
|
||||
# Start service
|
||||
echo " $config_dir/start" >>$config_dir/.reload-init
|
||||
echo "fi" >>$config_dir/.reload-init
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# Pre install
|
||||
|
||||
Reference in New Issue
Block a user