Re: after upgrade, can't restart apache via cron

From: Mateusz Guzik <mjguzik_at_gmail.com>
Date: Mon, 26 Nov 2012 19:22:14 +0100
On Fri, Nov 23, 2012 at 11:37:54PM +0900, Hiroki Sato wrote:
> "Michael W. Lucas" <mwlucas_at_michaelwlucas.com> wrote
>   in <20121123031753.GA59632_at_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>
Received on Mon Nov 26 2012 - 17:22:26 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:32 UTC