From owner-freebsd-doc@FreeBSD.ORG Fri Jan 25 10:39:33 2013 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CEF48E34 for ; Fri, 25 Jan 2013 10:39:33 +0000 (UTC) (envelope-from gkeramidas@gmail.com) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 567AEE34 for ; Fri, 25 Jan 2013 10:39:33 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id t44so104609wey.26 for ; Fri, 25 Jan 2013 02:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to; bh=iNVid6oupSKUO65C6q7/geQKUFszZcyrvK9asNKT8/4=; b=iA6rUGOGxFTmPtp8wv0byjFIA065jzd0rP13qF4x5iRqnrlzRMl0yqoYNObCMZk/Vt Z2deWjWzsc569nWgr1saRGk9i1oVa7xjiiBt+BUqV58ysjFj+S/nX9cwYHEC1ZAv9YpJ +df3WgPVjXpDMtGV3q4BmCZDaC/jT6aahdQtAT6QAShtrlgUE+NpOuZ+1P+UpIHhjBYJ RICFLqupGSMtREuH5cknCpUvHBNA5C3TpMW+x1zP7CQ5nBTp3/0ytPqXXsmg1n3Ha9IF owOsyq/1GJ2QxMMWWMx5nONw2zG0D/2k5iezdH43nkZM4pMCBzUj1RX792uVfTn26qeX dBmA== X-Received: by 10.194.78.207 with SMTP id d15mr7912004wjx.52.1359110372025; Fri, 25 Jan 2013 02:39:32 -0800 (PST) Received: from saturn (217-162-217-29.dynamic.hispeed.ch. [217.162.217.29]) by mx.google.com with ESMTPS id t17sm1126587wiv.6.2013.01.25.02.39.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 25 Jan 2013 02:39:31 -0800 (PST) Sender: Giorgos Keramidas Date: Fri, 25 Jan 2013 11:39:27 +0100 From: Giorgos Keramidas To: "Matthew D. Fuller" Subject: Re: explicit use of /etc/rc.d vs service Message-ID: <20130125103926.GB24013@saturn> References: <201301241452.26474.elias_chr@otenet.gr> <20130124183748.GI67337@over-yonder.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130124183748.GI67337@over-yonder.net> Cc: freebsd-doc@freebsd.org X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2013 10:39:33 -0000 On 2013-01-24 12:37, "Matthew D. Fuller" wrote: >On Thu, Jan 24, 2013 at 02:52:26PM +0200 I heard the voice of >Elias Chrysocheris, and lo! it spake thus: >> >> It returns an error. But when I /usr/local/etc/rc.d/apache22 >> onerestart evrything works fine... > > That could mean it's depending on something in your env variables, > which service will clear out (and so technically is a bug in your > setup, if your system script is depending on your user env...) We debugged this a bit further with Elias in personal email, and it seems to be related to PATH differences. The error message was that 'env' cannot find 'python' in the toplevel shebang line of the hgwebdir.cgi script. This shows exactly the same error in a test script: $ ls -ld foo.py -rwxr-xr-x 1 keramida users 43 Jan 25 11:33 foo.py $ cat -n foo.py 1 #!/usr/bin/env python 2 3 print 'Hello world' $ env PATH=/bin:/sbin:/usr/bin:/usr/sbin ./foo.py env: python: No such file or directory $ env PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin ./foo.py Hello world So indeed this is a bug that makes the apache onerestart script depend on the runtime value of PATH to load everything correctly.