Making a Named Daemon


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Making a Named Daemon
# 1  
Old 10-26-2006
Making a Named Daemon

I have a PHP CLI script that runs as a daemon. I have a cron job that checks every 5 minutes if that script is running. PHP slowly builds up memory and then eventually dies. I want to write a Bourne script wrapper around it to prevent this. However, I can't get my monitor script to search properly because there are other processes running under SH when I do a top or ps check.

I'm hoping someone can help me with a way to explicitly have the name of my script show up in the ps or top command instead of /bin/sh. I've used 'ps -a | grep myapp' but no matter what I see the results of the grep command even if the application is running and this is undesirable because I want to either see that the process is running or not.

Thanks.
# 2  
Old 10-26-2006
I think what you want to do is just filter out the grep:

Code:
ps -a | grep myapp | grep -v grep

# 3  
Old 10-26-2006
dangral, Thank you. This will help me for now. This gives me only the process I'm looking for.
# 4  
Old 10-26-2006
Quote:
Originally Posted by dangral
I think what you want to do is just filter out the grep:

Code:
ps -a | grep myapp | grep -v grep

or better yet:
ps -a | grep [m]yapp
# 5  
Old 10-26-2006
that works great too Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

separate "named daemon" message from /var/adm/messages

Hello group, How can I separate "named daemon" messages to the other file instead of /var/adm/messages. I still want all other daemons log the messages to /var/adm/messages. i.e. named => /var/adm/named.message other daemons => /var/adm/messages. I searched unix.com, and google but I still... (5 Replies)
Discussion started by: dannytrinh
5 Replies

2. UNIX for Dummies Questions & Answers

Named Pipes

hi, i am working on a script for oracle export, m using a parameter file... i want to compress the dump file that is generated.. in my script following is the code i have written. i am not able to generata .gz file mknod /tmp/exp_tesd1_pipe p gzip -cNf... (4 Replies)
Discussion started by: saharookiedba
4 Replies

3. Shell Programming and Scripting

named pipes

How to have a conversation between 2 processes using named pipes? (5 Replies)
Discussion started by: kanchan_agr
5 Replies

4. UNIX for Dummies Questions & Answers

Named PIPE

Gurus, I've a File Transaction Server, which communicates with other servers and performs some processing.It uses many Named PIPE's. By mistake i copied a named PIPE into a text file. I heard that PIPE files shouldn't be copied.Isn't it? Since it's a production box, i'm afraid on... (2 Replies)
Discussion started by: Tamil
2 Replies

5. UNIX for Advanced & Expert Users

named and nslookup

Guys , Am using Linux - Red Hat 6.1 . My DNS and nslookup command was working fine and ppl. can resolve through this server . but i changed something in /etc/named.conf , that stopped the DNS . The named proccess is working , but nslookup command is not , i get this error message : ... (3 Replies)
Discussion started by: tamemi
3 Replies

6. UNIX for Dummies Questions & Answers

named

Dear All , Kindly i would like to start the named whenever the system reboot , currently i start it manually . for more info. i have both named , one from SUN , and other one i installed it from internet , now i want the one from SUN to start automatically when rebooting . its path is :... (5 Replies)
Discussion started by: tamemi
5 Replies

7. Shell Programming and Scripting

named pipes

Hi I am having trouble with a script to export individual schemas to tape from an oracle database. Basicaly I need to export each shema through a pipe with compression and store each shema name in a file with the relevant tape marker. (4 Replies)
Discussion started by: truma1
4 Replies

8. IP Networking

DNS daemon named

I found the /usr/sbin/in.named file but it is encoded. I tried the /usr/sbin/ndc rstart command to start the DNS server but it didn't work. Are there any other commands to start the DNS server beside the one I tried? (4 Replies)
Discussion started by: Deuce
4 Replies
Login or Register to Ask a Question