Showing results for 
Search instead for 
Do you mean 

service starting

SOLVED
Go to Solution
Super Advisor

service starting

How to start and stop services in HP-UX?
1 ACCEPTED SOLUTIONS
Honored Contributor Honored Contributor

Re: service starting

Hi Dipesh,

/sbin/rc*.d directories determine at which run levels services start and stop.
/sbin/rc runs S scripts to start services during system startup.
/sbin/rc runs K scripts to kill services during system shutdown.

Every service started by /sbin/rc has an associated script in /sbin/init.d.
/sbin/init.d scripts contain code needed to start/kill services.
/sbin/rc*.d/* scripts are just symbolic links to /sbin/init.d scripts!

Some Examples:

NFS Service
/sbin/init.d/nfs.server stop
/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.core stop

/sbin/init.d/nfs.core start
/sbin/init.d/nfs.client start
/sbin/init.d/nfs.server start

Network Service
/sbin/init.d/net stop
/sbin/init.d/net start
Don't fix that what ain't broke
9 REPLIES
Acclaimed Contributor Acclaimed Contributor
Honored Contributor Honored Contributor

Re: service starting

Hi Dipesh,

/sbin/rc*.d directories determine at which run levels services start and stop.
/sbin/rc runs S scripts to start services during system startup.
/sbin/rc runs K scripts to kill services during system shutdown.

Every service started by /sbin/rc has an associated script in /sbin/init.d.
/sbin/init.d scripts contain code needed to start/kill services.
/sbin/rc*.d/* scripts are just symbolic links to /sbin/init.d scripts!

Some Examples:

NFS Service
/sbin/init.d/nfs.server stop
/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.core stop

/sbin/init.d/nfs.core start
/sbin/init.d/nfs.client start
/sbin/init.d/nfs.server start

Network Service
/sbin/init.d/net stop
/sbin/init.d/net start
Don't fix that what ain't broke
Super Advisor

Re: service starting

Thanks.But I want to know something like

"service network restart" in linux is there in hp-ux?
Honored Contributor Honored Contributor

Re: service starting

All services are reside in /sbin/init.d folder.

Pointing in specific services and check with the corresponding scripts.
a warrior never quits
Honored Contributor Honored Contributor

Re: service starting

Hi,

The file /etc/services associates official service names and aliases with the port number and protocol the services use. For each service a single line should be present with the following information:



Port numbers 0 through 1023 are assigned by RFC 1700. This RFC also lists the conventional use of various ports with numbers greater than 1023.

Aliases are other names under which a service is known. Library routines such as getservbyname() can be invoked with a service alias instead of the service official name. For example:

shell 514/tcp cmd

rgs,

Honored Contributor Honored Contributor

Re: service starting

"Thanks.But I want to know something like

"service network restart" in linux is there in hp-ux?"

nope...remember the GNU means "Gnu's not UNIX."

you start and stop the various components with the "rc" scripts noted previously
Honored Contributor Honored Contributor

Re: service starting

You can make each OS look like another OS with a lot of work. For instance, you are looking for the "service" command. It does not exist in HP-UX. So you can write a script that does this:

#!/usr/bin/sh
/sbin/init.d/$@

Now you can pretend that you are running Linux and type something like:

service xntpd stop

and it will work. But:

service sendmail restart

won't work because HP-UX ain't Linux. The start/stop (rc) scripts only recognize start and stop, not restart. Likewise,

service network start

won't work because there is no start/stop script in /sbin/init.d called network.

Which means you need to learn more about HP-UX system administration.

Super Advisor

Re: service starting

So,say if I want to stop NFS service what should be done?
Highlighted
Honored Contributor Honored Contributor

Re: service starting

Hi..

NFS services should be stopped/started in following order.

NFS Service
Stopping:
/sbin/init.d/nfs.server stop #(for nfs server)
/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.core stop

Starting:
/sbin/init.d/nfs.core start #(for nfs server)
/sbin/init.d/nfs.client start
/sbin/init.d/nfs.server start

Don't fix that what ain't broke