Operating System - HP-UX
1834058 Members
2590 Online
110063 Solutions
New Discussion

Re: automatic service start-up

 
SOLVED
Go to solution
Maciej Szewczykowski
Frequent Advisor

automatic service start-up

dear All,
i would like to ask for your help in quite an easy matter.
my question is: how to configure a certain service in such a way that it is started automatically when the system goes up?
i have a custom samba server running and i don't want to start it manually each time the system is rebooted. is there anything here in HPUX resembling the WIN's "autostart" group, so that i would be able to add service to it?

thank you in advance,

regards,

maciek
5 REPLIES 5
Simon Hargrave
Honored Contributor
Solution

Re: automatic service start-up

UNIX service startup is controlled with rc scripts. If you don't know about them, read first here:

http://www.unixhub.com/docs/hpux/hpux_boot.html

This describes how the boot process uses the rc scripts.

Then you need to make and link one to suit whatever you want to start.

HP provide a template called /sbin/init.d/template. Copy this to eg /sbin/init.d/myservice and edit to that it will start and stop your script as expected. Then link it's start and kill scripts in /sbin/rcX.d directories as required.
Warren_9
Honored Contributor

Re: automatic service start-up

In /etc/rc.config.d/samba,
change the RUN_SAMBA value from 0 to 1 to disable the autostart.

Ralph Grothe
Honored Contributor

Re: automatic service start-up

Most properly ported software already comes with a fitting init script.
So with these usually all that's left to be done is enable a switch in a config file in /etc/rc.config.d/ (i.e. setting a variable to either 1 or 0), and creating softlinks that point from the init runlevel subdirs where the application should either be started or stopped to the init script.
Some ports like e.g. the HP-UX OpenSSH port Secure Shell even do these minor tasks for you already as a postinstallation step.

However sometimes you have to write an init run shell script for an application oneself.
But this usually only requires minor mastery of shell scripting.
To ease things HP-UX provides a file
/sbin/init.d/template
that you simply copy and use, as the name suggests, as a template file that you only modify or extend very little.

To learn more about the HP-UX SysV init process I'd advise you to carefully read the manpages of init and rc.
Though generally most SysV Unices behave similarly there are subtle differences in the init process e.g between Solaris and HP-UX.

Madness, thy name is system administration
Ganesha Sridhara
Honored Contributor

Re: automatic service start-up

Hello Maciek,

Please check this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=903953

Regards
Ganesha Sridhara
Cem Tugrul
Esteemed Contributor

Re: automatic service start-up

Maciek,

As an addition to other correct replies
you can keep such a kind of doc.
Good luck,
Our greatest duty in this life is to help others. And please, if you can't