Date: Fri, 25 Jan 2013 11:39:27 +0100 From: Giorgos Keramidas <keramida@FreeBSD.org> To: "Matthew D. Fuller" <fullermd@over-yonder.net> Cc: freebsd-doc@freebsd.org Subject: Re: explicit use of /etc/rc.d vs service Message-ID: <20130125103926.GB24013@saturn> In-Reply-To: <20130124183748.GI67337@over-yonder.net> References: <CAF6rxgnJPFevO7W%2BypBZdcL7deB%2B_cQHF0AEcVaWWv8FFhcNcQ@mail.gmail.com> <CAC8HS2Ewh391gbCQb2QFm8k3-uUUKp=5bibrmy4RAnNj93V1Ew@mail.gmail.com> <201301241452.26474.elias_chr@otenet.gr> <20130124183748.GI67337@over-yonder.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2013-01-24 12:37, "Matthew D. Fuller" <fullermd@over-yonder.net> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130125103926.GB24013>