Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2001 16:13:03 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Cleto Pescia <cleto@eurisco.com>
Cc:        <questions@freebsd.org>
Subject:   Re: login -p "username" after upgrade to 4-STABLE
Message-ID:  <15224.17119.787878.278091@guru.mired.org>
In-Reply-To: <Pine.WNT.4.33.0108132117080.-385193@venus.e-link.ch>
References:  <15223.59099.994241.357335@guru.mired.org> <Pine.WNT.4.33.0108132117080.-385193@venus.e-link.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
Cleto Pescia <cleto@eurisco.com> types:
> > > Sorry to bother you again with this, but I wasn't able to find out a
> > > reason for this strange behaviour: Since I cvsupped a 4.2-RELEASE box to
> > > 4-STABLE, and after a successfull "make world", I keep seeing a
> > > login -p <username>
> > > in the process listing given by "ps ax".
> > > I last did make world on Sunday and now the box reports "4.4-PRERELEASE".
> > > Has anyone ever noticed something like that? Someone suggested there may
> > > be a Trojan version of login, but I can now exclude that for sure.
> > I'm not sure when the change happened, but getty now execs login with
> > the -p flag.
> Thanks for the info. But I still a little bit confused: As far as I
> understand, -p means login does NOT discard any previous environment.
> What isn't clear to me is why login is showing up in the output of ps ax
> at all.

Because the process is there and running. With the addition of PAM
support, getty now sets up a pam session, and it needs to shut it down
after the login process has exited. So instead of just exec()ing
login, it forks then exec()s login. The parent wait()s for the child,
and cleans up the pam session after the wait returns, then exits.

If this really annoys you, you can build login without PAM support by
doing "NOPAM=yes make; make install" in /usr/src/usr.bin/login.

> How does that relate to the addition of -p?

My bad - I thought the question was why the flag was showing up, not
why the process was showing up.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15224.17119.787878.278091>