The service script generation of ./stop-init has been changed in setup.sh with the commit "Fail proof way of stopping Webmin server" on 04/23/2022. Because of this change, "./stop-init" does not work on Unix V systems such as Solaris 11.
The cause lies in line 698:
echo " ((ps axf | grep \"$wadir\/miniserv\.pl\" | awk '{print \"kill -9 -- -\" \$1}' | bash) || kill -9 -- - \$pid || kill -9 \$pid) 2>/dev/null" >>$config_dir/.stop-init
and 703:
echo " (ps axf | grep \"$wadir\/miniserv\.pl\" | awk '{print \"kill -9 -- -\" \$1}' | bash) 2>/dev/null" >> $config_dir/.stop-init
1.) "ps axf" is not understood by UNIX System V systems. A similar command for System V would be "ps -eo pid,cmd" to have the PID first. This would be necessary for the rest of the command line.
2.) Is the double parenthesis on line 698 really necessary? It causes the following error on Solaris 11 systems:
Stop the webmin server in /usr/local/webmin-2.013
/usr/local/etc/webmin/stop: line 8: syntax error on line 19: `'' unmatched
Additional remark: the script "webmin/setup.sh" is defined in the first line with "#!/bin/sh". Why is "bash" then used in the two lines concerned?
BTW: Apart from this scripting problem: excellent software!!
@iliajie I think you made these changes recently. Can you take a look and see how we can make sure to only depend on /bin/sh , and not assume that the ps command is from Linux?
That shouldn't matter as I meant to try force kill commands one by one. I see the bug here. It will be fixed it on the next release.
That is odd, but okay, I removed it.
This is the stop script which will be generated on the new Webmin releases.You could replace Webmin installation directory (i.e.
/usr/share/webmin) and give it a try now to make sure it works:Feedback: Version 2.020 fixes this bug on Solaris 11. Thanks!
Good to hear! Thanks for your feedback!