1833777 Members
1932 Online
110063 Solutions
New Discussion

Listing System services

 
Cliff Lim Kok Hwee
Regular Advisor

Listing System services

Hi Forum,

Is there a HP-UX and Solaris command to check if a daemon is running or stopped? (like I could use lssrc in IBM AIX environmnt)

Query: SUN Solaris #modinfo

For example

On IBM AIX,

#lssrc -a

Subsystem Group PID Status
syslogd ras 5198 active
sendmail mail 6452 active
portmap portmap 6710 active
inetd tcpip 6966 active
snmpd tcpip 7224 active
dpid2 tcpip 7482 active
muxatmd tcpip 7740 active
biod nfs 8776 active
rpc.statd nfs 9038 active
rpc.lockd nfs 9296 active

Thanks/cliff
7 REPLIES 7
Joseph Loo
Honored Contributor

Re: Listing System services

hi,

for SUN's modinfo, kmadmin is an alternate command in HPUX(man kmadmin for more info).

as for services/daemons running, i can only think of "ps -ef" for all processes running.

regards.
what you do not see does not mean you should not believe
Cliff Lim Kok Hwee
Regular Advisor

Re: Listing System services

Hi Forumers,

Any other advise.

ps -ef |grep

Is the only option I always doing :(

I was thinking of listing active system daemons to report.

Thanks/cliff
Joseph Loo
Honored Contributor

Re: Listing System services

hi cliff,

if u refer to this:

http://www.freelab.net/unix/hp-ux/chap06_proc.html

ps and top commands r the closest to lssrc for HPUX.

regards.
what you do not see does not mean you should not believe
Muthukumar_5
Honored Contributor

Re: Listing System services

You can try with a script as,

# for service in `grep -Ev '^#|^$' /etc/services | awk '{ print $1 }'`
do
ps -ef | grep -v grep | grep $service
done

on hp-ux. But Linux is having service command and ps -A to get all deamons only.

hth.
Easy to suggest when don't know about the problem!
Doug O'Leary
Honored Contributor

Re: Listing System services

Hey;

Using the assumption that daemons will *normally* be listening on a network port, you could get lsof to list out open network ports:

lsof -i | awk '$0 !~ /^COMM/ {print $1}'

As caveated; daemons don't necessarily operate network ports, but most of them do...

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
RAC_1
Honored Contributor

Re: Listing System services

Do not use grep. Use UNIX95 variable instead.

With grep, it is problem. Say you have a daemon as xxx and xxxyyy
if you do ps -ef| grep xxx, both will be listed. With UNIX95 variable, you can do it as follows.

UNIX95= ps -C xxx

UNIX95 is xpg4 conformance. For details see ps man page.

Anil
There is no substitute to HARDWORK
vinod_25
Valued Contributor

Re: Listing System services

hi cliff

try glance to list the process , a snapshot of glance :

B3692A GlancePlus C.03.72.00 04:48:47 clsnet01 9000/800 Current Avg High
--------------------------------------------------------------------------------
CPU Util S SU U | 72% 72% 72%
Disk Util FF | 3% 4% 7%
Mem Util S SU UB B | 85% 85% 85%
Swap Util U UR R | 21% 21% 21%
--------------------------------------------------------------------------------
PROCESS LIST Users= 18
User CPU Util Cum Disk Thd
Process Name PID PPID Pri Name ( 200% max) CPU IO Rate RSS Cnt
--------------------------------------------------------------------------------
opcctla 10697 1687 237 root 96.6/98.0 47410.9 0.0/ 0.0 2.3mb 1
pmd 16782 16779 154 root 41.6/39.0 157057 1.5/ 0.8 230.0mb 1
opcle 8813 1687 168 root 2.7/ 0.9 5708.9 0.0/ 0.0 2.0mb 3
netmon 15499 16779 154 root 1.1/ 1.5 638.4 0.0/ 0.0 10.2mb 1
ovas 16806 16779 168 root 0.0/ 0.1 346.3 0.0/ 0.0 34.4mb 20
ovrequestd 16784 16779 168 bin 0.0/ 0.2 686.4 0.0/ 0.0 30.2mb 15
ovdbrun 16800 1 154 root 0.0/ 0.6 2349.6 0.0/ 1.0 22.5mb 18
prm3d 1354 1 168 root 0.0/ 0.2 1059.8 0.0/ 0.0 63.2mb 20
vxfsd 35 0 138 root 0.0/ 0.1 648.4 2.6/ 4.2 1.8mb 23
swapper 0 0 127 root 0.0/ 0.0 12.5 2.3/ 0.9 32kb 1


regards

Vinod K