On 22/09/16 15:32, Samuli Seppänen wrote: > Il 22/09/2016 16:07, debbie10t ha scritto: [...snip...] >> Obviously, systemctl start openvpn@client1 appends more options >> when starting openvpn (in my hand written service the only >> addition is --daemon client1) So I presume that by daemonizing >> something changes with regard to writing the log file to /tmp ?? >> >> Also note, in the forum post --daemon is used within the config >> file. >> >> I did grep -E "/tmp" src/openvpn/* and found some code in init.c >> (line 664) but it's all C, foo, bar to me (Sea food bar ;-) ) >> >> Anyhoo, can anybody provide a brief and simple explanation ? >> >> Many thanks >> > > Hi, > > I did some testing on my Ubuntu 16.04 VM, and this seems like a > permission issue, probably related to the capabilities set in the > openvpn unit file: > > /lib/systemd/system/openvpn@.service > > Basically --log and --log-append will work, if the logfile is > stored under /etc/openvpn. If you try to put the it under /tmp, it > will never appear.
Eeek ... never suggest putting log data into /etc ... /var/log please! Okay ... as /tmp is mentioned .... I presume this is related to PrivateTmp being enabled in the unit file. This provides each service where this is enabled with its own (private) /tmp directory and not the old system-wide /tmp directory. See the systemd.exec(5) man page for more info. Simple and brief enough? ;-) > That said, you probably would not need a logfile, as you can view > them with > > $ journalctl /usr/sbin/openvpn Interesting approach. It is usually better to use $ journalctl -u openvpn@CONFIG If you add -b or --since you can narrow down how far back it will go too. -- kind regards, David Sommerseth OpenVPN Technologies, Inc
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel