Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2012 19:22:14 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        freebsd-rc@FreeBSD.org
Cc:        current@FreeBSD.org, mwlucas@michaelwlucas.com
Subject:   Re: after upgrade, can't restart apache via cron
Message-ID:  <20121126182214.GA17080@dft-labs.eu>
In-Reply-To: <20121123.233754.1596631883684484110.hrs@allbsd.org>
References:  <20121123031753.GA59632@bewilderbeast.blackhelicopters.org> <20121123.233754.1596631883684484110.hrs@allbsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 23, 2012 at 11:37:54PM +0900, Hiroki Sato wrote:
> "Michael W. Lucas" <mwlucas@michaelwlucas.com> wrote
>   in <20121123031753.GA59632@bewilderbeast.blackhelicopters.org>:
> 
> mw> eval: setfib: not found
> mw> /usr/local/etc/rc.d/apache22: WARNING: failed to start apache22
> mw>
> mw> If I run /usr/local/etc/rc.d/apache22 restart from the command line, I
> mw> can restart httpd without trouble.
> mw>
> mw> Any thoughts?
> 
>  This was due to $PATH in the cron job as already pointed out, but
>  this should not happen.  I attached a patch to use full-path for
>  external commands in rc.subr.  If there is no objection to this
>  change I will commit it.
> 

service(8) tries to sanitize stuff before executing scripts. How about
making this the default behaviour?

Currently stuff like PATH "leak" to rc scripts and this can be harmful
(for instance daemon was happily executing stuff from /usr/local/bin,
yet after reboot it stopped working).

Also I doubt anyone relies on current environment and what not to start
a service, but we can provide another target tha would start the service
without sanitizing in case this is needed.

-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121126182214.GA17080>