Hi All,
Just having a few issues creating a custom cron to restart the openvpn service on a defined schedule. Hopefully this will resolve an issue i am having with it consistently dropping and failing to reconnect ever 2-3 days. I have followed this topic https://forum.opnsense.org/index.php?topic=2263.0 to generate the below.
[stop]
command:/usr/local/sbin/pluginctl -s openvpn stop
parameters:
type:script
message:stop openvpn service
description:Stop openvpn
[start]
command:/usr/local/sbin/pluginctl -s openvpn start
parameters:
type:script
message:start openvpn service
description:Start openvpn
[restart]
command:/usr/local/sbin/pluginctl -s openvpn restart
parameters:
type:script
message:restart openvpn service
description:Restart openvpn
When I manually run /usr/local/sbin/pluginctl -s openvpn restart
the expected behavior of restarting the openvpn service occurs. however when I use configctl openvpn restart
to call the corresponding function in my conf file it returns "OK" but fails to restart the service.
Does anyone have any ideas on why this is occurring?
Hello,
Thanks for the code. I'm having exactly the same issue, and try to restart the openvpn service via custom cron job.
What I did till now is:
Created File actions_custom.conf under Path /usr/local/opnsense/service/conf/actions.d/
Pasted your Code but changed
type:script
to
type:script_output
configctl custom restart
Service `openvpn' has been restarted.
Via Command Line its working openvpn service can be stopped / started / restarted
But the Issues for me are still:
1 . When configctl custom restart via command line is executed, just the first openvpn client connection is restarted. But I have 2. connections. How to adapt the script to restart all openvpn Client connections?
2. Tried yet several times with Firewall Reboots, configd reload etc. to get the Custom Cron-Job working, but no success unfortunately... And i dont want to edit corntab File directly, as with the next System Update the modifications are gone...
Can anyone give me a hint here?
BR
Crissi
Still have frequent OpenVpn Client disconnects and the connection is not automatically restarted...
Manually diaqble and enable the connection works fine...