Re: service starting (119 Views)
Reply
Super Advisor
kunjuttan
Posts: 392
Registered: ‎12-15-2009
Message 1 of 10 (119 Views)
Accepted Solution

service starting

How to start and stop services in HP-UX?
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 25,007
Registered: ‎03-06-2006
Message 2 of 10 (119 Views)

Re: service starting

Please use plain text.
Honored Contributor
R.K. #
Posts: 705
Registered: ‎05-20-2008
Message 3 of 10 (119 Views)

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
Please use plain text.
Super Advisor
kunjuttan
Posts: 392
Registered: ‎12-15-2009
Message 4 of 10 (119 Views)

Re: service starting

Thanks.But I want to know something like

"service network restart" in linux is there in hp-ux?
Please use plain text.
Honored Contributor
Jeeshan
Posts: 2,084
Registered: ‎11-05-2007
Message 5 of 10 (119 Views)

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
Please use plain text.
Honored Contributor
rariasn
Posts: 1,135
Registered: ‎08-09-1999
Message 6 of 10 (119 Views)

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,

Please use plain text.
Honored Contributor
OldSchool
Posts: 3,372
Registered: ‎09-09-2004
Message 7 of 10 (119 Views)

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
Please use plain text.
Honored Contributor
Bill Hassell
Posts: 14,205
Registered: ‎05-29-2000
Message 8 of 10 (119 Views)

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.

Please use plain text.
Super Advisor
kunjuttan
Posts: 392
Registered: ‎12-15-2009
Message 9 of 10 (119 Views)

Re: service starting

So,say if I want to stop NFS service what should be done?
Please use plain text.
Honored Contributor
R.K. #
Posts: 705
Registered: ‎05-20-2008
Message 10 of 10 (119 Views)

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
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation