Operating System - HP-UX
1834771 Members
2919 Online
110070 Solutions
New Discussion

Re: checking daemon process

 
SOLVED
Go to solution
Chern Jian Leaw
Regular Advisor

checking daemon process

Hi,

Is there a way to check any running daemon processes?

Could someone please show me how ?

Thanks.
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: checking daemon process

What do you want to check it for? You can use ps -ef |grep to check for it's existence. You could use glance to peek inside the process to see what it's doing.

Can you be more specific?

Pete

Pete
Chern Jian Leaw
Regular Advisor

Re: checking daemon process

Pete,

I'm wanting to check if I have some rsync daemons running or any other process daemons running, in general.

Any ideas?

Thanks.
Clemens van Everdingen
Honored Contributor

Re: checking daemon process

Hi,

You could use ps -ef|grep rsync

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
T G Manikandan
Honored Contributor

Re: checking daemon process

If you are running rsync as a daemon then you should find for rsyncd

ps -ef|grep rsyncd


Thanks
Pete Randall
Outstanding Contributor

Re: checking daemon process

In that case, follow Clemens and T G's advice. Use "ps -ef |grep rsyncd". You'll (hopefully) see two lines returned - one is your grep command and the other is the daemon.

Pete

P.S. You can eliminate the extra line by doing "ps -ef |grep rsyncd |grep -v grep".

Pete
James R. Ferguson
Acclaimed Contributor
Solution

Re: checking daemon process

Hi Chern:

A more exact way of verifying the presence of a prcoess is to search the process table for its basename:

# UNIX95= ps -C syslogd|awk 'NR>1'

Note that the UNIX95 option is only set for the duration of the command line. A blank (space) follows the equal sign. The argumennt after the 'ps -C' option is the basename of the process you are seeking. Multiple arguments are allowed, too by repeating the '-C 'basename' sequence.

By piping the output to 'awk' as shown, the heading line is suppressed.

If only the process pid is wanted, do this:

# UNIX95= ps -C syslogd|awk 'NR>1 {print $1}'

Regards!

...JRF...