Operating System - HP-UX
1748061 Members
5268 Online
108758 Solutions
New Discussion

List running services, corresponding package and the status.

 
Happy1983
Occasional Collector

List running services, corresponding package and the status.

Hi,

 

I am looking to list down all the services, corresponding package name and the services status on HP-UX.

In Linux (Centos), I use chkconfig to achieve this .. i.e. list all running services, corresponding package and the status.

 

However, we dont have chkconfig equivalent on HP-UX but I have a clue that we have some catch in /etc/init.d or related directories - regarding the installed services. Though, not sure how can we extract reuqired information from here and use the same. The requirement is basically for a CSV output with following:- "Service Name", "Package Name", "Status".

 

Please provide any pointers available on this.

 

Thanks.

4 REPLIES 4
Bill Hassell
Honored Contributor

Re: List running services, corresponding package and the status.

The simple equivalent for chkconfig is to cat /etc/inetd.conf.

You can also list this file without comments and blank lines with:

 

awk 'NF && ! /^[[:space:]]*#/' /etc/inetd.conf

 A grep for these inetd daemons will only show those stay active. Many service daemons will close after an idle period.

 

init (see /etc/inittab) can spawn some programs although its use for services is not as common as it was decades ago. The /etc/inittab file lists each of the processes where respawn will restart a process if it stops. Most of inittab is setup for boot processes.

 

The term package in HP-UX usually refers to an application collection that runs under Service Guard, the clustering product from HP.

 



Bill Hassell, sysadmin
Happy1983
Occasional Collector

Re: List running services, corresponding package and the status.

Hi, 

 

I tried extracting info from /etc/inetd.conf. This shows a list of running services, is what you mean?

Any idea what does the other fields imply?

 

I wanted the extract to be as follows:- "Service Name", "Package Name", "Status".

 

Please confirm if its possible to extract information in such a manner.

 

Thanks.

 

Regards.

Dennis Handly
Acclaimed Contributor

Re: List running services, corresponding package and the status.

>I tried extracting info from /etc/inetd.conf. This shows a list of running services, is what you mean?
>Any idea what does the other fields imply?

 

They are comments at the top for each of the 7 fields and also inetd.conf(4).

 

>I wanted the extract to be as follows: "Service Name", "Package Name", "Status".

 

These aren't in this file, only "Service Name" and "server program".

 

As Bill mentioned, demons are started by inetd(1m), init(1M) and rc(1m).  See inittab(4) and rc.config(4) and

 /sbin/init.d/.

RJHall
Frequent Advisor

Re: List running services, corresponding package and the status.

You could also take a look at the output from Lsof. I.e. /opt/iexpress/lsof/bin/lsof -i