Score:0

Script to stop and start firewalld at boot

de flag

I have a ticketing system website connecting to a back-end database on my LAN through a Wireguard VPN tunnel. The front end web server is an Ubuntu 20.04.6 LTS VPS and if I reboot the server (which is not very often) the website will not connect to the back-end database until I manually stop and start firewalld. Once this is done, all works fine. A very odd problem...

My question is, what is best was to way to write a script which will stop and start firewalld when the Ubuntu VPS boots up? Thanks!

Jaromanda X avatar
ru flag
a cron job triggered `@reboot`? though, perhaps you've misconfigured firewalld
cn flag
The easiest way would be to go add `@reboot root sleep 30 /usr/bin/systemctl stop firewalld /usr/bin/systemctl start firewalld` to `/etc/crontab`. A better thing to do that will avoid this altogether is to find out what is going on with firewalld.
Ginnungagap avatar
gu flag
Yes this is clearly the wrong question, you need to figure out why it doesn't work on normal startup. I'm guessing you have filters that apply to the wireguard interface which doesn't yet exist.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.