Re: Solaris 10, svcadm and demons

From: MichalR (mrot_at_neostrada.pl)
Date: 07/29/05


Date: Fri, 29 Jul 2005 07:18:59 +0200


> svcadm misfeature closes your telnet session. Your daemon goes away
> because you probably haven't correctly daemonized? In another telnet
> or login session, attach to the daemon with gdb or mdb and see what
> signal it gets. It'd be interesting to see ps -j -p <pid> for your
> telnet shell and the daemon.
>

Demon is demonized correctly. After starting demon I see that it
parent process is /sbin/init and it is NOT attached to any terminal.
Soon I will check the signal and let you know.
One more thing: Almost the same situation is with ssh session, but this
time, when I do "svcadm disable ssh" all sessions are closed, I see that
ssh changes it's state from online to online* for 60 secs (it's equal to
the timeout value in ssh manifest file). But this time, in spite of
closed seesion demon IS WORKING - it's killed exactly after 60 seconds
!. The ssh moves then to maintenance state and log file complains that
exit time out was reached.
So it looks that during disabling terminal session (ssh or telnet)
svcadm wants a couple of other processes (started from this terminal) to
be closed. It (svcsadm disable...) waits for 60 seconds and then kill them.
Today I will write small demon and run in under dbx. I will check
exactly what kind of signal it receives.
BTW - if I kill ssh session from the command line (pkill ssh) then demon
works well.
It happens only when I use svcadm. Nothing else depends on ssh so no
other should killed when I disable ssh.

Regards