Question About ircd.pid

These are old archives. They are kept for historic purposes only.
Post Reply
GhostChildren
Posts: 2
Joined: Wed Dec 22, 2004 5:36 pm

Question About ircd.pid

Post by GhostChildren »

In the event of a crash/shutdown, does Unreal remove the ircd.pid file from it's directory, or does it stay until the next start? I'm writing a small shell script to check whether or not the IRCd is running so it would be helpful to know what happens to the file. Thanks. :)
codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post by codemastr »

Well, if Unreal crashes, there is no way for it to do anything (it's dead) so no, it won't delete the file. The standard way to test if a process is running (as can be seen in the chkircd script) is to send it a SIGCHLD
-- codemastr
GhostChildren
Posts: 2
Joined: Wed Dec 22, 2004 5:36 pm

Post by GhostChildren »

I see, thanks. I'm looking at the chkircd script and I have two questions if someone wouldn't mind.

First, is there an advantage to using the "test -r" command to see if the pid file exists over merely using the -e switch with if?

Second, in the line:

Code: Select all

if `kill -CHLD $ircdpid >/dev/null 2>&1`; then
What does the 2>&1 do at the end there?
codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post by codemastr »

This is UnrealIRCd support, not shell scripting. If you need help with shell scripting, I'd suggest you use Google. A quick search answered both of your questions
http://www.faqs.org/docs/abs/HTML/fto.html
http://wks.uts.ohio-state.edu/unix_cour ... EADING69-0
-- codemastr
Post Reply