Running Processing

Hello,

 I have a question about running processes on my Sun. I want to know how I can find where these threads are being spawned from. I know about the /etc/init and /etc/rc\#.d directories and how to stop some services from running. It does not seem as if all of the daemons that are started are here, for example sendmail, where in sol 8 tells the sendmail daemon to run and details the switches to execute when it starts... I am new to Solaris, did experiment with Linux, which I think is a little clearer.. Any help will be appreciated.

-AJ

You also have...
/etc/inittab
...and...
/etc/inetd.conf
...which may contain daemon processes to start
at various run levels.

You can always do a ps -ef and look at the parent process id. Then do a ps -ef on the parent PID recursively until you finally track down what started it. This should work well for most processes that weren't started by init, inittab, rc, or inetd. Some processes will have a parent PID of 1 in which case this method won't work.

As stated, processes can also be started by inetd or from the inittab. Sendmail is started in the /etc/rc2.d directory, specifically /etc/rc2.d/S88sendmail by default under Solaris 8. Make sure you check all of the /etc/rc[1-3].d directories for the startup script you are searching for. Services like telnet, ftp, spray etc. are started from inetd. Basically, the process (ftp for example) does not run all the time, but rather inetd listens on all ports for services that are defined in the /etc/inet/inetd.conf file and spawns the service when something tries to talk on the port being listened to. The /etc/inittab file gives the ability to respawn processes that die automatically and more.

Thanks for that concise answer. I was just looking at the s88sendmail script before your posting..Answer me this, I am running run level 3, that would be rc3 scripts. Where does it say, while running rc3 startup scripts, 0 to start the sendmail services from rc2.d directory?

-AJ

You should have a script called...
/etc/rc.d/rc
...this script determines which set of scripts
to run based on the run level.