From owner-freebsd-questions@freebsd.org Fri Jun 2 15:48:50 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3B1BFA30E for ; Fri, 2 Jun 2017 15:48:50 +0000 (UTC) (envelope-from bblister@gmail.com) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1.freebsd.org (Postfix) with ESMTP id DBA1867B03 for ; Fri, 2 Jun 2017 15:48:50 +0000 (UTC) (envelope-from bblister@gmail.com) Received: from static.162.255.23.37.macminivault.com (unknown [162.255.23.37]) by mwork.nabble.com (Postfix) with ESMTP id 7F1BF46B9E9FE for ; Fri, 2 Jun 2017 08:48:50 -0700 (MST) Date: Fri, 2 Jun 2017 08:48:50 -0700 (MST) From: BBlister To: freebsd-questions@freebsd.org Message-ID: <1496418530514-6189230.post@n6.nabble.com> In-Reply-To: References: <1496397748172-6189171.post@n6.nabble.com> Subject: Re: Wrong Handling of pid files (example: fcgiwrap) forces single user mode. Am I correct? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 15:48:51 -0000 OK, I filled a report https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219724 If you issue onestart the bug is not triggered. Also, the bug with onerestart is not triggered all the time. For example, if you do rm /var/run/fcgiwrap/fcgiwrap.pid and then issue as root from the shell: /usr/local/etc/rc.d/fcgiwrap onerestart then you see usually: cat: /var/run/fcgiwrap/fcgiwrap.pid: No such file or directory Stopping fcgiwrap. kill: illegal process id: - Starting fcgiwrap. But, there is a race condition, because if you do a number of times: rm /var/run/fcgiwrap/fcgiwrap.pid and then debug the rc script with: rm /var/run/fcgiwrap/fcgiwrap.pid ; bash -x /usr/local/etc/rc.d/fcgiwrap onerestart you will eventually hit the single user mode, because the PID 1 is somewhere in the list: kill -TERM -- - 1 17009 17607 17654 1 1 1 1 1 86584 4245 5166 5929 80402 86559 if it is the first one like the previous example, then it will hit user mode immediately, otherwise the script may exit first before hitting the PID 1, like kill -TERM -- - 17009 17607 17654 1 1 1 1 1 86584 4245 5166 5929 80402 86559 -- View this message in context: http://freebsd.1045724.x6.nabble.com/Wrong-Handling-of-pid-files-example-fcgiwrap-forces-single-user-mode-Am-I-correct-tp6189171p6189230.html Sent from the freebsd-questions mailing list archive at Nabble.com.