Webmin

Having issues with your DietPi installation or found a bug? Post it here.
Burgess85
Posts: 8
Joined: Sat Mar 20, 2021 5:03 pm

Webmin

Post by Burgess85 »

When I make any changes on webmin it doesn't restart webmin I have to restart the pi. I have reinstalled and still the same. Any ideas?
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Webmin

Post by MichaIng »

Why should Webmin restart? You can do that from console via systemctl restart webmin or does it have an internal service restart option that does not work?
Burgess85
Posts: 8
Joined: Sat Mar 20, 2021 5:03 pm

Re: Webmin

Post by Burgess85 »

It says connection has been lost and doesn't reconnect
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Webmin

Post by MichaIng »

You mean when you use the internal restart button? Waiting a bit longer and hitting F5 in the browser to reload the site doesn't help?

If so, please paste the output of the following console command:

Code: Select all

journalctl -u webmin
Burgess85
Posts: 8
Joined: Sat Mar 20, 2021 5:03 pm

Re: Webmin

Post by Burgess85 »

Make any settings change and click apply webmin should restart but it doesn't
Burgess85
Posts: 8
Joined: Sat Mar 20, 2021 5:03 pm

Re: Webmin

Post by Burgess85 »

Code: Select all

journalctl -u webmin
-- Logs begin at Sat 2021-03-20 16:05:21 GMT, end at Sat 2021-03-20 16:18:04 GMT. --
Mar 20 16:05:52 Burgess-Server systemd[1]: Starting Webmin (DietPi)...
Mar 20 16:05:52 Burgess-Server start[881]: Starting Webmin server in /usr/share/webmin
Mar 20 16:05:53 Burgess-Server perl[881]: pam_unix(webmin:auth): a
uthentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=root
Mar 20 16:05:55 Burgess-Server webmin[881]: Webmin starting
Mar 20 16:05:56 Burgess-Server systemd[1]: Started Webmin (DietPi).
Mar 20 16:16:16 Burgess-Server perl[912]: pam_unix(webmin:auth): a
uthentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=root
Mar 20 16:16:17 Burgess-Server webmin[912]: Webmin starting
Mar 20 16:16:18 Burgess-Server stop[1628]: Stopping Webmin server in /usr/share/webmin
Mar 20 16:16:18 Burgess-Server systemd[1]: webmin.service: Succeeded.
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Webmin

Post by MichaIng »

Indeed it stops. Hmm if the restart feature stops the main process and service type is simple (default) this actually makes sense as systemd sees the main process stopping and kills all related children automatically. Looks like a bug in Webmin to me, related on either a change in its systemd unit or its restart handler. In case should be reported here: https://github.com/webmin/webmin/issues
But I'm not able to replicate until next week.
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Webmin

Post by Joulinar »

Just for completeness, issue was reported by OT towards webmin https://github.com/webmin/webmin/issues/1463

BTW: I can replicate the behaviour. It seems the way how systemd service is working. If I call webmin directly (without systemd) using /etc/webmin/start, Webmin is going to be restarted correctly from GUI.

And now I have 2 instance running. First one is parent of 2nd one

Code: Select all

root@DietPi3:~# ps -ef |grep web
root      4388     1  0 23:07 ?        00:00:00 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
root      4421  4388  0 23:07 ?        00:00:00 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
But it's not the case all the time. Strange behaviour
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Webmin

Post by MichaIng »

And I forgot that we create that systemd unit. So a bug our side we need to fix. I'll have a look into this. A wrapper shell would be an easy solution but cause an additional process :?.
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Webmin

Post by Joulinar »

what about restart feature inside systemd??

It's not perfect but working

Code: Select all

[Unit]
Description=Webmin (DietPi)

StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
Restart=always
RestartSec=5s
Type=forking
ExecStart=/etc/webmin/start
ExecStop=/etc/webmin/stop

[Install]
WantedBy=multi-user.target

Code: Select all

root@DietPi3:~# journalctl -u webmin.service -f
-- Logs begin at Thu 2019-02-14 11:11:58 CET. --
Mar 20 23:42:15 DietPi3 systemd[1]: Starting Webmin (DietPi)...
Mar 20 23:42:15 DietPi3 start[429]: Starting Webmin server in /usr/share/webmin
Mar 20 23:42:16 DietPi3 perl[429]: pam_unix(webmin:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=root
Mar 20 23:42:18 DietPi3 webmin[429]: Webmin starting
Mar 20 23:42:20 DietPi3 systemd[1]: Started Webmin (DietPi).
Mar 20 23:44:00 DietPi3 perl[664]: pam_unix(webmin:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=root
Mar 20 23:44:02 DietPi3 webmin[664]: Webmin starting
Mar 20 23:44:03 DietPi3 stop[1225]: Stopping Webmin server in /usr/share/webmin
Mar 20 23:44:03 DietPi3 systemd[1]: webmin.service: Succeeded.
Mar 20 23:44:08 DietPi3 systemd[1]: webmin.service: Service RestartSec=5s expired, scheduling restart.
Mar 20 23:44:08 DietPi3 systemd[1]: webmin.service: Scheduled restart job, restart counter is at 1.
Mar 20 23:44:08 DietPi3 systemd[1]: Stopped Webmin (DietPi).
Mar 20 23:44:08 DietPi3 systemd[1]: Starting Webmin (DietPi)...
Mar 20 23:44:08 DietPi3 start[1231]: Starting Webmin server in /usr/share/webmin
Mar 20 23:44:08 DietPi3 perl[1231]: pam_unix(webmin:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=root
Mar 20 23:44:10 DietPi3 webmin[1231]: Webmin starting
Mar 20 23:44:11 DietPi3 systemd[1]: Started Webmin (DietPi).
Unfortunately Restart=always would need to be used as on-failure doesn't seems to be working
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply