f



/etc/passwd

Can someone tell me how the last field in a record of the /etc/passwd
text file can be executable?
I've noticed that the parent pid of my login shell is 1, the init
process.
Is the init process merely reading this field and executing it?

Thanks
0
1/25/2008 4:14:38 PM
comp.unix.admin 2890 articles. 1 followers. Post Follow

4 Replies
588 Views

Similar Articles

[PageSpeed] 27

nick <cupofjava1961@aol.com> writes:

> I've noticed that the parent pid of my login shell is 1, the init
> process.

When the parent process of a process goes away, the parent pid is set to
1.

How do you login to your login shell and on which OS?
-- 
  Thorbj´┐Żrn Ravn Andersen
0
Thorbjoern
1/25/2008 5:28:45 PM
I login to slackware using ksh.new (the new Korn shell) as my login
shell.
0
nick
1/26/2008 2:15:09 AM
In article <yu2r6g5stki.fsf@luhmann.netc.dk>,
 Thorbjoern Ravn Andersen <nospam0000@gmail.com> wrote:

> nick <cupofjava1961@aol.com> writes:
> 
> > I've noticed that the parent pid of my login shell is 1, the init
> > process.
> 
> When the parent process of a process goes away, the parent pid is set to
> 1.

That's true, but probably not what's happening here.

init forks a child that runs getty.  Getty reads the username and 
password, and then execs login; login is running in the same process 
that was running getty, so its parent is still init.  Login execs your 
login shell, so again it's still the same process, and the parent is 
still init.

Things may be different if you login to an X console using XDM.  But in 
this case I'm not sure there's a real notion of "my login shell", so I 
suspect he's talking about a console login.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
0
Barry
1/26/2008 3:09:21 AM
nick <cupofjava1...@aol.com> wrote:
>
> Can someone tell me how the last field in a record of the /etc/passwd
> text file can be executable?

If it is not executable that account can not login.

> I've noticed that the parent pid of my login shell is 1, the init
> process.

Read up on the difference between login sessions and other processes.
The login process explicitly removes itself from a parent-child
relationship with whatever ran it.  Usually - Try doing your login
with
ssh and you'll likely see a different change of parentage.  I just
checked
on a Solaris box and the chain went up to an sshd running as root
before it detached from inetd.

> Is the init process merely reading this field and executing it?

No.  The man pages for login(1) explains the process, though that
is a small part of a large man page.  passwd(4) gives the data used
not
the process login goes through.
0
Doug
1/28/2008 4:22:52 PM
Reply: