What's new

Question: failed to start openvpn server at bootup

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

DonnyJohnny

Very Senior Member
The issue with my problem here is my openvpn server failed to start. Likely due to ddns update not ready. In my additional config for openvpn server, I have use “local myddnsip” and if ddns is not ready, openvpn server will fail to start.

I want to delay the execution of openvpn server to allow ddns to be complete first.

I want to know if I put sleep in one of the script, will it also affect the delay of executing other scripts and system booting process?
Example, router is executing A,a,B,b,C,c,D,d,E,e. The small letter is the user scripts.
If I have a sleep delay at b, will it affect the delay of C,D,E? Meaning pushing the delay downward execution of CcDdEe.

If possible, which user scripts should I put the delay?
 
There is 2 way I can think about resolving it, but I don’t know how to do it...
1) delay the execution of openvpn server service at boot up.
2) a script to check for openvpn server is up at boot up, if not start again.

Anyone can assist?
 
I want to know if I put sleep in one of the script, will it also affect the delay of executing other scripts and system booting process?

No. With very few exceptions (such as pre-mount), all scripts are executed in parallel, without blocking the rest of the process. This is to reduce the chances of people accidentally locking themselves out of the router by a broken script.
 
I found this thread with a script I used in the past it works pretty good or did anyway..:p https://www.snbforums.com/threads/how-to-delay-vpn-start-at-boot.24635/
Thanks for the thread but my issue is due to ddns update (not ntp) not ready causing the server not able to start properly. This is due to the configuration I am using “local myddnsIP” in the openvpn configuration.

No. With very few exceptions (such as pre-mount), all scripts are executed in parallel, without blocking the rest of the process. This is to reduce the chances of people accidentally locking themselves out of the router by a broken script.
Since they running parallel, I have resolve the issue by putting a sleep 200 delay in init-start (execute once only during boot up?) and follow with a “service start_vpnserver1”
This will make it try to start the service after everything ready. If openvpn already started, the command do nothing. If the service is not started, it will start it.

Temporary this noob hack works. If people have cooler solution, let me know.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top