From owner-freebsd-rc@freebsd.org Mon Aug 22 13:11:22 2016 Return-Path: Delivered-To: freebsd-rc@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 4981CBC188A for ; Mon, 22 Aug 2016 13:11:22 +0000 (UTC) (envelope-from zeus@ibs.dn.ua) Received: from relay.ibs.dn.ua (relay.ibs.dn.ua [148.251.53.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.new-ukraine.org", Issuer "smtp.new-ukraine.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CFF761238 for ; Mon, 22 Aug 2016 13:11:21 +0000 (UTC) (envelope-from zeus@ibs.dn.ua) Received: on behalf of honored client by relay.ibs.dn.ua with ESMTP id u7MD6vIw088182 for on Mon, 22 Aug 2016 16:06:58 +0300 (EEST) Message-ID: <20160822160651.88181@relay.ibs.dn.ua> Date: Mon, 22 Aug 2016 16:06:51 +0300 From: "Zeus Panchenko" To: cc: Subject: how to start sshd just after network initialization? ... Organization: I.B.S. LLC Reply-To: "Zeus Panchenko" X-Attribution: zeus Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWxsbGdnZ3U1NQTExN cXFzx8fG/v7+f8hyWAAACXUlEQVQ4jUWSwXYiIRBFi4yyhtjtWpmRdTL0ZC3TJOukDa6Rc+T/P2F eFepwtFvr8upVFVDua8mLWw6La4VIKTuMdAPOebdU55sQs3n/D1xFFPFGVGh4AHKttr5K0bS6g7N ZCge7qpVLB+f1Z2WAj2OKXwIWt/bXpdXSiu8KXbviWkHxF5td9+lg2e3xlI2SCvatK8YLfHyh9lw 15yrad8Va5eXg4Llr7QmAaC+dL9sDt9iad/DX3OKvLMBf+dm0A0QuMrTvYIevSik1IaSVvgjIHt5 lSCG2ynNRpEcBZ8cgDWk+Ns99qzsYYV3MZoppWzGtYlTO9+meG6m/g92iNO9LfQB2JZsMpoJs7QG ku2KtabRK0bZRwDLyBDvwlxTm6ZlP7qyOqLcfqtLexpDSB4M0H3I/PQy1emvjjzgK+A0LmMKl6Lq zlqzh0VGAw440F6MJd8cY0nI7wiF/fVIBGY7UNCAXy6DmfYGCLLI0wtDbVcDUMqtJLmAhLqODQAe riERAxXJ1/QYGpa0ymqyytpKC19MNXHjvFmEsfcHIrncFR4xdbYWgmfEGLCcZokpGbGj1egMR+6M 1BkNX1pDdhPcOXpAnAeLQUwQLYepgQoZVNGS61yaE8CYA7gYAcWKzwGstACY2HTFvvOwk4FXAG/a mKHni/EcA/GkOk7I0IK7UMIf3+SahU8/FJdiE7KcuWdM3MFocUDEEIX9LfJoo4xV5tnNKc3jJuSs SZWgnnhepgU1zN4Hii18yW4RwDX52CXUtk0Hqz6cHOIUkWaX8fDcB+J7y1y2xDHwjv/8Buu8Ekz6 7tXQAAAAASUVORK5CYII= X-Mailer: MH-E 8.3.1; nil; GNU Emacs 24.3.1 X-NewUkraine-Agent: mailfromd (7.99.92) X-NewUkraine-URL: https://mail.prozora-kraina.org/smtp.html X-NewUkraine-VirStat: NO X-NewUkraine-VirScan: ScanPE, ScanELF, ScanOLE2, ScanMail, PhishingSignatures, ScanHTML, ScanPDF X-NewUkraine-SpamStat: NO X-NewUkraine-SpamScore: -1.300 of 3.500 X-NewUkraine-SpamKeys: AWL,BAYES_00,NO_RECEIVED,NO_RELAYS X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 13:11:22 -0000 hi, what is the best way to guarantee scripts starting order? I need sshd start first and squid start last among all scripts which are starting is the only way to put (for example) to /usr/local/etc/rc.d/ script/s to order it? so, to just start squid after sshd I need something like this: ---[ /usr/local/etc/rc.d/ORDER1 start ]--- #!/bin/sh # # PROVIDE: precedence # REQUIRE: sshd # BEFORE: squid ---[ /usr/local/etc/rc.d/ORDER1 stop ]--- but how to configure it globally to start sshd just after network initialization? is it something like this? ---[ /usr/local/etc/rc.d/ORDER0 start ]--- #!/bin/sh # # PROVIDE: precedence # REQUIRE: NETWORKING pf pflog # BEFORE: sshd ---[ /usr/local/etc/rc.d/ORDER0 stop ]--- is there some other way to order them? -- Zeus V. Panchenko jid:zeus@im.ibs.dn.ua IT Dpt., I.B.S. LLC GMT+2 (EET) From owner-freebsd-rc@freebsd.org Mon Aug 22 13:30:50 2016 Return-Path: Delivered-To: freebsd-rc@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 605A5BC1F05 for ; Mon, 22 Aug 2016 13:30:50 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241AF131F for ; Mon, 22 Aug 2016 13:30:49 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id A61C528426; Mon, 22 Aug 2016 15:30:41 +0200 (CEST) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id D14FD28412; Mon, 22 Aug 2016 15:30:40 +0200 (CEST) Message-ID: <57BAFE80.3050501@quip.cz> Date: Mon, 22 Aug 2016 15:30:40 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32 MIME-Version: 1.0 To: Zeus Panchenko , freebsd-rc@freebsd.org Subject: Re: how to start sshd just after network initialization? ... References: <20160822160651.88181@relay.ibs.dn.ua> In-Reply-To: <20160822160651.88181@relay.ibs.dn.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 13:30:50 -0000 Zeus Panchenko wrote on 08/22/2016 15:06: > hi, > > what is the best way to guarantee scripts starting order? > > I need sshd start first and squid start last among all scripts which are starting > > is the only way to put (for example) to /usr/local/etc/rc.d/ script/s > to order it? > > so, to just start squid after sshd I need something like this: > > ---[ /usr/local/etc/rc.d/ORDER1 start ]--- > > #!/bin/sh > # > > # PROVIDE: precedence > # REQUIRE: sshd > # BEFORE: squid > > ---[ /usr/local/etc/rc.d/ORDER1 stop ]--- > > > but how to configure it globally to start sshd just after network initialization? > is it something like this? > > ---[ /usr/local/etc/rc.d/ORDER0 start ]--- > > #!/bin/sh > # > > # PROVIDE: precedence > # REQUIRE: NETWORKING pf pflog > # BEFORE: sshd > > ---[ /usr/local/etc/rc.d/ORDER0 stop ]--- > > is there some other way to order them? I had similar requirements so I had this /usr/local/etc/rc.d/sshd_reorder #!/bin/sh # PROVIDE: sshd_reorder # REQUIRE: LOGIN sshd ## this file is just to start sshd earlier on the boot ## mainly before long starting processes like jails, mysql, apache etc. ## ## place this file in to /usr/local/etc/rc.d/sshd_reorder ## and make it executable chmod 0555 /usr/local/etc/rc.d/sshd_reorder I don't know when Squid starts (I don't use it) so you can look in to output of rcorder /etc/rc.d/* /usr/local/etc/rc.d/* and use NETWORKING alone or some more specific Miroslav Lachman From owner-freebsd-rc@freebsd.org Tue Aug 23 13:07:51 2016 Return-Path: Delivered-To: freebsd-rc@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 C0A82BC3EEC for ; Tue, 23 Aug 2016 13:07:51 +0000 (UTC) (envelope-from luke@foolishgames.com) Received: from stargazer.midnightbsd.org (70-91-226-201-BusName-Michigan.hfc.comcastbusiness.net [70.91.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "stargazer.midnightbsd.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8462B19B1 for ; Tue, 23 Aug 2016 13:07:51 +0000 (UTC) (envelope-from luke@foolishgames.com) Received: from [192.168.0.12] (70-91-226-205-BusName-Michigan.hfc.comcastbusiness.net [70.91.226.205]) (authenticated bits=0) by stargazer.midnightbsd.org (8.15.2/8.15.1) with ESMTPSA id u7NCfdTD037287 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 23 Aug 2016 08:41:41 -0400 (EDT) (envelope-from luke@foolishgames.com) X-Authentication-Warning: stargazer.midnightbsd.org: Host 70-91-226-205-BusName-Michigan.hfc.comcastbusiness.net [70.91.226.205] claimed to be [192.168.0.12] X-Habeas-Swe-2: brightly anticipated In-Reply-To: <20160822160651.88181@relay.ibs.dn.ua> X-Habeas-Swe-7: warrant mark warrants that this is a Habeas Compliant Subject: Re: how to start sshd just after network initialization? ... X-Habeas-Swe-4: Copyright 2002 Habeas (tm) Cc: freebsd-rc@freebsd.org X-Habeas-Swe-1: winter into spring Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Habeas-Swe-9: mark in spam to . Date: Tue, 23 Aug 2016 08:41:39 -0400 X-Habeas-Swe-6: email in exchange for a license for this Habeas Message-Id: <354FA4FB-D586-47A6-B174-372ABA32F221@foolishgames.com> To: Zeus Panchenko X-Habeas-Swe-3: like Habeas SWE (tm) Content-Transfer-Encoding: quoted-printable From: Lucas Holt References: <20160822160651.88181@relay.ibs.dn.ua> X-Habeas-Swe-8: Message (HCM) and not spam. Please report use of this Content-Type: text/plain; charset=utf-8 X-Habeas-Swe-5: Sender Warranted Email (SWE) (tm). The sender of this X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 13:07:51 -0000 You can see what order you=E2=80=99re going to get after making changes = without rebooting by using the rcorder utility. You need to give it all = the scripts on the path and you can simulate what will happen. =20 Lucas Holt Luke@FoolishGames.com ________________________________________________________ MidnightBSD.org (Free OS) JustJournal.com (Free blogging) From owner-freebsd-rc@freebsd.org Wed Aug 24 17:08:13 2016 Return-Path: Delivered-To: freebsd-rc@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 38228BC53BE for ; Wed, 24 Aug 2016 17:08:13 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12779130F for ; Wed, 24 Aug 2016 17:08:13 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:Subject:To:From:Date:Content-Transfer-Encoding: Content-Type:MIME-Version:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WkPNhn2deuH8VFHGfTsquF/fVJSOnuERA4lrUaAMYbA=; b=Np4f+SI/6KtjWQ8kgRPK0ELYa0 4pEWclN3x63x9aO6mtGjvnp9bYdSgbyxTYBNJwFIg9ldUDUZ90b47JfyubxcL5v6v0nTWuads8LAo 6x48cVLX1pGLTZHbiTLHi3P8PNBJtfg3u9yPHQkFr7kjTh/YaCI0vWO0vfKoY18dbecA=; Received: from thebighonker.lerctr.org ([2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]:63174 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1bcbeu-0006DS-6C for freebsd-rc@freebsd.org; Wed, 24 Aug 2016 12:08:12 -0500 Received: from proxy.na.alcatel-lucent.com ([135.245.48.72]) by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Wed, 24 Aug 2016 12:08:12 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 24 Aug 2016 12:08:12 -0500 From: Larry Rosenman To: freebsd-rc@freebsd.org Subject: Can someone explain what I'm missing for this script to work at startup? Message-ID: <775f07971e09126b4b72527565f2e7d1@thebighonker.lerctr.org> X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/1.2.0 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 17:08:13 -0000 I have the following script in /usr/local/etc/rc.d/tika: thebighonker.lerctr.org /usr/local/etc/rc.d $ cat tika #!/bin/sh # # $FreeBSD$ # # PROVIDE: tika # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable exim: # #tika_enable="YES" # tika_version=1.12 # case $1 in start) /usr/sbin/daemon -u tika -p /var/run/tika.pid -P /var/run/tika_server.pid \ -r /usr/local/bin/java -jar /home/ler/tika-server-${tika_version}.jar ;; stop) kill `cat /var/run/tika_server.pid` ;; *) echo "usage $0: start|stop" ;; esac exit 0; thebighonker.lerctr.org /usr/local/etc/rc.d $ and at startup it does NOT start, but after login, service tika start works. Can someone with -rc fu help? -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281 From owner-freebsd-rc@freebsd.org Wed Aug 24 18:31:11 2016 Return-Path: Delivered-To: freebsd-rc@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 A3FF8BC51EB for ; Wed, 24 Aug 2016 18:31:11 +0000 (UTC) (envelope-from lukasz@wasikowski.net) Received: from mail.freebsd.systems (mail.freebsd.systems [IPv6:2001:41d0:2:1276::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 688301BBF for ; Wed, 24 Aug 2016 18:31:11 +0000 (UTC) (envelope-from lukasz@wasikowski.net) Received: from mail.freebsd.systems (mail.freebsd.systems [IPv6:2001:41d0:2:1276::1]) by mail.freebsd.systems (Postfix) with ESMTP id D81DEEA6; Wed, 24 Aug 2016 20:31:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at freebsd.systems Received: from mail.freebsd.systems ([5.196.167.1]) by mail.freebsd.systems (scan.freebsd.systems [5.196.167.1]) (amavisd-new, port 10026) with ESMTP id WDYKxvq0fv1w; Wed, 24 Aug 2016 20:31:00 +0200 (CEST) Received: from [192.168.168.1] (89-70-62-144.dynamic.chello.pl [89.70.62.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.freebsd.systems (Postfix) with ESMTPSA id 30B31EA0; Wed, 24 Aug 2016 20:31:00 +0200 (CEST) Authentication-Results: mail.freebsd.systems; dmarc=none header.from=wasikowski.net Authentication-Results: mail.freebsd.systems; spf=pass smtp.mailfrom=lukasz@wasikowski.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wasikowski.net; s=default; t=1472063460; bh=4ABvZ/rarBpIGhSdhIidPrCDPcZ+Modw6V9XSBmuO4c=; h=To:References:From:Date:In-Reply-To; b=NkvYg9fiILX3le4zlezlEFMrH1U12pcMvX4OgxyZWL8XVV8vA+jQfclAjFJDJ4Mr+ bijpkzvcu8MgkEJkHmyuqysIia6EnpYi6HdLvsn4hF0GcC3kY9z+2Vq7jHEnDVHn6F qUJZESwt/st/MwvZeNZmui/6a2mrZAbKm3R/1saAvtMqEFwbkDhAwsEvdqdwYTq0ES Ht7CXTOnFh903GQ2A+4uo0otfpdVudptda/RNfzhEyKEw7EJa1ibh72AUuqeh1tYMj 9m19ATRSTppDY0lr+eYfJrtCFiQGmDT5FY2EITQqfflGhLdQWQi/ZgZTaqupTNYJrC Vm+X8nVMpb6qA== Subject: Re: Can someone explain what I'm missing for this script to work at startup? To: Larry Rosenman , freebsd-rc@freebsd.org References: <775f07971e09126b4b72527565f2e7d1@thebighonker.lerctr.org> From: =?UTF-8?Q?=c5=81ukasz_W=c4=85sikowski?= Message-ID: Date: Wed, 24 Aug 2016 20:30:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <775f07971e09126b4b72527565f2e7d1@thebighonker.lerctr.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 18:31:11 -0000 W dniu 2016-08-24 o 19:08, Larry Rosenman pisze: > I have the following script in /usr/local/etc/rc.d/tika: > thebighonker.lerctr.org /usr/local/etc/rc.d $ cat tika > #!/bin/sh > # > # $FreeBSD$ > # > > # PROVIDE: tika > # REQUIRE: LOGIN > # KEYWORD: shutdown > > # > # Add the following lines to /etc/rc.conf to enable exim: > # > #tika_enable="YES" > # > tika_version=1.12 > # > > case $1 in > start) > /usr/sbin/daemon -u tika -p /var/run/tika.pid -P > /var/run/tika_server.pid \ > -r /usr/local/bin/java -jar > /home/ler/tika-server-${tika_version}.jar > ;; > stop) > kill `cat /var/run/tika_server.pid` > ;; > *) > echo "usage $0: start|stop" > ;; > esac > > exit 0; > thebighonker.lerctr.org /usr/local/etc/rc.d $ > > and at startup it does NOT start, but after login, service tika start > works. This may be related to the fact, that after login you have some env variables set that tika needs. It's common with java software. -- best regards, Lukasz Wasikowski From owner-freebsd-rc@freebsd.org Wed Aug 24 18:37:24 2016 Return-Path: Delivered-To: freebsd-rc@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 34F6CBC5300 for ; Wed, 24 Aug 2016 18:37:24 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8911D75 for ; Wed, 24 Aug 2016 18:37:24 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: Content-Transfer-Encoding:Content-Type:MIME-Version:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wWyUW3xOz8VEqpergmQMjAaIBctVwxRR+46lAygp3+U=; b=s93wLJcAS3TEDe/YO3Sb3VGRUa 6I5ia5LKSo/VnEZB2mba4bwGqx8mubfM4cXGNWJiEPiVHKhWR/JtMsN/r0tchRwVYQTZ2+X0AjL4E 3aJ8ZkYMM1lEuKWfD2Lc4vUZ+2EK2wsSWl8TX7LTpvthdnbTNdISTkrlDhU8wDsiSfeQ=; Received: from thebighonker.lerctr.org ([2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]:33733 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1bcd3D-00097b-3w; Wed, 24 Aug 2016 13:37:23 -0500 Received: from proxy.na.alcatel-lucent.com ([135.245.48.72]) by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Wed, 24 Aug 2016 13:37:23 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 24 Aug 2016 13:37:23 -0500 From: Larry Rosenman To: =?UTF-8?Q?=C5=81ukasz_W=C4=85sikowski?= Cc: freebsd-rc@freebsd.org Subject: Re: Can someone explain what I'm missing for this script to work at startup? In-Reply-To: References: <775f07971e09126b4b72527565f2e7d1@thebighonker.lerctr.org> Message-ID: X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/1.2.0 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 18:37:24 -0000 On 2016-08-24 13:30, Łukasz Wąsikowski wrote: > > This may be related to the fact, that after login you have some env > variables set that tika needs. It's common with java software. nothing that I can see: thebighonker.lerctr.org ~ $ env SHELL=/usr/local/bin/bash TERM=vt100 SSH_CLIENT=135.115.130.112 53697 22 SSH_TTY=/dev/pts/0 SGML_CATALOG_FILES=/usr/doc/en_US.ISO8859-1/share/sgml/catalog:/usr/doc/share/sgml/catalog:/usr/local/share/sgml/iso8879/catalog:/usr/local/share/sgml/html/catalog:/usr/local/share/sgml/docbook/4.1/catalog:/usr/local/share/sgml/jade/catalog USER=ler ENV=/home/ler/.shrc PAGER=more PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/ler/bin MAIL=/var/mail/ler BLOCKSIZE=K PWD=/home/ler EDITOR=vi ITERM_ORIG_PS1=\H \w \$ PS1=\H \w \$ SHLVL=1 HOME=/home/ler ITERM_PREV_PS1=\[ \]\H \w \$ \[\] LOGNAME=ler SSH_CONNECTION=135.115.130.112 53697 192.147.25.65 22 _=/usr/bin/env thebighonker.lerctr.org ~ $ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/ler/bin -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281 From owner-freebsd-rc@freebsd.org Wed Aug 24 21:24:43 2016 Return-Path: Delivered-To: freebsd-rc@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 6CB87BC4556 for ; Wed, 24 Aug 2016 21:24:43 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36E241546 for ; Wed, 24 Aug 2016 21:24:43 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x231.google.com with SMTP id x131so235718566ite.0 for ; Wed, 24 Aug 2016 14:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=p8t8AQ12QZJIuoggiXl6kpfGL1YjdzbdUGeRSbkHrJg=; b=MrkOhvTAPNYuqsBFpwbeEto1c8bXVl1SxU/rJFcb8GARmZo8L3QjGW1/1BCCA4jM/n zeW6BkztMxzBGvmJsUibi9Br9Ze8FQ5Va0q88girzTvhZcW3jsyts46Wlglw1wYnh7vF HI3LDtMW7EDmbCKclACxMt5TzWFwnhkjLuEbYh8O+UMLCHfxokp34J8KWpoMedNsd1dx LBR/6iUh6iEAi+f771RyqZWQptQTm4mi9ELPOUyrDLo+x6Arr94rnQfdbi8t34bNV4fX 28/OcikIm1lg7Z3rl4kjEckYM/e45LTGVtcX9ycg78OWgS9zTU70WqPFAA40obXg9sZ2 H9fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=p8t8AQ12QZJIuoggiXl6kpfGL1YjdzbdUGeRSbkHrJg=; b=YdjXRZ112KmOIffyXkdwcU8RQwyQsGMF+2RURr2D6BnRO367twJAfeFnL15CFzoPrL O61+Itl1ce5IoVFrWqEOsC+1ecKsv0ecy/ZeDpuTn5Roxq7fYUSzbKhKxKo9GRWuQsWY u/1y8dHtBqyShDMAB2mriaHamsaYhggi19Co546F3gCCV0T2fzB5l4DQrzkzGpoA+qp9 tkV/MpICRmfONd41jK6e2gG+CpWa07On8Cuczq9kvzMbwAO3u64FrtBbSlRHgr4fbCaO +mGID0d+1J7phec8a1+bVEHYtUNVZNUAReYU0W3faBhX0KP7XvRIAN4O5cnv2SgqmUSa tK3A== X-Gm-Message-State: AEkoouv3H0GX4KoBhwjoKInfjFxPWe7bSURRPkb0WIamzFHYUM2XSkk689zNHYGY//6fTnuwGc7a5kG6CcC1sw== X-Received: by 10.107.129.97 with SMTP id c94mr6430560iod.102.1472073882591; Wed, 24 Aug 2016 14:24:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Wed, 24 Aug 2016 14:24:42 -0700 (PDT) In-Reply-To: <775f07971e09126b4b72527565f2e7d1@thebighonker.lerctr.org> References: <775f07971e09126b4b72527565f2e7d1@thebighonker.lerctr.org> From: Ryan Stone Date: Wed, 24 Aug 2016 17:24:42 -0400 Message-ID: Subject: Re: Can someone explain what I'm missing for this script to work at startup? To: Larry Rosenman Cc: freebsd-rc@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 21:24:43 -0000 Your script is probably being called with "quietstart" or "faststart" as its argument. I'd recommend using the rc.subr infrastructure for your rc.d scripts to avoid such issues. On Wed, Aug 24, 2016 at 1:08 PM, Larry Rosenman wrote: > I have the following script in /usr/local/etc/rc.d/tika: > thebighonker.lerctr.org /usr/local/etc/rc.d $ cat tika > #!/bin/sh > # > # $FreeBSD$ > # > > # PROVIDE: tika > # REQUIRE: LOGIN > # KEYWORD: shutdown > > # > # Add the following lines to /etc/rc.conf to enable exim: > # > #tika_enable="YES" > # > tika_version=1.12 > # > > case $1 in > start) > /usr/sbin/daemon -u tika -p /var/run/tika.pid -P > /var/run/tika_server.pid \ > -r /usr/local/bin/java -jar /home/ler/tika-server-${tika_v > ersion}.jar > ;; > stop) > kill `cat /var/run/tika_server.pid` > ;; > *) > echo "usage $0: start|stop" > ;; > esac > > exit 0; > thebighonker.lerctr.org /usr/local/etc/rc.d $ > > and at startup it does NOT start, but after login, service tika start > works. > > Can someone with -rc fu help? > > > -- > Larry Rosenman http://www.lerctr.org/~ler > Phone: +1 214-642-9640 E-Mail: ler@lerctr.org > US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281 > _______________________________________________ > freebsd-rc@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-rc > To unsubscribe, send any mail to "freebsd-rc-unsubscribe@freebsd.org" > From owner-freebsd-rc@freebsd.org Wed Aug 24 23:09:58 2016 Return-Path: Delivered-To: freebsd-rc@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 42E59BC5C10 for ; Wed, 24 Aug 2016 23:09:58 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4A415A0 for ; Wed, 24 Aug 2016 23:09:57 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: Content-Type:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hSLLFrl3sYcyORpwkva2x2ndnE8RD497mkMEa217k/8=; b=PClERDHlrAKpSYUrAZes2fwGI8 CeGg7BtZ7ng9oviidHxSrQkdgmf/G71bfxSWdmzm1fWPw6Xrtd4OAZdXuW/ZpLCtuNdoQ09vryBZj rI/fIiJ+qjApbigbve355uHk/amwLFv1Hcns6YXp8PftZekyvBQhcXI/Y1O4j1Y9OT+g=; Received: from thebighonker.lerctr.org ([2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]:26669 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1bchIy-0001Ey-IC; Wed, 24 Aug 2016 18:09:56 -0500 Received: from 2001:470:1f0f:42c:e4a9:73a:6eb1:ea87 by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Wed, 24 Aug 2016 18:09:56 -0500 MIME-Version: 1.0 Date: Wed, 24 Aug 2016 18:09:56 -0500 From: Larry Rosenman To: Ryan Stone Cc: freebsd-rc@freebsd.org Subject: Re: Can someone explain what I'm missing for this script to work at startup? In-Reply-To: References: <775f07971e09126b4b72527565f2e7d1@thebighonker.lerctr.org> Message-ID: X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/1.2.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 23:09:58 -0000 On 2016-08-24 16:24, Ryan Stone wrote: > Your script is probably being called with "quietstart" or "faststart" as its argument. I'd recommend using the rc.subr infrastructure for your rc.d scripts to avoid such issues. good call. Changed to rc.subr, and added some variables to appease it, and it now DTRT. THANK YOU. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281