Re: etc/rc.d scripts: strange message about kvm_getprocs during restar

From: Hajimu UMEMOTO <ume_at_mahoroba.org>
Date: Sat, 14 Feb 2004 04:22:22 +0900
Hi,

>>>>> On Fri, 13 Feb 2004 18:21:56 +0200
>>>>> Rostislav Krasny <rosti_bsd_at_yahoo.com> said:

rosti_bsd> When I run '/etc/rc.d/smth restart' I get a strange error message about 
rosti_bsd> kvm_getprocs:

rosti_bsd> localhost# /etc/rc.d/inetd restart
rosti_bsd> Stopping inetd.
rosti_bsd> ps: kvm_getprocs: No such process
rosti_bsd> Starting inetd.
rosti_bsd> localhost# /etc/rc.d/syslogd restart
rosti_bsd> Stopping syslogd.
rosti_bsd> ps: kvm_getprocs: No such process
rosti_bsd> Starting syslogd.
rosti_bsd> localhost#

rcNG expects that a pidfile is removed when a daemon exits.  However,
these daemons doesn't remove their pidfile.  The following patch is
for inetd:

Index: etc/rc.d/inetd
diff -u etc/rc.d/inetd.orig etc/rc.d/inetd
--- etc/rc.d/inetd.orig	Thu Feb 12 01:36:30 2004
+++ etc/rc.d/inetd	Sat Feb 14 04:16:48 2004
_at__at_ -16,6 +16,11 _at__at_
 pidfile="/var/run/${name}.pid"
 required_files="/etc/${name}.conf"
 extra_commands="reload"
+stop_postcmd="inetd_poststop"
+
+inetd_poststop() {
+    /bin/rm -f ${pidfile}
+}
 
 load_rc_config $name
 run_rc_command "$1"


Sincerely,

--
Hajimu UMEMOTO _at_ Internet Mutual Aid Society Yokohama, Japan
ume_at_mahoroba.org  ume_at_{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
Received on Fri Feb 13 2004 - 10:22:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:43 UTC