Difference in ksh's viewed via "ps"?

Difference in ksh's viewed via "ps"?

Post by jhu.. » Fri, 11 May 2001 05:23:40



What is the difference between the following
processes (where user_1 is currently on the system
and user_2 is not)?

   UID   PID  PPID  C    STIME TTY   TIME CMD
user_1  2677  2672  0 12:36:35 pts/3 0:00 /bin/ksh
user_2  2438     1  0 10:27:13 ?     0:00 [ ksh ]
user_1  2755  2753  1 13:53:43 pts/5 0:00 -ksh

Does [ ksh ] always represent a defunct(?) session
while -ksh represents an active one?

Finally, is there some way to cause the users'
defunct(?) Korn Shells to close automatically when
they log off (as opposed to doing a "kill -9")?

The reason that this is important is because the
users (especially user_2) have child processes
associated with their defunct(?) shells that
refuse to be killed before the parent dies; that
is, the children processes get called again by
their parent after a "kill -9 <child_process>".

Any help would be appreciated.

 
 
 

Difference in ksh's viewed via "ps"?

Post by Bill Marcu » Fri, 11 May 2001 11:46:16



>What is the difference between the following
>processes (where user_1 is currently on the system
>and user_2 is not)?

>   UID   PID  PPID  C    STIME TTY   TIME CMD
>user_1  2677  2672  0 12:36:35 pts/3 0:00 /bin/ksh
>user_2  2438     1  0 10:27:13 ?     0:00 [ ksh ]
>user_1  2755  2753  1 13:53:43 pts/5 0:00 -ksh

>Does [ ksh ] always represent a defunct(?) session
>while -ksh represents an active one?

Doesn't "man ps" say what the brackets mean?

Any shell beginning with - is a login shell.  /bin/ksh was probably
explicitly called using the full pathname.

Quote:>Finally, is there some way to cause the users'
>defunct(?) Korn Shells to close automatically when
>they log off (as opposed to doing a "kill -9")?

>The reason that this is important is because the
>users (especially user_2) have child processes
>associated with their defunct(?) shells that
>refuse to be killed before the parent dies; that
>is, the children processes get called again by
>their parent after a "kill -9 <child_process>".

A defunct process is only an entry in the process table.  It can't call
new processes.  Something else is happening here.  Maybe user_2 is
using nohup or crontab.

 
 
 

Difference in ksh's viewed via "ps"?

Post by Nate Eldredg » Fri, 11 May 2001 16:40:39



> What is the difference between the following
> processes (where user_1 is currently on the system
> and user_2 is not)?

>    UID   PID  PPID  C    STIME TTY   TIME CMD
> user_1  2677  2672  0 12:36:35 pts/3 0:00 /bin/ksh
> user_2  2438     1  0 10:27:13 ?     0:00 [ ksh ]
> user_1  2755  2753  1 13:53:43 pts/5 0:00 -ksh

> Does [ ksh ] always represent a defunct(?) session
> while -ksh represents an active one?

No.  The - prefix usually just indicates a "login" shell (as opposed
to one that's running a script).  If one exists, it's likely that the
user is logged on, but not necessarily true.

I'm not sure what the brackets mean; my version of ps doesn't seem to
use them.

Quote:> Finally, is there some way to cause the users'
> defunct(?) Korn Shells to close automatically when
> they log off (as opposed to doing a "kill -9")?

"Defunct" is not quite the right word; that usually refers to
so-called zombie processes that have exited but not yet been reaped by
their parent calling `waitpid'.  This is not the case in your example;
the [ ksh ] process has init (PID 1) as its parent (this happens when
the parent exits before the child: init inherits the child), and init
should always reap its children very quickly

Quote:> The reason that this is important is because the
> users (especially user_2) have child processes
> associated with their defunct(?) shells that
> refuse to be killed before the parent dies; that
> is, the children processes get called again by
> their parent after a "kill -9 <child_process>".

It sounds like you want all the user's processes to die when they log
out.  This may not be desirable, since it will keep users from running
long background jobs that may be necessary.  Even if this is what you
want, I'm not sure of a good way to implement it.

--

Nate Eldredge

 
 
 

Difference in ksh's viewed via "ps"?

Post by Villy Kru » Fri, 11 May 2001 17:33:29




>> What is the difference between the following
>> processes (where user_1 is currently on the system
>> and user_2 is not)?

>>    UID   PID  PPID  C    STIME TTY   TIME CMD
>> user_1  2677  2672  0 12:36:35 pts/3 0:00 /bin/ksh
>> user_2  2438     1  0 10:27:13 ?     0:00 [ ksh ]
>> user_1  2755  2753  1 13:53:43 pts/5 0:00 -ksh

>> Does [ ksh ] always represent a defunct(?) session
>> while -ksh represents an active one?

>No.  The - prefix usually just indicates a "login" shell (as opposed
>to one that's running a script).  If one exists, it's likely that the
>user is logged on, but not necessarily true.

>I'm not sure what the brackets mean; my version of ps doesn't seem to
>use them.

It usualy mean that the command line arguments is not currently available
because the process is swapped out.

Quote:>> Finally, is there some way to cause the users'
>> defunct(?) Korn Shells to close automatically when
>> they log off (as opposed to doing a "kill -9")?

>"Defunct" is not quite the right word; that usually refers to
>so-called zombie processes that have exited but not yet been reaped by
>their parent calling `waitpid'.  This is not the case in your example;
>the [ ksh ] process has init (PID 1) as its parent (this happens when
>the parent exits before the child: init inherits the child), and init
>should always reap its children very quickly

Defunct and zombies are the same thing in this context, but a zombie/defunct
would be marked as such in the ps listing and that is not the case here.
Proceses who lost thier parants are called orphans, and they are recognized
in the ps listing with PPID being 1.

Villy

 
 
 

Difference in ksh's viewed via "ps"?

Post by jhu.. » Fri, 11 May 2001 23:46:25


The process created by user_2 is basically the result of
a telnet session to a PowerPC that is not properly closed
before the user exits out of the CDE.  This telnet session
issues a command to the PowerPC such as a reboot, looking
at the system table, or loading an image.

And, primarily in the second instance of looking at the
system table, the "[ ksh ]" will remain when the CDE is
closed and reopened.  This results in multiple Korn shell
processes whose kids keep trying to view the PPC's system
table and can cause a lockup of the related program.

 
 
 

1. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

My machine: P166+mmx, 32mb ram, 4gb HD with Win95 and Win NT 4.0 and
redhat5.1 co-existed in different partitions.

I issued "sndconfig" within a xterm inside X Window, The program
detects the SB 16 pnp card sets it up with no error message, but when
it launch ModProbe to test out, it gets a message states: An error was
encountered running the ModProbe program."  I tried different IRQ
settings, all ends with the same message.

2nd, When I try to mount /dev/cdrom from File Systerm Manager, the
following error is returned:  Can't find /dev/hdb in /etc/mtab or
/etc/fstab.

3nd, When my machine boots, it halts at "Sendmail" for about 3-5 mins
before it goes to next step.  Obviously there isn't any mail system on
the machine right now because it is a standalone.  How can take this
mail thing out and speed up booting?

last one, Is my Zoom 56k PCI FaxModem a Windmodem that Linux can't use
to connect me to my local isp?

Experts help me out please. thanks.

2. Setting up linux - help please

3. differences among "ssh", "rlogin" and "telnet"

4. partition problems

5. What's the difference between "mount=true"and "mount=automatic"?

6. Signal and Kernel

7. Using "if" in "ksh" to change "for loop" values....

8. DHCP and DNS --- a poser.

9. GETSERVBYNAME()????????????????????"""""""""""""

10. Subtle difference between "real" ksh and FreeBSD ksh ?

11. Does FreeBSD 3.0' ksh support "print" and "function" ?

12. Kmail - Difference "Date" & "Order of Arrival" field

13. difference between "core dump" and "panic"