1838577 Members
4037 Online
110128 Solutions
New Discussion

Re: startup script

 
Mario_88
Advisor

startup script

Hello:

In a startup script, can we launch a command in background.

$PATH/process &

Regards,
Mario.

9 REPLIES 9
Bharat Katkar
Honored Contributor

Re: startup script

Yes ... you can
Regards,
You need to know a lot to actually know how little you know
Manish Srivastava
Trusted Contributor

Re: startup script

Hi,

You can do that. Add the command in the rc scripts in /sbin/rc[0 1 2 3].d

manish
Sanjay Kumar Suri
Honored Contributor

Re: startup script

Definitely. You can.

sks



A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Fabio Ettore
Honored Contributor

Re: startup script

Hi Mario,

yep, in general you can do it.
Anyway two questions sting my curiosity:
1. why do you want to insert a process in a startup script?
2. what is the process?

Anyway it is dangerous to modify startup scripts of the system, as long as you have a your customized startup script under /sbin/init.d.

Best regards,
Ettore
WISH? IMPROVEMENT!
Mario_88
Advisor

Re: startup script

Hello:

The process is Patrol, and I am asking this because the init script is not working when the system is rebooted although it works perfectly if I execute it when the system is up.

Regards,
Mario.
Sanjay Kumar Suri
Honored Contributor

Re: startup script

Is the configuration parameter for the script in /etc/rc.config.d directory suitably set?

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Jan Sladky
Trusted Contributor

Re: startup script

Hi Mario,

You can do that and check it in /etc/rc.log

br Jan
GSM, Intelligent Networks, UNIX
Fabio Ettore
Honored Contributor

Re: startup script

Hi,

as Jan said you can see /etc/rc.log in order to know what's going on init script.

That can help you.

Please let us know if you solve the problem. It can be useful for future reference. And, not for last, please don't forget to assign points for guys that helped you.

Thanks for your collaboration.

Best regards,
Ettore
WISH? IMPROVEMENT!
Michael D'Aulerio
Regular Advisor

Re: startup script

Mario,

I have some startup scripts that launch background processes and then exit. I found that they didn't always execute properly. What worked for me was to nohup the process, e.g.

nohup ${PATH}/process &

This sends all its output to the rc.log file so you may want to consider:
nohup ${PATH}/process >$out_file 2>&1 &

Mike
Email: michael.n.daulerio@lmco.com