vgetty file locking

"Francesco L." (goo@ouverture.it)
Mon, 6 Apr 1998 09:09:39 +0200


In message <m0yM5n8-0000YeC@greenie.muc.de>, Gert Doering writes:
> Hi,
> 
> Francesco L. wrote:
> > I run vgetty from inittab in this way:
> > S1:2345:respawn:/usr/local/sbin/vgetty -s 38400 modem
> >
> > modem is a symlink to /dev/ttyS1.
> 
> Don't do this.
> 
> > The problem is that I don't see any lockfile for the modem line in /var/lock/
> > 
> > Furthermore if the line is already used by another process (ie pppd which 
> > always creates /var/lock/LCK..modem) vgetty doesn't care about this and it 
> > takes control of the line..
> 
> IFF both programs use /dev/modem AND both programs write their lock file
> into /var/lock/LCK..*, they should properly interact.
> 
> If you have compiled mgetty/vgetty to use /usr/spool/uucp/LCK..* or
> wherever, they will collide.  Look into the debug log file to see what 
> file vgetty uses.

Here are the contents of /var/log/vgetty.modem:

04/06 09:42:08 dem  check for lockfiles
04/06 09:42:08 dem   checklock: stat failed, no file
04/06 09:42:08 dem  locking the line
04/06 09:42:08 dem   makelock(modem) called
04/06 09:42:08 dem   do_makelock: lock='/var/lock/LCK..modem'
                                        ^^^^^^^^^^^^^^^^^^^^^
04/06 09:42:08 dem   lock made
04/06 09:42:08 dem   tio_get_rs232_lines: status: RTS CTS DSR DTR
04/06 09:42:08 dem  lowering DTR to reset Modem
04/06 09:42:09 dem   tss: set speed to 38400 (017)
04/06 09:42:09 dem   tio_set_flow_control( HARD )
04/06 09:42:09 dem   waiting for line to clear (VTIME), read: [0d][0a]OK[0d][0a]
04/06 09:42:09 dem  send: \dATQ0V1H0[0d]
04/06 09:42:09 dem  waiting for ``OK''
04/06 09:42:09 dem   got: ATQ0V1H0[0d][0d][0a]OK ** found **
04/06 09:42:09 dem  send: ATS0=0Q0&D3&C1[0d]
04/06 09:42:09 dem  waiting for ``OK''
04/06 09:42:09 dem   got: [0d][0a]ATS0=0Q0&D3&C1[0d][0d][0a]OK ** found **
04/06 09:42:09 dem  send: AT[0d]
04/06 09:42:09 dem  do_stat: expect 'OK' ** found **
04/06 09:42:10 dem  send: ATI2[0d]
04/06 09:42:10 dem  do_stat: expect 'OK' ** found **
04/06 09:42:10 dem   tss: set speed to 38400 (017)
04/06 09:42:10 dem   tio_set_flow_control( HARD )
04/06 09:42:10 dem  detecting voice modem type
04/06 09:42:10 dem   voice command: 'ATI' -> ''
04/06 09:42:10 dem  Rockwell detected
04/06 09:42:10 dem   vgetty: entering voice mode
04/06 09:42:10 dem   vgetty: Installing signal handlers
04/06 09:42:10 dem   voice command: 'AT#CLS?' -> ''
04/06 09:42:10 dem   voice command: '' -> 'OK'
04/06 09:42:10 dem   voice command: 'AT#CLS=8' -> 'OK'
04/06 09:42:11 dem  initializing ROCKWELL voice modem
04/06 09:42:11 dem   voice command: 'AT#VSP=70' -> 'OK'
04/06 09:42:11 dem   voice command: 'AT#VSD=0' -> 'OK'
04/06 09:42:11 dem   voice command: 'AT#VTD=3F,3F,3F' -> 'OK'
04/06 09:42:11 dem   voice command: 'AT#VSS=1' -> 'OK'
04/06 09:42:11 dem   voice command: 'AT&K3' -> 'OK'
04/06 09:42:11 dem   tio_set_flow_control( HARD )
04/06 09:42:11 dem   vgetty: leaving voice mode
04/06 09:42:11 dem   voice command: 'AT#CLS=0' -> 'OK'
04/06 09:42:11 dem   vgetty: Restoring signal handlers
04/06 09:42:11 dem   waiting for line to clear (VTIME), read:
04/06 09:42:12 dem   removing lock file
                     ^^^^^^^^^^^^^^^^^^
04/06 09:42:12 dem  waiting...

So vgetty creates the lockfile, but it is being deleted in a few seconds. Is this method right?
I've also manually created /var/lock/LCK..modem then fired up vgetty but It seems that vgetty doesn't care about it..

ciao,

--
 [ Francesco L. <goo@ouverture.it>       ][ Powered by Linux 2.0.33 ]
 [ Alternate address: didefault@usa.net  ][ http://goo.home.ml.org  ]
 [ Dynamic hostname: artemide.dyn.ml.org ][ ICQ UIN: 5529483        ]
 [ To get my PGP PUBLIC KEY send a message to goo+PGP@ouverture.it  ]
            *** Encripted RSA messages are preferred ***