OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: TechHome on January 30, 2023, 09:32:19 PM

Title: [SOLVED] Some services (HAProxy & Wireguard) don't autostart
Post by: TechHome on January 30, 2023, 09:32:19 PM
Hello again,

I noticed that those two services won't autostart properly.

For example: At the dashboard, the Wireguard service is shown as running (green arrow). However it's not because there isn't a interface created and VPN->WireGuard->Status is blank.
After clicking on the white WireGuard restart symbol on the dashboard, it starts as expected.

Another example: HAProxy is not even shown as running on the dashboard. A click on the "run" symbol solves this.

It's really confusing me...
Title: Re: Some services (HAProxy & Wireguard) don't autostart
Post by: Patrick M. Hausen on January 30, 2023, 09:36:38 PM
Are your configurations depending on DNS up and working? I.e. do you use host names instead of IP addresses in WireGuard and/or HAproxy configuration?

That could be a cause and there is currently no fix other than to use IP addresses instead.
Title: Re: Some services (HAProxy & Wireguard) don't autostart
Post by: TechHome on January 30, 2023, 11:39:14 PM
Yeah. HAProxy depends on DNS. Even tough UnboundDNS on the same machine.
No, I use just IPs for Wireguard :c
Title: Re: Some services (HAProxy & Wireguard) don't autostart
Post by: Patrick M. Hausen on January 30, 2023, 11:49:35 PM
Yeah, but possibly the default route is not yet present, when WG tries to start. What's your Internet connection like?

There is a WG restart if inactive cronjob available, IIRC.
Title: Re: Some services (HAProxy & Wireguard) don't autostart
Post by: TechHome on January 31, 2023, 01:30:29 AM
It's cable internet, so there's a modem in front of the OPNsense box.
Hm I see. Is there a reason why there isn't a target like "wait until online" and then start services xyz.

Uhh, where could I find/enable that cronjob? I just see "Renew DNS for WireGuard on stale connections" here.
Title: Re: Some services (HAProxy & Wireguard) don't autostart
Post by: amichel on January 31, 2023, 07:43:52 AM
Hi,
I do have a similar issue that haproxy does not start as I am not using IP Addresses here.
I workarounded it by using monit to check for the service and let monit restart those. So it might take some minutes before haproxy starts but at the end the start is done automatically.
Title: Re: Some services (HAProxy & Wireguard) don't autostart
Post by: TechHome on January 31, 2023, 10:20:23 AM
I can't even see in the logs that WireGuard trys to start. I'll look into Monit and report back.
Title: Re: Some services (HAProxy & Wireguard) don't autostart
Post by: TechHome on January 31, 2023, 04:38:05 PM
Well Monit works great, except it didn't autostart too, and I found out why... I had a script in /usr/local/etc/rc.syshook.d/start/ which paused a lot of stuff...


I added a configd action for the script & all services came up as expected.


Thanks for the help!