Message-ID: <111801c8b40a$16fd49b0$0202fea9@...1094...> From: "Bonno Bloksma" References: <0f4501c8b271$3b877200$0202fea9@...1094...> <9e0cf0bf0805100051md5fcd4au6f032a85c6a87cbe@...278...> <109201c8b2e4$a08816a0$0202fea9@...1094...> <9e0cf0bf0805101429y588943ecj15432578d73391c7@...278...> Date: Mon, 12 May 2008 10:28:00 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_1115_01C8B41A.DA5DAA20" Subject: Re: [Openvpn-devel] SIGHUP SIGUSR1 new logfile List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: openvpn-devel@lists.sourceforge.net This is a multi-part message in MIME format. ------=_NextPart_000_1115_01C8B41A.DA5DAA20 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Alon, What dou you mean by: > This is what SIGUSR1 is for. If you mean SIGUSR1 is for reopen, I knew that. If you mean SIGUSR1 is fol = solving the problem I had after a reload... no that does not work. After a = failed reload there is no running openvpn session anymore, the reopen comma= nd does not work. Did some more testing with 2.0.9 on my system. It's the "user nobody" line = in the client.conf file that's the cause for the failure to open the keyfil= e after a reload. The "group nobody" does not affect this behaviour. Files are: -r--r--r-- 1 root root 3471 Mar 6 2007 bonnothuis.crt -r--r--r-- 1 root root 729 Mar 6 2007 bonnothuis.csr -r-------- 1 root root 887 Mar 6 2007 bonnothuis.key -r--r--r-- 1 root root 1212 Mar 6 2007 ca.crt -rw-r--r-- 1 root root 245 May 12 10:14 client.conf It seems that openvpn running as nobody is not allowed to do several things= , among them to open the key file, when doing a reload. I only have an old RedHat 9 system here currently for testing, not sure I c= an get 2.1rc7 on that as it also has no gcc. So, if the problem I'm describ= ing is unknow to the developers yet and you want me to do some more testing= let me know. I'll have to rebuild my testbed machine first though to a lat= er Linux version, probabbly Debian lenny or unstable. Please let me know. Met vriendelijke groet, Bonno Bloksma hoofd systeembeheer tio hogeschool hospitality en toerisme=20 begijnenhof 8-12 / 5611 el eindhoven t 040 296 28 28 / f 040 237 35 20 b.bloksma@...1093... / www.tio.nl=20 ----- Original Message -----=20 From: Alon Bar-Lev=20 To: Bonno Bloksma=20 Cc: openvpn-devel@lists.sourceforge.net=20 Sent: Saturday, May 10, 2008 11:29 PM Subject: Re: [Openvpn-devel] SIGHUP SIGUSR1 new logfile This is what SIGUSR1 is for. On 5/11/08, Bonno Bloksma wrote: > > > Hello, > > I might look into the syslog way to seperate the openvpn log messages. > That leaves the unwanted effect of killing the connection when doing a > reload. Is that a know bug or something specific to my situation? > > > > > Met vriendelijke groet, > Bonno Bloksma > hoofd systeembeheer > > > tio hogeschool hospitality en toerisme > begijnenhof 8-12 / 5611 el eindhoven > t 040 296 28 28 / f 040 237 35 20 > b.bloksma@...1093... / www.tio.nl > > > ----- Original Message ----- > From: Alon Bar-Lev > To: Bonno Bloksma > Cc: openvpn-devel@lists.sourceforge.net > > Sent: Saturday, May 10, 2008 9:51 AM > Subject: Re: [Openvpn-devel] SIGHUP SIGUSR1 new logfile > > SIGUSR1 is used for other stuff in openvpn. > > Why don't you use syslog, catch the openvpn related messages and place > them in separate file? It is much simpler and can be managed in > greater flexibility. > > Alon. > > On 5/10/08, Bonno Bloksma wrote: > > > > > > Hi, > > > > > > > > I wanted to implement a weekly logfile rotation for the openvpn logfi= le > and > > noticed that it did not work, openvpn kept writing to the old logfile. > > > > If I did a manual mv openvpn.log openvpn.1 openvpn would still write = to > the > > same file, now called openvpn.1, and not start a new openvpn.log. Only > after > > restarting openvpn dit it start a new openvpn.log file. > > What is the correct way to keep openvpn up and running but have it st= art > > using the new logfile? > > > > The logrotate program has a workaround by using the copytruncate opti= on > but > > that is more of a stopgap sollution for dumb programs, of which I'm s= ure > > openvpn is not one. > > The logrotate program can send a SIGHUP, SIGUSR1, etc after the rotat= ion > to > > tell the program the logfile has been rotated. > > > > The openvpn script in the init.d/ folder has options like reload and > reopen > > which correspondent to SIGHUP, SIGUSR1 and might do what I want but..= .. so > > far it seems not. After both reload and reopen the old logfile is sti= ll > > being used. > > Besides that.... > > > > Testing with 2.0.9-1 on a Redhat 9 machine I found out that trying to= do a > > reload would produce several errors, one about opening the key file, = and I > > would loose the vpn connection. > > Sat May 10 08:58:44 2008 us=3D750706 TCP/UDP: Closing socket > > Sat May 10 08:58:44 2008 us=3D750822 /sbin/ip route del 172.16.1.64/26 > > RTNETLINK answers: Operation not permitted > > Sat May 10 08:58:44 2008 us=3D755306 ERROR: Linux route delete command > failed: > > shell command exited with error status: 2 > > [.....] > > Sat May 10 08:58:44 2008 us=3D865438 OpenVPN 2.0.9 i386-redhat-linux-= gnu > [SSL] > > [LZO] [EPOLL] built on Feb 2 2007 > > Sat May 10 08:58:44 2008 us=3D865545 Restart pause, 2 second(s) > > Sat May 10 08:58:46 2008 us=3D866570 IMPORTANT: OpenVPN's default port > number > > is now 1194, based on an official port number assignment by IANA. Op= enVPN > > 2.0-beta16 and earlier used 5000 as the default port. > > Sat May 10 08:58:46 2008 us=3D867202 Cannot load private key file > > bonnothuis.key: error:0200100D:system library:fopen:Permission denied: > > error:20074002:BIO routines:FILE_CTRL:system lib: error:140B0002:S > > SL routines:SSL_CTX_use_PrivateKey_file:system lib > > Sat May 10 08:58:46 2008 us=3D867316 Error: private key password > verification > > failed > > Sat May 10 08:58:46 2008 us=3D867342 Exiting > > Is this a known error, maybe connected to the nobody options, or shou= ld I > do > > some testing with the new 2.1 version? > > > > > > Is the issue with the logfile rotation dealt with in the 2.1 release?= If > > not, will it be in a next rc? Do I need to help testing some things? > > I am NOT a C programmer, at least not anymore. My programming skills = are > old > > and were in several other languages like Pascal, Forth, etc. :-) > > > > p.s. In my production environment I will be using Openvpn mainly on D= ebian > > etch, so for that I would still be using the 2.0.9 release for a whil= e. > But > > at home I'd like to use the newer version to see if openvpn 2.1 does = work > as > > it should. > > > > Groetjes, > > Bonno Bloksma > > > > > -----------------------------------------------------------------------= -- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $1= 00. > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/= javaone > > _______________________________________________ > > Openvpn-devel mailing list > > Openvpn-devel@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/openvpn-devel > > > > > ------=_NextPart_000_1115_01C8B41A.DA5DAA20 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =EF=BB=BF
Hello Alon,
 
