Skip to contentSkip to conversation

Detecting running deamons

DISCUSSION Luciano Moreira - igLnx 2 participants 2 messages Mar 28, 2003

lore
Share & tools
lore
#0 lore raw

I have a application that run like a deamon, which write in a file its PID, that is used to stop it later by others programs. But, I ve noted that my users send signal 9 to stop deamons, and my application cannot remove its PID file, because it cannot handle singal 9, keeping its PID file at HD (FileSystem).

Can someone sugest me a way to know the deamon's PID, without write it to a file ?
OR
How can I do to know if my deamon is running and get its PID ?

Thanks,

Luciano

#1 lore raw
Quoted 11 lines · Luciano Moreira - igLnx

I have a application that run like a deamon, which write in a file its PID, that is used to stop it later by others programs. But, I ve noted that my users send signal 9 to stop deamons, and my application cannot remove its PID file, because it cannot handle singal 9, keeping its PID file at HD (FileSystem).

Can someone sugest me a way to know the deamon's PID, without write it to a file ?
OR
How can I do to know if my deamon is running and get its PID ?

On the command-line:
pidof which program_name
or:
ps aux | grep program_name
or perhaps interactive?:
top

Quoted 1 line

Thanks,

No problemo

Quoted 1 line

Luciano

J.