[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: Getty is spawning to early



Tim Heckman wrote:
> John Hasler writes:
> >Try killing getty in your script (init will respawn it). You may
> >also need to delay logins so that the user can't log in too early.
> 
> I'm not sure why but I hadn't thought of this.  I was hoping to
> implement a delay instead of having to kill getty.  I wouldn't want to
> nuke getty while someone was logged in doing something ...

If someone has logged in using getty then the getty isn't running
anymore since it exec's the login process.  It is only the process id
that is special.  Since the getty exec's the login process the process
id is maintained.  When the login process exits the pid exits.  When
the pid exits then init notices and responds the getty as per the
configuration in /etc/inittab.

So if someone has logged in then getty is already gone and replaced by
the login process.  If you only kill a getty then you won't be killing
the login process.

Having said that, I don't think you can eliminate the race condition
between checking the name one instant for being getty and then trying
to kill it thinking it is getty and okay and having it change to a
different process name due to a login at that same instant.  I don't
know of a way to avoid that race condition.  But setting
DELAYLOGIN=yes may help since it will push logins off until later.
The two combined may be okay.

> ... as, in theory, it is possible the hook could be invoked by
> dhclient.  But there would need to be a weird situation for the
> logic to be in place to cause it to happen.

Uhm...  what?  :-)

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: