Robert Watson <[EMAIL PROTECTED]> writes:
> On Thu, 14 Jun 2001, Koster, K.J. wrote:
>
[snip]
> > How about /var/run/{$deamon}.pid?
>
> So, one of the things I've always hated (and loved) about UNIX is the pid
> system. One of the problems I have with (foo).pid is that pid's are
> rapidly recycled, so if a daemon dies, there's no way to track that unless
> you're a parent process (wherein you can reliably get the exiting
> information via SIGCHLD and wait()). The same goes for using killall as
> the superuser to find and kill processes such as inetd by name: you can
> easily kill other things if there are user processes with the same name,
> etc. In my view, the only really reliable way to manage daemon processes
> is as the parent of the process. Unfortunately, changing to that model
> would be a time-consuming, compatibility-limiting process which will
> probably not prove feasible.
I'm currently enhancing the ps command to SUSV2 specifications and
more. this will allow you to find a process by both matching on it's
name and pid such as :
# SUSV2=1 ./ps -C getty
PID TT TIME COMMAND
1814 v1 00:00:00 getty
1815 v2 00:00:00 getty
1816 v3 00:00:00 getty
# SUSV2=1 ./ps -C getty -p 1814
PID TT TIME COMMAND
1814 v1 00:00:00 getty
# SUSV2=1 ./ps -C getty -p 1818
PID TT TIME COMMAND
hope this could be usefull is such case.
it's also possible to enhance killall to work the same way for safety
reason.
> you out if it's your SSH daemon :-). Using IPC to manage the daemon, in
> the style of newer named versions, works well as long as you know the
> daemon is still functional--certainly much better than signals, with the
> exception of forceful termination.
also, there is the way AIX is going for a long time now using the
srcmstr daemon to manage (start, stop, list, etc.) other daemons.
http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixbman/admnconc/sys_res_overview.htm#A2729f9
Cyrille.
--
home: mailto:[EMAIL PROTECTED] UNIX is user-friendly; it's just particular
work: mailto:[EMAIL PROTECTED] about who it chooses to be friends with.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message