View previous topic :: View next topic |
Author |
Message |
Cr0t l33t
Joined: 27 Apr 2002 Posts: 945 Location: USA
|
Posted: Sat Mar 07, 2020 2:19 pm Post subject: systemd starting my openvpn client |
|
|
I created a systemd vpn service. The service starts on bootup, but it fails to setup the default route "SIOCADDRT: Network is unreachable". "After" what service should my service start? Code: | [Unit]
Description=VPN
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
to always restart on exit:
Restart=always
RestartSec=5
User=root
ExecStart=/bin/bash /root/openvpn_vpn_random.sh
[Install]
WantedBy=multi-user.target |
_________________ cya |
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1859 Location: Germany
|
|
Back to top |
|
|
Cr0t l33t
Joined: 27 Apr 2002 Posts: 945 Location: USA
|
Posted: Fri Apr 03, 2020 5:52 pm Post subject: |
|
|
Code: | ExecStartPre=sleep 5 | That did the trick. _________________ cya |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23062
|
Posted: Sat Apr 04, 2020 12:55 am Post subject: |
|
|
What if someday the network takes 7 seconds to be ready? |
|
Back to top |
|
|
|