init 6

hello,

i am running a process on a solaris10 machine. this process is supposed to print some messages just before the machine is restarted.

in the manual of init i see that my process should receive a SIGTERM signal and only after 5 seconds a SIGKILL should be sent.

when performing init 6, my process does not receive the SIGTERM signal.

i put a K01myprocess in /etc/rc3.d in order to send the SIGTERM to the process myself however when K01myprocess is ran, the process is already dead.

also, my process sometimes receives a SIGHUP signal before the reboot, but not always.

can someone please clarify what actions are done when performing init 6 and what should i do to insure my process receives the SIGTERM.

these are my machine's details:

SunOS 5.10 Generic sun4u sparc SUNW,Netra-240

thanks,

Amit

[869 byte] By [lebamba] at [2007-11-27 3:29:36]
# 1

> hello,

>

> i am running a process on a solaris10 machine. this

> process is supposed to print some messages just

> before the machine is restarted.

> in the manual of init i see that my process should

> receive a SIGTERM signal and only after 5 seconds a

> SIGKILL should be sent.

> when performing init 6, my process does not receive

> the SIGTERM signal.

> i put a K01myprocess in /etc/rc3.d in order to send

> the SIGTERM to the process myself however when

> K01myprocess is ran, the process is already dead.

Scripts in rc3 are run when you go to rc3, not when you leave rc3.

If you want to run a script when the machine shuts down, you should put it in /etc/rc0.d.

> also, my process sometimes receives a SIGHUP signal

> before the reboot, but not always.

>

> can someone please clarify what actions are done when

> performing init 6 and what should i do to insure my

> process receives the SIGTERM.

I would never rely on getting a signal at shutdown. I would either use an rc script in rc0.d, or I would construct it as a valid Solaris 10 Service, and have SMF call the stop method at the correct point in time.

--

Darren

Darren_Dunhama at 2007-7-12 8:32:36 > top of Java-index,Solaris Operating System,Solaris 10 Features...