From owner-freebsd-ports@FreeBSD.ORG Sun Sep 7 08:39:25 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 925E4396; Sun, 7 Sep 2014 08:39:25 +0000 (UTC) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57DD21376; Sun, 7 Sep 2014 08:39:25 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id rd18so16421014iec.27 for ; Sun, 07 Sep 2014 01:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=K42ay01j0gpFXL4XrvoGVlL4oHdrKgTuW6sCTD/Lj4A=; b=VX7MGTNzlu5nXJpPfASB9REhAo2ADUC6onUhzj1tb3+sJIKn+D50qjiCLdgflL1drT apqDINVr2rp4KaBuIbCetaX1RiMBpg7SZOweC/03QXDFlAvha1nwZbPRY0Jn39wHMj2x 0KqXysqTPLN9an2URx2mA2NJb2WDJJpsoAioAPLRKB/nYyBxzUCrmogqo4jqsX5MFojB cBiDX45TH/gX1lD2eeFcXf4QtEeSA6zs8LCCUggEXj0+rXy2YCin15Hpgl+stowpa9PT X/HAA/PvMfxDIyByzYphqJYzuCh8/A7AsE7fp6VHAGsJWpCU07dgkluH13/OJxhY5BBV O+xw== MIME-Version: 1.0 X-Received: by 10.43.96.8 with SMTP id ce8mr19387909icc.14.1410079164723; Sun, 07 Sep 2014 01:39:24 -0700 (PDT) Received: by 10.50.122.42 with HTTP; Sun, 7 Sep 2014 01:39:24 -0700 (PDT) In-Reply-To: <20140907094308.6c466d9f.ohartman@zedat.fu-berlin.de> References: <20140907090321.12bbc428.ohartman@zedat.fu-berlin.de> <20140907153342.2366ad8b@X220.alogt.com> <20140907094308.6c466d9f.ohartman@zedat.fu-berlin.de> Date: Sun, 7 Sep 2014 03:39:24 -0500 Message-ID: Subject: Re: service doen't get started at boottime, but can start manually From: Scot Hetzel To: "O. Hartmann" Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD CURRENT , FreeBSD Ports , Erich Dollansky X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2014 08:39:25 -0000 On Sun, Sep 7, 2014 at 2:43 AM, O. Hartmann wrote: > Am Sun, 7 Sep 2014 15:33:42 +0800 > Erich Dollansky schrieb: > >> Hi, >> >> On Sun, 7 Sep 2014 09:03:21 +0200 >> "O. Hartmann" wrote: >> >> > >> > I use a service (textprox/refdb from ports, refdb_enable="YES" >> > in /etc/rc.conf.local) that is supposed to startup at boottime. On >> > one CURRENT system, running >> > >> > FreeBSD 11.0-CURRENT #3 r271210: Sat Sep 6 22:39:59 CEST 2014 amd64 >> > >> > the service is not started at boottime, but I can start the service >> > manually via >> > >> > service refdb start >> > >> > I tried enabling rc_debug=YES in /etc/rc.conf but I do not see any >> > failure of the start attempt of that specific service in the logs or >> > on the console. >> > >> > Is there an elegant way to debug rc.d and the startup procedure >> > without having the system reboot (I do not have jails or VM, sorry)? >> > >> could it be that the spelling in either rc.conf and the spelling in the >> actual script differ so that FreeBSD does not start it? >> >> Erich > > No. If it would be the case, I guess starting it manually wouldn't work either. The fact > is that the port textproc/refdb uses a startup script named "refdb.sh" and by maintaining > the port and on the way to make it more CURRENT compliant, I started with renaming it to > "refdb" and it seems this is the culprit. > > The script textproc/refdb uses is a bit awkward since it targets both *BSD and Linux > init/rc scripts and the initial rc.d/refddb scripts gives control to another script > called refdbctl which seems to perform all the stuff FreeBSD's /etc/rc.subr is providing. > > I renamed the script back to "refdb.sh" by now and the service starts again as > expected. I guess the spawning into a subshell fails somehow at that point when booting > the box. > I had a look at scripts/refdb.in, it is not a proper rc script for FreeBSD, as it is missing several keywords: # PROVIDE: <- all scripts need this # REQUIRE: # BEFORE: # KEYWORD: <- optional Which tells rcorder where to put refdb in the startup order. Since these are missing, rcorder doesn't place it in the startup list. The following will show you the order that your startup scripts run, refdb may not be listed: rcorder /etc/rc.d/* /usr/local/etc/rc.d/* Some one will have to create a proper rc script by looking at what both scripts/refdb.in and scripts/refdbctl.in do. The reason that you are able to use service to start refdb, is due to service doesn't check the scripts header for the keywords. -- DISCLAIMER: No electrons were maimed while sending this message. Only slightly bruised.