On Tue, Sep 9, 2025, at 1:28 PM, Gert Doering wrote: > Hi, > > On Tue, Sep 09, 2025 at 01:23:23PM -0400, Dan Langille wrote: >> > Interesting. So does "grep foo /etc/passwd" turn up anything? >> >> Yes, it finds the expected user (which is not actually foo). >> >> [17:22 gw01 dvl ~] % grep foo /etc/passwd >> foo:*:1002:1002:User &:/usr/home/foo:/bin/sh >> >> [17:22 gw01 dvl ~] % grep foo /etc/group >> wheel:*:0:root,dvl,foo >> foo:*:1002: > > ok... so anything that ended up in the environment which might prompt > "logger" to use that? > > Logger source says > > if (tag == NULL) > tag = getlogin(); > > and that is documented as > > The getlogin() routine returns the login name of the user associated with > the current session, as previously set by setlogin(). The name is > normally associated with a login shell at the time a session is created, > and is inherited by all processes descended from the login shell. (This > is true even if some of those processes assume another user ID, for > example when su(1) is used). > > so I guess it might be the user that started "sudo openvpn".
That is exactly it. You win all the cookies. Well done. I did this: [18:38 gw01 dvl ~] % sudo su -l root@gw01:~ # service openvpvn restart openvpvn does not exist in /etc/rc.d or the local startup directories (/usr/local/etc/rc.d), or is not executable root@gw01:~ # service openvpn restart Stopping openvpn. Waiting for PIDS: 63572. Starting openvpn. root@gw01:~ # Now the log entries look like this: Sep 9 18:39:22 gw01 dvl[65600]: pro06.int.example.org disconnected with IP 10.0.0.122 Sep 9 18:39:22 gw01 dvl[65605]: pro06.int.example.org connected with IP 10.0.0.122 I now think the only solution is a tag. Something like this. + logger -t openvpn "$common_name connected with IP $trusted_ip" - logger "$common_name connected with IP $trusted_ip" -- Dan Langille d...@langille.org _______________________________________________ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-users