Hi there,
I have 2 systems running Virtualmin. I use one as a Test server and another one as Prod.
On the Test server, under Webmin -> Boot and Shutdown, I have 2 UFW entries: ufw and ufw.service
However, on Prod, I had only 1 entry: UFW
Whenever Test Server reboots, UFW is automatically on, but this is not the case for Prod. So I thought I will write my own system services and created one called ufw.service, I copied the entry from the Test Server. I had a feeling that the details for the service were wrong, but nevertheless, I clicked OK. And it just disappeared. It did not give me any warning, error or success/failure message.
Just so you know, this is what I entered in “Commands to run on startup”
[Unit]
Description=Uncomplicated firewall
Documentation=man:ufw(8)
DefaultDependencies=no
Before=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/lib/ufw/ufw-init start quiet
ExecStop=/lib/ufw/ufw-init stop
[Install]
WantedBy=multi-user.target
I then went back to restart UFW service and since then I am getting an error message saying:
“Starting ufw (via systemctl): ufw.serviceFailed to start ufw.service: Unit ufw.service is not loaded properly: Exec format error.
See system logs and ‘systemctl status ufw.service’ for details.
failed!”
This is happening when I try to start the service Now or on Boot – via Webmin.
However, the good news is I rebooted the server and the UFW status was inactive but I was able to enable ufw without any issue.
I know what mistake I have done; I also know what entry I have made and I want to delete/undo that changes. But I don’t know where is that file saved for me to go there and revert the changes.
I am worried this will create a bigger issue for me sooner or later.
I tried looking for help on the internet and there are few posts but none of them is conclusive and there is nothing on the Virtualmin forum, so I am raising a new/fresh issue.
Can someone please let me know how do I correct this mistake and then we can discuss how to enable ufw to be enabled on boot.
Many Thanks,
Rav