Yichi Chen
Yichi Chen

Reputation: 1

using openvpn-reconnect but Options error: In [CMD-LINE]:1: Error opening configuration file

According to ArchWiki I added a systemctl service to send the SIGNUP message to the openvpn proccess to make it restart.

The problem is that this proccess is started correctly if using sudo systemctl start openvpn-client@chenyichi, but went wrong after using sudo /usr/bin/pkill --signal SIGHUP --exact openvpn.

The full log info comes here:

× [email protected] - OpenVPN tunnel for chenyichi
     Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Wed 2023-12-20 15:26:40 CST; 9min ago
   Duration: 1min 51.529s
       Docs: man:openvpn(8)
             https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
             https://community.openvpn.net/openvpn/wiki/HOWTO
    Process: 38264 ExecStart=/usr/bin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client/chenyichi.conf (code=exited, status=1/FAILURE)
   Main PID: 38264 (code=exited, status=1/FAILURE)
     Status: "Initialization Sequence Completed"
        CPU: 66ms

12月 20 15:26:40 trswnca-y7000p openvpn[38264]: net_route_v4_del: 192.168.1.0/24 via 10.8.0.93 dev [NULL] table 0 metric -1
12月 20 15:26:40 trswnca-y7000p openvpn[38264]: net_route_v4_del: 172.18.16.0/22 via 10.8.0.93 dev [NULL] table 0 metric -1
12月 20 15:26:40 trswnca-y7000p openvpn[38264]: net_route_v4_del: 10.8.0.1/32 via 10.8.0.93 dev [NULL] table 0 metric -1
12月 20 15:26:40 trswnca-y7000p openvpn[38264]: Closing TUN/TAP interface
12月 20 15:26:40 trswnca-y7000p openvpn[38264]: net_addr_ptp_v4_del: 10.8.0.94 dev tun0
12月 20 15:26:40 trswnca-y7000p openvpn[38264]: SIGHUP[hard,] received, process restarting
12月 20 15:26:40 trswnca-y7000p openvpn[38264]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/client/chenyichi.conf
12月 20 15:26:40 trswnca-y7000p openvpn[38264]: Use --help for more information.
12月 20 15:26:40 trswnca-y7000p systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
12月 20 15:26:40 trswnca-y7000p systemd[1]: [email protected]: Failed with result 'exit-code'.

It's weird since the file should be read by the proccess with root privillege. I Have no idea about this. Anyone can help?

The privilege is here:

$ ls -l /etc/openvpn/client
total 16
-rw-r--r-- 1 root root 13257 12月20日 00:47 chenyichi.conf

Chowning to my user didn't help, neigther.

Upvotes: 0

Views: 425

Answers (1)

Seif Khaled
Seif Khaled

Reputation: 9

just try to write this command

service openvpn restart

and try again with

sudo openvpn file-name.ovpn

Upvotes: 0

Related Questions