Empty openvpn-status.log

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
acb
OpenVpn Newbie
Posts: 1
Joined: Mon Sep 24, 2018 2:45 am

Empty openvpn-status.log

Post by acb » Mon Sep 24, 2018 2:59 am

I've been using Openvpn 2.4.4 on an Ubuntu instance on AWS for about a year... currently 18.04.. Recently (a month or two back, I think) I started noticing that the openvpn-status.log file was empty, size 0. Aside from the incongruity this is obviously inconvenient from a network management point of view.

The VPN seems to work normally except for the empty -status.log. Anyone have any thoughts about what might be causing this?

Server Config

local xxx.xx.x.xxx
port 1194
tls-server
proto udp
dev tun
ca ca.crt
cert warn.crt
key warn.key
dh dh2048.pem
tls-auth ta.key 0
key-direction 0
cipher AES-256-CBC
server 192.168.2.0 255.255.255.0
route 192.168.2.0 255.255.255.0
ifconfig-pool-persist ipp.txt
client-to-client
persist-key
persist-tun
#keepalive 10 40
auth SHA256
#comp-lzo
user nobody
group nogroup
status /etc/openvpn/openvpn-status.log
log-append /var/log/openvpn.log
verb 3

gustavo86
OpenVpn Newbie
Posts: 1
Joined: Fri Dec 27, 2019 2:23 pm

Re: Empty openvpn-status.log

Post by gustavo86 » Fri Dec 27, 2019 3:30 pm

I ran into the same issue. In my case, somehow an old (and stuck) openvpn PID was still accessing the openvpn-status.log file.
In my particular deployment, I am running two different openvpn processes simultaneously on my Ubuntu 18.04.3 server.
The issue was only seen on the openvpn-status.log file used by the first openvpn service.
I am running OpenVPN 2.4.4 server. Nothing outstanding in any of my server.conf files.
Killing the stuck PID and restarting the openvpn services fixed the issue in my case.

As a note, while monitoring the file I once saw some bytes written on it but then it quickly came back to zero size again.

Code: Select all

user@myserver:/etc/openvpn$ ll openvpn-status.log
-rw------- 1 root root 0 Dec 27 13:55 openvpn-status.log
user@myserver:/etc/openvpn$ ll openvpn-status.log
-rw------- 1 root root 743 Dec 27 13:55 openvpn-status.log
user@myserver:/etc/openvpn$ ll openvpn-status.log
-rw------- 1 root root 0 Dec 27 13:55 openvpn-status.log
The stuck PID was 15116

Code: Select all

user@myserver:/etc/openvpn$ sudo lsof | grep openvpn-status
openvpn   15116               nobody    5w      REG                8,1         0     258326 /etc/openvpn/openvpn-status.log
openvpn   24313               nobody    4w      REG                8,1     17894     287910 /etc/openvpn/openvpn-status2.log
Removing the file fixed nothing

Code: Select all

user@myserver:/etc/openvpn$ sudo rm -f openvpn-status.log

user@myserver:/etc/openvpn$ ll openvpn-status.log 
-rw------- 1 root root 0 Dec 27 13:57 openvpn-status.log
user@myserver:/etc/openvpn$ ll openvpn-status.log 
-rw------- 1 root root 0 Dec 27 13:57 openvpn-status.log

user@myserver:/etc/openvpn$ sudo lsof | grep openvpn-status
openvpn   15116               nobody    5w      REG                8,1       743     258326 /etc/openvpn/openvpn-status.log (deleted)
openvpn   24313               nobody    4w      REG                8,1     17894     287910 /etc/openvpn/openvpn-status2.log
I stopped both of my openvpn services and killed the stuck PID

Code: Select all

user@myserver:/etc/openvpn$ sudo systemctl stop openvpn

user@myserver:/etc/openvpn$ sudo lsof | grep openvpn-status
openvpn   15116                 nobody    5w      REG                8,1       743     258326 /etc/openvpn/openvpn-status.log (deleted)

user@myserver:/etc/openvpn$ ps aux | grep 15116
nobody   15116  0.0  0.4  45332  2732 ?        Ss   Sep12  46:38 /usr/sbin/openvpn --writepid /run/openvpn/server.pid --daemon ovpn-server --cd /etc/openvpn --config /etc/openvpn/server.conf

user@myserver:/etc/openvpn$ sudo kill 15116
The result was no more stuck openvpn PID accessing the file

Code: Select all

user@myserver:/etc/openvpn$ sudo lsof | grep openvpn-status
user@myserver:/etc/openvpn$ ps aux | grep 15116

user@myserver:/etc/openvpn$ sudo systemctl start openvpn

user@myserver:/etc/openvpn$ sudo lsof | grep openvpn-status
openvpn   27793                 nobody    4w      REG                8,1     17896     287910 /etc/openvpn/openvpn-status2.log
openvpn   27795                 nobody    4w      REG                8,1       663     341483 /etc/openvpn/openvpn-status.log
user@myserver:/etc/openvpn$
All is good now

Code: Select all

user@myserver:/etc/openvpn$ ll openvpn-status.log 
-rw------- 1 root root 663 Dec 27 15:21 openvpn-status.log
user@myserver:/etc/openvpn$

Post Reply