Skip site navigation (1)Skip section navigation (2)
Date:      14 Jun 2001 23:00:12 +0200
From:      Cyrille Lefevre <clefevre-lists@noos.fr>
To:        Robert Watson <rwatson@FreeBSD.ORG>
Cc:        "Koster, K.J." <K.J.Koster@kpn.com>, Robert Withrow <bwithrow@nortelnetworks.com>, Cyrille Lefevre <clefevre@redirect.to>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: import NetBSD rc system
Message-ID:  <snh2n5er.fsf@gits.dyndns.org>
In-Reply-To: <Pine.NEB.3.96L.1010614113409.27518D-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1010614113409.27518D-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson <rwatson@FreeBSD.ORG> 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:clefevre@redirect.to   UNIX is user-friendly; it's just particular
work: mailto:Cyrille.Lefevre@edf.fr   about who it chooses to be friends with.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?snh2n5er.fsf>