What dou you mean by:
> This is what SIGUSR1 is for.
=  
If you mean SIGUSR1 is for reopen, I knew = that. If=20 you mean SIGUSR1 is fol solving the problem I had after a reload... no that= does=20 not work. After a failed reload there is no running openvpn session anymore= , the=20 reopen command does not work.
 
Did some more testing with 2.0.9 on my sys= tem. It's=20 the "user nobody" line in the client.conf file that's the cause for th= e=20 failure to open the keyfile after a reload. The "group nobody" does not aff= ect=20 this behaviour.
Files are:
-r--r--r--  1 root root  3471 Ma= r =20 6  2007 bonnothuis.crt
-r--r--r--  1 root root   729= =20 Mar  6  2007 bonnothuis.csr
-r--------  1 root=20 root   887 Mar  6  2007 bonnothuis.key
-r--r--r--&nb= sp; 1=20 root root  1212 Mar  6  2007 ca.crt
-rw-r--r--  1 ro= ot=20 root   245 May 12 10:14 client.conf
It seems that openvpn running as nobody is= not=20 allowed to do several things, among them to open the key file, when doing a= =20 reload.
 
I only have an old RedHat 9 system here cu= rrently=20 for testing, not sure I can get 2.1rc7 on that as it also has no gcc. So, i= f the=20 problem I'm describing is unknow to the developers yet and you want me to d= o=20 some more testing let me know. I'll have to rebuild my testbed machine firs= t=20 though to a later Linux version, probabbly Debian lenny or=20 unstable.
Please let me know.
 


