Log file not written / File Handle ....

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
psYkoMichel
OpenVpn Newbie
Posts: 1
Joined: Mon Jun 14, 2021 8:06 am

Log file not written / File Handle ....

Post by psYkoMichel » Mon Jun 14, 2021 9:06 am

Hello together,

I have the following situation at my OpenVPN-Server.

My disk is running full due the openvpn log file comes to the size of 4,9 GB. So I have 100% usage of the partition /var/log.
I do not want to restart the whole VPN process, because the VPN-Server itself is running.

After process the follwowing command without any error messages
cat /dev/null > openvpn.log
I expect that this will made the file empty.
But in some situation the file will does not be empty (df -h and ls -lhtra are showing the 'old' size of the file. Today it works and the file was empty afterwards.

After doing this, the file will not be written anymore with new data. But the service itself is running fine.
When I am showing the content of the logfile with 'less' I can see many '@'-Characters.

It's an Debian-based aptitude installation of OpenVPN.

OpenVPN 2.4.0 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Oct 14 2018
library versions: OpenSSL 1.0.2u 20 Dec 2019, LZO 2.08
Originally developed by James Yonan
Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
Compile time defines: enable_async_push=no enable_comp_stub=no enable_crypto=yes enable_crypto_ofb_cfb=yes enable_debug=yes enable_def_auth=yes enable_dependency_tracking=no enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown enable_fast_install=needless enable_fragment=yes enable_iproute2=yes enable_libtool_lock=yes enable_lz4=yes enable_lzo=yes enable_maintainer_mode=no enable_management=yes enable_multi=yes enable_multihome=yes enable_pam_dlopen=no enable_password_save=yes enable_pedantic=no enable_pf=yes enable_pkcs11=yes enable_plugin_auth_pam=yes enable_plugin_down_root=yes enable_plugins=yes enable_port_share=yes enable_selinux=no enable_server=yes enable_shared=yes enable_shared_with_static_runtimes=no enable_silent_rules=no enable_small=no enable_static=yes enable_strict=no enable_strict_options=no enable_systemd=yes enable_werror=no enable_win32_dll=yes enable_x509_alt_username=yes with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no with_plugindir='${prefix}/lib/openvpn' with_sysroot=no

Maybe anyone has an idea on how to fix it, when the disk is full at the next time?

PS: Yes. I have to fix the main source of the issue, you're right. I am working on it. :-)

Greetings,

Michael

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Log file not written / File Handle ....

Post by TinCanTech » Mon Jun 14, 2021 10:42 am

psYkoMichel wrote:
Mon Jun 14, 2021 9:06 am
It's an Debian-based aptitude installation of OpenVPN
Which means it is using the wrong systemd unit files.

Use openvpn-server@.service unit file and let systemd handle the logfile.

Post Reply