cant stop openvpn service

MrNissenDK

Cadet
Joined
Nov 11, 2022
Messages
2
I have had a problem with OpenVPN not starting correctly after a reboot.
I'm now home and trying to fix it but instead, I made a fail and can't access the UI anymore and therefore not able to stop the change in the config

the line that made it impossible to connect to UI
Code:
 local 127.0.0.1


I have tried to change it manually through the shell in "/etc/openvpn/server/server.conf" but it will be overwritten by the panel on startup, and I can't seem to find the file it's stored in.
I have tried to stop the service without luck.

and have searched for a solution but haven't been able to find a thread or any other place that could help me.

now I try to write a thread to hopefully get the magical command or location of the config so I can get access to my panel again.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
If you have shell access, run midclt call service.stop "openvpn_server" to stop the OpenVPN server service.

The TrueNAS Python middleware generates /etc/openvpn/server/server.conf every boot using values in the SQL configuration database at /data/freenas-v1.db. As you've discovered, editing files does nothing, as edits don't affect the configuration database.

To get an idea of what fields are stored for OpenVPN server, run midclt call openvpn.server.config | jq. To update fields, run midclt call openvpn.server.update '{ "<field from config>": "<updated value>", "<other field from config>": "<updated value>" }'.
 

MrNissenDK

Cadet
Joined
Nov 11, 2022
Messages
2
If you have shell access, run midclt call service.stop "openvpn_server" to stop the OpenVPN server service.

The TrueNAS Python middleware generates /etc/openvpn/server/server.conf every boot using values in the SQL configuration database at /data/freenas-v1.db. As you've discovered, editing files does nothing, as edits don't affect the configuration database.

To get an idea of what fields are stored for OpenVPN server, run midclt call openvpn.server.config | jq. To update fields, run midclt call openvpn.server.update '{ "<field from config>": "<updated value>", "<other field from config>": "<updated value>" }'.
Thank you for the help Im now able to access the UI again
 
Top