Met vriendelijke groet,
Bonno Bloksma
hoofd systeembehee= r

tio hogeschool hospitality en toerisme
begijnenhof 8-12 / 5611 el eindhoven
t 040= 296 28=20 28 / f 040 237 35 20
b.bloksma@...1093...  / www.tio.nl=20
----- Original Message -----
Fro= m:=20 Al= on=20 Bar-Lev
Cc: openvpn-devel@...1096...= ourceforge.net=20
Sent: Saturday, May 10, 2008 11:29= =20 PM
Subject: Re: [Openvpn-devel] SIGHU= P=20 SIGUSR1 new logfile

This is what SIGUSR1 is for.

On 5/11/08, Bonno Blok= sma=20 <b.bloksma@...1093...>= =20 wrote:
>
>
> Hello,
>
> I might look into t= he=20 syslog way to seperate the openvpn log messages.
> That leaves the= =20 unwanted effect of killing the connection when doing a
> reload. Is= that=20 a know bug or something specific to my=20 situation?
>
>
>
>
> Met vriendelijke=20 groet,
> Bonno Bloksma
> hoofd=20 systeembeheer
>
>
> tio hogeschool hospitality en=20 toerisme
> begijnenhof 8-12 / 5611 el eindhoven
> t 040 296 2= 8 28=20 / f 040 237 35 20
> b.bloksma@...1093...  / www.tio.nl
>
>
> ----- O= riginal=20 Message -----
> From: Alon Bar-Lev
> To: Bonno Bloksma
>= ; Cc:=20 openvpn-devel@...1096...= ourceforge.net
>
>=20 Sent: Saturday, May 10, 2008 9:51 AM
> Subject: Re: [Openvpn-devel]= =20 SIGHUP SIGUSR1 new logfile
>
> SIGUSR1 is used for other stuf= f in=20 openvpn.
>
> Why don't you use syslog, catch the openvpn rela= ted=20 messages and place
> them in separate file? It is much simpler and = can=20 be managed in
> greater flexibility.
>
>=20 Alon.
>
> On 5/10/08, Bonno Bloksma <b.bloksma@...1093...> wrote:<= BR>>=20 >
> >
> > Hi,
> >
> >
>=20 >
> > I wanted to implement a weekly logfile rotation for the= =20 openvpn logfile
> and
> > noticed that it did not work, op= envpn=20 kept writing to the old logfile.
> >
> > If I did a man= ual=20 mv openvpn.log openvpn.1 openvpn would still write to
> the
>= >=20 same file, now called openvpn.1, and not start a new openvpn.log. Only>=20 after
> > restarting openvpn dit it start a new openvpn.log=20 file.
> > What is the correct way to keep openvpn up and running= but=20 have it start
> > using the new logfile?
> >
> &g= t;=20 The logrotate program has a workaround by using the copytruncate=20 option
> but
> > that is more of a stopgap sollution for d= umb=20 programs, of which I'm sure
> > openvpn is not one.
> >= The=20 logrotate program can send a SIGHUP, SIGUSR1, etc after the rotation
&= gt;=20 to
> > tell the program the logfile has been rotated.
>=20 >
> > The openvpn script in the init.d/ folder has options li= ke=20 reload and
> reopen
> > which correspondent to SIGHUP, SIG= USR1=20 and might do what I want but.... so
> > far it seems not. After = both=20 reload and reopen the old logfile is still
> > being used.
&g= t;=20 > Besides that....
> >
> > Testing with 2.0.9-1 on a= =20 Redhat 9 machine I found out that trying to do a
> > reload woul= d=20 produce several errors, one about opening the key file, and I
> >= ;=20 would loose the vpn connection.
> > Sat May 10 08:58:44 2008=20 us=3D750706 TCP/UDP: Closing socket
> > Sat May 10 08:58:44 2008= =20 us=3D750822 /sbin/ip route del 172.16.1.64/26
> > RTNETLINK answ= ers:=20 Operation not permitted
> > Sat May 10 08:58:44 2008 us=3D755306= ERROR:=20 Linux route delete command
> failed:
> > shell command exi= ted=20 with error status: 2
> > [.....]
> > Sat May 10 08:58:4= 4=20 2008 us=3D865438 OpenVPN 2.0.9 i386-redhat-linux-gnu
> [SSL]
>= ; >=20 [LZO] [EPOLL] built on Feb  2 2007
> > Sat May 10 08:58:44 = 2008=20 us=3D865545 Restart pause, 2 second(s)
> > Sat May 10 08:58:46 2= 008=20 us=3D866570 IMPORTANT: OpenVPN's default port
> number
> >= is now=20 1194, based on an official port number assignment by IANA. =20 OpenVPN
> > 2.0-beta16 and earlier used 5000 as the default=20 port.
> > Sat May 10 08:58:46 2008 us=3D867202 Cannot load priva= te key=20 file
> > bonnothuis.key: error:0200100D:system=20 library:fopen:Permission denied:
> > error:20074002:BIO=20 routines:FILE_CTRL:system lib: error:140B0002:S
> > SL=20 routines:SSL_CTX_use_PrivateKey_file:system lib
> > Sat May 10=20 08:58:46 2008 us=3D867316 Error: private key password
>=20 verification
> > failed
> > Sat May 10 08:58:46 2008=20 us=3D867342 Exiting
> > Is this a known error, maybe connected t= o the=20 nobody options, or should I
> do
> > some testing with the= new=20 2.1 version?
> >
> >
> > Is the issue with the= =20 logfile rotation dealt with in the 2.1 release? If
> > not, will= it=20 be in a next rc? Do I need to help testing some things?
> > I am= NOT=20 a C programmer, at least not anymore. My programming skills are
>=20 old
> > and were in several other languages like Pascal, Forth, = etc.=20 :-)
> >
> > p.s. In my production environment I will be= =20 using Openvpn mainly on Debian
> > etch, so for that I would sti= ll be=20 using the 2.0.9 release for a while.
> But
> > at home I'd= like=20 to use the newer version to see if openvpn 2.1 does work
> as
&g= t;=20 > it should.
> >
> > Groetjes,
> > Bonno=20 Bloksma
> >
> >
>=20 -------------------------------------------------------------------------=
>=20 >  This SF.net email is sponsored by the 2008 JavaOne(SM)=20 Conference
> >  Don't miss this year's exciting event. Ther= e's=20 still time to save $100.
> >  Use priority code J8TL2D2.>=20 >
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://ja= va.sun.com/javaone
>=20 > _______________________________________________
> > =20 Openvpn-devel mailing list
> >  Openvpn-devel@...1096...= ourceforge.net
>=20 >
> https= ://lists.sourceforge.net/lists/listinfo/openvpn-devel
>=20 >
> >
>
------=_NextPart_000_1115_01C8B41A.DA5DAA20--