From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 09 22:48:06 2019 Received: (at submit) by debbugs.gnu.org; 10 Dec 2019 03:48:06 +0000 Received: from localhost ([127.0.0.1]:54670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ieWVK-000384-9W for submit@debbugs.gnu.org; Mon, 09 Dec 2019 22:48:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:33650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ieQ0V-0003Im-Pc for submit@debbugs.gnu.org; Mon, 09 Dec 2019 15:51:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38593) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ieQ0U-0002rT-DS for bug-guix@gnu.org; Mon, 09 Dec 2019 15:51:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ieQ0T-0002PW-66 for bug-guix@gnu.org; Mon, 09 Dec 2019 15:51:50 -0500 Received: from solo.fdn.fr ([80.67.169.19]:43609) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ieQ0S-0002Oc-WB for bug-guix@gnu.org; Mon, 09 Dec 2019 15:51:49 -0500 Received: from tanis.zero.void.nul (unknown [IPv6:2a03:7220:8081:c801:20e3:a9cb:5893:161e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: burban) by solo.fdn.fr (Postfix) with ESMTPSA id BA6F0D0D6D for ; Mon, 9 Dec 2019 21:51:45 +0100 (CET) From: burban@fdn.fr To: bug-guix@gnu.org Subject: shepherd not working out of the box in Debian Date: Mon, 09 Dec 2019 21:51:41 +0100 Message-ID: <87immpz0gy.fsf@tanis.zero.void.nul> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.67.169.19 X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 09 Dec 2019 22:48:04 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) I run shepherd 0.6.1 (with guile 2.2.4) as the init system for Debian buster. It's an installation in the standard place /usr/local. When /usr/local/var/run/shepherd/socket is left dangling due to a crash, shepherd won't start on the next reboot, as error SOCADDRINUSE is raised. Obviously this won't happen if --prefix is / and /var/run points to a volatile file system, but chosing that prefix is probably not what someone trying to test shepherd will do. Below is my patch: *** shepherd.scm 2019-12-08 18:11:19.820000000 +0000 --- shepherd.scm-ORI 2019-04-18 10:39:12.000000000 +0100 *************** *** 46,51 **** (fcntl sock F_SETFL (logior O_NONBLOCK (fcntl sock F_GETFL))) - ;; if file-name is still there, SOCADDRINUSE error is triggered - (when (file-exists? file-name) (delete-file file-name)) (bind sock address) (listen sock 10) --- 46,49 ---- *************** *** 186,191 **** (%current-logfile-date-format (if (and (not logfile) (zero? (getuid))) ! ;; for syslog, first 2 characters are truncated ! (format #f " shepherd[~d]: " (getpid)) default-logfile-date-format)) (current-output-port --- 184,188 ---- (%current-logfile-date-format (if (and (not logfile) (zero? (getuid))) ! (format #f "shepherd[~d]: " (getpid)) default-logfile-date-format)) (current-output-port Notice the second patch, which corrects these kind of output in /var/syslog: Dec 9 20:18:18 buster cron[567]: (CRON) STARTUP (fork ok) Dec 9 20:18:18 buster cron[567]: (CRON) INFO (Running @reboot jobs) Dec 9 20:18:18 buster epherd[1]: Service sshd has been started. Dec 9 20:18:18 buster epherd[1]: Service hwclock is already running. Dec 9 20:18:18 buster epherd[1]: Service sendsigs is already running. Dec 9 20:18:18 buster epherd[1]: Service hostname is already running. Dec 9 20:18:18 buster epherd[1]: Service mountall-bootclean is already running. Dec 9 20:18:19 buster rsyslogd: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="556" x-info="https://www.rsyslog.com"] start Dec 9 20:23:18 buster anacron[562]: Job `cron.daily' started Dec 9 20:23:18 buster anacron[625]: Updated timestamp for job `cron.daily' to 2019-12-09 -- Bernard