Operating System - HP-UX
1753914 Members
8916 Online
108810 Solutions
New Discussion юеВ

Re: to start a daemon on server boots up

 

to start a daemon on server boots up

I have Tacacs + running,one of my HP server. This is an old server, I need to set up the same Tacacs + on a new hp server. I was able to set up it on the new server. But I have to start the TACACS+ daemon manually, because I cant find from where this daemon is starting on the old server. How do I make the daemon to run, when the server boots.
no personal quote
14 REPLIES 14
Stefan Farrelly
Honored Contributor

Re: to start a daemon on server boots up

You need to write a script and put it into /sbin/init.d then create a link from /sbin/rcX.d (where X is the runlevel you want it to start under, eg. 3) to /sbin/init.d/The link starts with an Sxxx for startup, or Kxxx for shutdown. You will see lots of other scripts in there, just pick a unique number for S/Kxxx
Im from Palmerston North, New Zealand, but somehow ended up in London...
Heinz Gaertner
Advisor

Re: to start a daemon on server boots up

Hi,

two ways:
1) startup-script in /sbin/init.d
check the template file in this directory, you can use it to write your own
2) entry in /etc/inittab
this is probably the way it works on the old machine
If you're not familiar with either startup-scripts or inittab let us know and cannot go on with the manpages let us know again.

Bye
Heinz
Jerome Baron
Respected Contributor

Re: to start a daemon on server boots up

Hi,

to start a daemon at boot put a script in /sbin/init.d.

And make a symbolyc link in /sbin/rci.d (i is your start level number).

To perform the script you have a model in /sbin/init.d named template.

Regards,
Jerome
Printaporn_1
Esteemed Contributor

Re: to start a daemon on server boots up

1. goto /sbin/init.d/
copy template and make modification to start your application.

2. make link file for start up and shutdown in /etc/rcXX.d

3if file that create in number 1 need to check parameter you can add it in /etc/rc.config.d/

you can see example that already exist

/sbin/init.d/lp
/sbin/rc2.d/S720lp
/sbin/rc1.d/K280lp
/etc/rc.config.d/lp



enjoy any little thing in my life
Steven E. Protter
Exalted Contributor

Re: to start a daemon on server boots up

Prior post is where the startup script has to be.

You can copy /sbin/init.d/template to be your template for the startup script.

cp /bin/init.d/template /sbin/init.d/newscript

This script requires start or stop as $1 argument

To create a startup run level 3 to that script its.

cd /sbin/rc3.d

ln -s /sbin/init.d/newscript S999newscript

for stopping it run level 2

cd /sbin/rc2.d
ln -s /sbin/init.d/newscript K999newscript


An example always helps.

Good luck.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
kish_1
Valued Contributor

Re: to start a daemon on server boots up

I think you are looking for the daemon of Tacacs+,I never worked on this, since you have a working machine (old machine) , you can find it form startup script of old machine ( /sbin/init.d/xxxx. and /etc/rc.config.d/xxxx.
also you can find it from /etc/rc.log,
share the power of the knowledge
Angus Crome
Honored Contributor

Re: to start a daemon on server boots up

I believe this could also be setup in /etc/inetd.conf
There are 10 types of people in the world, those who understand binary and those who don't - Author Unknown
Juan Manuel L├│pez
Valued Contributor

Re: to start a daemon on server boots up

Hi all.
You have to make the next steps:

1. First off al. you have to put a new file ( you can use another file on the same directory, copy an modify it ), on /sbin/init.d/< my daemon script file name >
On it, put the start and stop process to your daemon.

2. Then, on /etc/rcconfig.d/< my daemon script file name >, put the variable=1, the same that you use on /sbin/init.d/my daemon script file name

3. /sbin/rcx.d ( x= 2 to stop, 3 to start )
Create a links to your /sbin/init.d/ with the same criteria:
Kxxx to stop on rc2
Sxxx to stop on rc3

xxx should be a total of 1000, I mean: you can put 009 to stop and 991 to start.


I hope this help you.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Marco Santerre
Honored Contributor

Re: to start a daemon on server boots up

Just to add to what Juan Manuel is saying, if you don't have a start/stop script readily available, in the /sbin/init.d, you will find a file named template which contains a start/stop and is pretty standard with everything else HP has implemented. You just need to include your different steps to start or stop your application and voila! You continue with step 2 and 3 from Juan Manuel
Cooperation is doing with a smile what you have to do anyhow.