LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   how to put my script in bootup (https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-put-my-script-in-bootup-596003/)

packets 10-31-2007 02:11 AM

how to put my script in bootup
 
I'm new to Solaris. I have setup a Mail server using java as an MTA and installed Clamav for antivirus. I copy the script of clamd to /etc/init.d.
I usually up the clamd using /etc/init.d/clamd start


The question is how can I put the script in boot mode? When I restart, it will automatically run and no need to login just to up the clamav

How can I know the current level mode?

Disillusionist 10-31-2007 03:03 AM

You are half way there, you have a startup script in /etc/init.d

Check which runlevel you use(example):
Code:

who -r
run-level 2 2007-10-28 17:02

If as in the example this runs in level 2 then as root:

Code:

ln –s /etc/init.d/clamd /etc/rc2.d/S99clamd

packets 10-31-2007 03:07 AM

Thanks for the reply

crisostomo_enrico 10-31-2007 12:27 PM

Which version of Solaris are you using?

If supported, I would suggest writing a service manifest for the service to be managed by SMF. The system documentation is sufficient to easely complete the task.

Regards,
Enrico.


All times are GMT -5. The time now is 06:22 PM.