1833287 Members
2903 Online
110051 Solutions
New Discussion

Re: services

 
SOLVED
Go to solution
Shah Gaurang B.
Frequent Advisor

services

in hp-ux how to start , stop or view services by command ? i have to do this manualy pl. help me , after replacing subnet of my lan card i have to restart network services .
11 REPLIES 11
John Dvorchak
Honored Contributor

Re: services

I would use SAM and make the changes there. It will automatically restart the network with the new subnet.

Start sam and got to Networkinging and Communications then to Network cards. Select the card and make the changes.
If it has wheels or a skirt, you can't afford it.
Shah Gaurang B.
Frequent Advisor

Re: services

how to do without using sam ?
Florian Heigl (new acc)
Honored Contributor

Re: services

for this task You could simply call
/sbin/init.d/net stop
/sbin/init.d/net start
and hope.

BUT... there may be other network bound processeses needing restart/reconfiguration.

If downtime is acceptable, simply lower and raise the system runlevel to 1 and back up to 3 (commands: init 1 (then wait until it says 'runlevel transition completed') init 3 (dito)

otherwise You'll have to look at all processes running and see what needs to be taken care of.

the best way to periodically check for this is running
netstat -na | grep LISTEN

look for anything that is not bound to 0.0 but the old IP address, unlike the following example.
tcp 0 0 *.22 *.* LISTEN


Also, there is a chance that restarting inetd is enough.

[ and, for the future, You should take notes of all You change and find, as You should know what's running on Your systems.]
yesterday I stood at the edge. Today I'm one step ahead.
Florian Heigl (new acc)
Honored Contributor

Re: services

I hope I understood it right, that the ip / subnet config change is already done, yes?
yesterday I stood at the edge. Today I'm one step ahead.
Pete Randall
Outstanding Contributor

Re: services

Depends on your lan adapter and it's driver:


/sbin/init.d/hpbtlan stop/start
/sbin/init.d/hpether stop/start
/sbin/init.d/hpgelan stop/start
/sbin/init.d/hpiether stop/start
/sbin/init.d/hpigelan stop/start


Pete

Pete
Shah Gaurang B.
Frequent Advisor

Re: services

i have to view all services which are running and to make start or stop as i needed so help me on that way .
Pete Randall
Outstanding Contributor

Re: services

All services????

shutdown -r -y 0


Pete

Pete
Bharat Katkar
Honored Contributor
Solution

Re: services

Hi,

The list of services available on HPUX are listed in /etc/services.
You can use "ps -ef" to know what all services are running.
Also if you like to start/stop services then you should look for the related scripts that are kept in /sbin/init.d

For e.g. if i want to start nfs service on HP i would do:
# /sbin/init.d/nfs.core start
# /sbin/init.d/nfs.server start

This run core nfs services and the nfs server.

Similarly for stopping use:
# /sbin/init.d/nfs.server stop
# /sbin/init.d/nfs.core stop

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Bill Hassell
Honored Contributor

Re: services

There is no simple way to find all the network programs that are using the LANs. There are specific services that are enabled in inetd.conf and there are other services documetned by name and port in the services file, but there may be several processes that communicate with each other using network ports. netstat can help but you will have a much more stable system by rebooting. Once you've enabled the network changes on a particular card, all the connections will likely fail. There is little possbility that a connection will survive a subnet change.


Bill Hassell, sysadmin
Cesare Salvioni
Trusted Contributor

Re: services

Hi
to see al the network services the host is offering try netstat -a| grep LISTEN

Network services are started in 2 way: directly from a specific script in /sbin/init.d (eg /sbin/init.d/xfs start the X11 font server service) or from the daemon inetd (see the file /etc/inetd.conf for the configured services)

First kind of services may be stopped started with /sbin/init.d/<script name> stop followed by /sbin/init.d/<script name> start
For the second one you must modify the file /etc/inetd.conf commenting and uncommenting services ou want/do not want run and then execute inetd -c

Anyway i'm not sure to understand why u wanna do that, if you only change the network card configuration the services will be immediately available on the new IP address.

Please explain better your goal !!
hope it helps
Florian Heigl (new acc)
Honored Contributor

Re: services

Shah,

the only safe way of detecting *all* network services is to look through the lists of open network ports (LISTEN) like I already put in an example. (optionally one can then install lsof and use lsof -p to find the binary in question)

As You don't yet know which services are running on Your system, You just have to work this out manually. Advantage: afterwards You'll know it :)
yesterday I stood at the edge. Today I'm one step ahead.