Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* DEC OSF/1 1.2 inetd and process groups.
@ 1993-08-31  4:13 Anthony Baxter
  1993-09-01 21:02 ` Tom Jordahl
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony Baxter @ 1993-08-31  4:13 UTC (permalink / raw)


Here's a fun one for you - under OSF/1 1.2 (and, it seems, 1.3) inetd doesnt
make its child processes process group leaders. This has a few unfortunate
side-effects. 

"rsh machine script" as root, where 'script' contains 'kill -9 0' (which
is useful to make sure you get rid of any leftover child processes) will
kill the not only the script, any children, and the rshd, but also inetd,
_and_ every child of inetd running (eg all rlogind's, rshd's, &c.) This is
extremely nasty. It seems that OSF/1 1.3 has this problem also (from looking
at axposf.pa.dec.com). For some reason 'inetd -d' (debugging mode) works 
properly, making its children process group leaders. So the workaround we
are using until the telephone support centre returns our call is
'inetd -d >/dev/null 2>&1 &'.

With ordinary 'inetd':

alamein # ps agxopid,ppid,pgid,comm
  PID  PPID  PGID COMMAND
  609     1   609 /usr/sbin/inetd
  664   609   609 rshd
  665   664   609 sh -c sleep 4000
  666   665   609 sleep 4000
  669   609   609 rlogind
  670   669   670 -sh (sh)

So the inetd stays in the same process group as the rshd and rlogind. Bad.

If, however, it is run with '-d', and I do the same:
alamein # ps agxopid,ppid,pgid,comm
  PID  PPID  PGID COMMAND
  678   514   678 /usr/sbin/inetd -d
  681   678   681 rshd
  683   681   681 sh -c sleep 4000
  684   683   681 sleep 4000
  687   678   687 rlogind
  689   687   689 -sh (sh)

it works. A workable workaround.
How to tell if you trip this bug? Well, for starters, all your logins over
the network to the machine go away, and you cant log back in. :-)

Anthony.
--
 anthony baxter                 australian artificial intelligence institute
email : anthony@aaii.oz.au         1 grattan st, carlton, australia 3053
    /\/\||                                 phone : +613 663 7922
  Disclaimer: Unless otherwise specified, the above is my opinion, not AAII's.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: DEC OSF/1 1.2 inetd and process groups.
  1993-08-31  4:13 DEC OSF/1 1.2 inetd and process groups Anthony Baxter
@ 1993-09-01 21:02 ` Tom Jordahl
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Jordahl @ 1993-09-01 21:02 UTC (permalink / raw)


In article <anthony.746770417@eden-valley> anthony@aaii.oz.au (Anthony Baxter) writes:
>
>Here's a fun one for you - under OSF/1 1.2 (and, it seems, 1.3) inetd doesnt
>make its child processes process group leaders. This has a few unfortunate
>side-effects. 
>
>"rsh machine script" as root, where 'script' contains 'kill -9 0' (which
>is useful to make sure you get rid of any leftover child processes) will
>kill the not only the script, any children, and the rshd, but also inetd,
>_and_ every child of inetd running (eg all rlogind's, rshd's, &c.) This is
>extremely nasty. It seems that OSF/1 1.3 has this problem also (from looking
>at axposf.pa.dec.com). For some reason 'inetd -d' (debugging mode) works 
>properly, making its children process group leaders. So the workaround we
>are using until the telephone support centre returns our call is
>'inetd -d >/dev/null 2>&1 &'.

[examples deleted]

>How to tell if you trip this bug? Well, for starters, all your logins over
>the network to the machine go away, and you cant log back in. :-)


On OSF/1 R1.2 (from OSF) I see the behavior you describe, but not the problem.

ps agxopid,ppid,pgid,args 
  PID  PPID  PGID COMMAND
10201 10213 10201 csh -c sleep 4000
10206     1 10206 inetd
10213 10206 10206 rshd
10218 10206 10206 rlogind
10219 10201 10201 sleep 4000
10222 10218 10222 -csh (csh)
10247 10206 10247 telnetd
10248 10247 10248 -csh (csh)


cat /foo
#!/sbin/sh
echo hi
kill -9 0

rsh <machine> /foo
hi

ps agxopid,ppid,pgid,args | grep inet
10206     1 10206 inetd

-------

Everything works as it should.

Notice that telnetd sets the Process group-id correctly.  Its
rlogind and rshd that seem not to be doing the 'right thing'.

Inetd will do a setsid() call if the -d switch is given to it 
(check the BSD source, which is where we got ours).  
Unless DEC changed what we gave them in 1.0.4 (quite possible!) the OSF/1
inetd is pretty much BSD4.3-reno code.


-- 
Tom Jordahl                                       Internet: tom@osf.org
Open Software Foundation                          UUCP:   ..!uunet!osf!tom
 "Sometimes when you fill a vacuum, it still sucks." - Dennis Ritchie on X


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1993-09-01 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-08-31  4:13 DEC OSF/1 1.2 inetd and process groups Anthony Baxter
1993-09-01 21:02 ` Tom Jordahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox