From owner-freebsd-hackers Thu Jun 14 14: 0:24 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.noos.fr (claudel.noos.net [212.198.2.83]) by hub.freebsd.org (Postfix) with ESMTP id 5ED3537B406 for ; Thu, 14 Jun 2001 14:00:19 -0700 (PDT) (envelope-from clefevre@redirect.to) Received: (qmail 3376640 invoked by uid 0); 14 Jun 2001 21:00:17 -0000 Received: from unknown (HELO gits.dyndns.org) ([212.198.228.81]) (envelope-sender ) by 212.198.2.83 (qmail-ldap-1.03) with SMTP for ; 14 Jun 2001 21:00:17 -0000 Received: (from root@localhost) by gits.dyndns.org (8.11.3/8.11.3) id f5EL0DF98033; Thu, 14 Jun 2001 23:00:13 +0200 (CEST) (envelope-from clefevre@redirect.to) To: Robert Watson Cc: "Koster, K.J." , Robert Withrow , Cyrille Lefevre , freebsd-hackers@FreeBSD.ORG Subject: Re: import NetBSD rc system References: X-Face: V|+c;4!|B?E%BE^{E6);aI.[<97Zd*>^#%Y5Cxv;%Y[PT-LW3;A:fRrJ8+^k"e7@+30g0YD0*^^3jgyShN7o?a]C la*Zv'5NA,=963bM%J^o]C Reply-To: Cyrille Lefevre In-Reply-To: Mail-Copies-To: never From: Cyrille Lefevre Date: 14 Jun 2001 23:00:12 +0200 Message-ID: Lines: 53 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Robert Watson 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