0

I have just installed a CentOS 9 Stream VM. Next, I have installed Webmin on the VM (using the RPM method). All is good - until I reboot the VM then Webmin is not running...

It seems that webmin is not started as a service. It has installed the "old fashioned" webmin in /etc/init.d/

If I run /etc/webmin/start manually Webmin starts up correctly.

I have tried to find out if I should start a service in another way - but as far as I can find out it should also start the "old" init.d services...

Does anyone know how I should do this?

John Dalsgaard
  • 203
  • 3
  • 11
  • Did you check if it didn't also install a systemd unit? (`systemctl list-units -t service`). Most probably it only needs to get enabled. – Gerald Schneider Dec 06 '21 at 10:09
  • Hi Gerald, it didn't - and it also doesn't show up as a service in webmin.... – John Dalsgaard Dec 06 '21 at 10:13
  • Have you enabled start at boot time? you can refer to Webmin Configuration --> https://doxfer.webmin.com/Webmin/Webmin_Configuration – r3d May 06 '22 at 12:28

1 Answers1

0

I solved this by removing /etc/init.d/webmin and placing a file webmin.service in /usr/lib/systemd/system/.

webmin.service:

    [Unit]
    Description=Webmin Administration Tool
    After=network.target remote-fs.target nss-lookup.target
    ConditionFileNotEmpty=/etc/webmin/config
    ConditionFileNotEmpty=/etc/webmin/miniserv.conf

    [Service]
    RemainAfterExit=yes
    KillMode=mixed
    # Webmin is exiting with 1 on SIGTERM
    SuccessExitStatus=1
    ExecStart=/usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
    PIDFile=/var/run/webmin.pid
    Environment="PERLLIB=/usr/libexec/webmin" LANG=
    ExecReload=/bin/kill -USR1 $MAINPID

    [Install]
    WantedBy=multi-user.target 

webmin can then be enabled using systemctl:

    systemctl enable webmin
  • Whoa! Do not modify `/usr/lib/systemd`; instead, place new or replacing service unit file such as `webmin.service` into `/etc/systemd/system`. Putting things into /usr/lib/systemd will only get blown away at next package upgrade. – John Greene May 20 '22 at 09:17