From owner-freebsd-questions@freebsd.org Wed Sep 9 11:43:53 2015 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 885BD9CD3C3 for ; Wed, 9 Sep 2015 11:43:53 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6B31FEC for ; Wed, 9 Sep 2015 11:43:53 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: by mailman.ysv.freebsd.org (Postfix) id 6A5409CD3C2; Wed, 9 Sep 2015 11:43:53 +0000 (UTC) Delivered-To: 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 69E149CD3C1 for ; Wed, 9 Sep 2015 11:43:53 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9CA1FEB for ; Wed, 9 Sep 2015 11:43:52 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-125-111.dynamic.qsc.de [92.195.125.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id C8AEE27847; Wed, 9 Sep 2015 13:43:48 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t89BhmTH002351; Wed, 9 Sep 2015 13:43:48 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 9 Sep 2015 13:43:48 +0200 From: Polytropon To: Olivier Nicole Cc: questions@freebsd.org Subject: Re: One daemon not starting in /etc/rc.local Message-Id: <20150909134348.0668c422.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) 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.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2015 11:43:53 -0000 On Wed, 09 Sep 2015 14:19:57 +0700, Olivier Nicole wrote: > In /etc/rc.local I have: > > # REQUIRE: networking DAEMON FILESYSTEMS devfs > # PROVIDE: p0f recover-backup count-stats Does rc.local pay attention to this kind of comments? It was my impression that both rc.local and rc.shutdown.local are "dumb" and determined by execution time... I tend to associate the REQUIRE and PROVIDE keywords with the rc ordering mechanism which rc.d/ style files use so they can be run the correct order. As I mentioned, rc.local's runtime is determined by /etc/rc itself. >From "man rc.local": [...] The rc.local script contains com- mands which are pertinent only to a specific site. Typically, the /usr/local/etc/rc.d/ mechanism is used instead of rc.local these days but if you want to use rc.local, it is still supported. In this case, it should source /etc/rc.conf and contain additional custom startup code for your system. The best way to handle rc.local, however, is to separate it out into rc.d/ style scripts and place them under /usr/local/etc/rc.d/. So if you can, create and rc.d/ style script and put it into /usr/local/etc/rc.d/ including the keywords mentioned above. > echo iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii > > # start the OS fingerprint analyzer > # -l means on line per record! > /usr/local/bin/p0f -i vmx0 'tcp dst port 25' 2>&1|/usr/local/bin/p0f-analyzer.pl 2345 & > > echo iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii > > > At boot I see the 2 lines of iii but p0f is not started. > > If I copy/paste in sheel the line /usr/local/bin/p0f etc. it starts, > prints the start-up message and runs happilly. Is the "non-use" of spaces in the segment "2>&1|/usr/local/bin/p0f" significant? Is the shell where you're interactively executing the command different from the shell that runs rc.local (/bin/sh)? > There must be a trivial error, but I can't see it, so any help will be > greatly appreciated. Except what might be pure form, I don't see any errors, so the reason for the different behaviour might be in the environment... -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...