From owner-freebsd-current@FreeBSD.ORG Fri Nov 23 12:04:50 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4753EFC for ; Fri, 23 Nov 2012 12:04:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 72FB38FC15 for ; Fri, 23 Nov 2012 12:04:49 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so3275939wey.13 for ; Fri, 23 Nov 2012 04:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=S84neTjc52BbwPDyvOXgUw70Rar9vewWGIiVCYw6ZxI=; b=NZ7Lww16/Jv2b32BCThK7v17F4X/W0hz6AaMBTbAU+TnhqYEynK6SoYlj8J9K+YMBy 86M3CHuuKpvoc4cJ+TeC7QVK1u/UF+v/ElrCqRdI5HNK/s9K3zNBUuNTjSDl8sSvCuH9 exJ6/oUQBsvOAsQAqjmmQQ2pbovH05TQD9rstZj9mAcD7KlyIWoBN7hRrB5x7HaX3iQB W+eIR0ission+wFuLmT/iKd96P+olFQAYBebOEvKb01SCiGmg2dffYtNu1ccWZnOuXuk uYNjK+K9FYWOlQBQeAje5YVg89xbceLhOevNWXshkvbXtOUf/xmnh7CUJgVINCFQAadD RlBw== Received: by 10.216.211.66 with SMTP id v44mr1477930weo.91.1353672289162; Fri, 23 Nov 2012 04:04:49 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id gk9sm8292598wib.4.2012.11.23.04.04.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 04:04:47 -0800 (PST) Date: Fri, 23 Nov 2012 13:04:40 +0100 From: Mateusz Guzik To: "Michael W. Lucas" Subject: Re: after upgrade, can't restart apache via cron Message-ID: <20121123120440.GA15116@dft-labs.eu> References: <20121123031753.GA59632@bewilderbeast.blackhelicopters.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20121123031753.GA59632@bewilderbeast.blackhelicopters.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 12:04:51 -0000 On Thu, Nov 22, 2012 at 10:17:54PM -0500, Michael W. Lucas wrote: > > > FreeBSD bewilderbeast.blackhelicopters.org 10.0-CURRENT FreeBSD 10.0-CURRENT #15: Thu Nov 8 14:02:45 EST 2012 mwlucas@bewilderbeast.blackhelicopters.org:/usr/obj/usr/src/sys/GENERIC amd64 > > I can manually restart apache22 with the following /etc/rc.conf entries: > > apache22_enable="YES" > apache22_fib=0 > > I have a cron entry that restarts apache regularly, to compensate for > some mysql daftness. > > 13 * * * * /usr/local/etc/rc.d/apache22 restart > > When this job runs, I get the following email: > [..] > eval: setfib: not found [..] > > If I run /usr/local/etc/rc.d/apache22 restart from the command line, I > can restart httpd without trouble. > As others pointers out already it is a PATH issue, but I don't think that restoring /usr/sbin in PATH is the answer here. You should be using service(8) script since it does The Right Thing(tm). Apache will be started in more-or-less same environment that was used during boot time. (My personal opinion is that startup scripts should prepare such environment on their own unless explicitly told otherwise, and by environment I mean more that 'environment' variables.) If this is a bug or not I cannot say. /etc/rc.subr contains lines like: SYSCTL="/sbin/sysctl" ID="/usr/bin/id" for few tools, rest is assumed to work with provided PATH. To sum up, use service(8) and you will be fine. -- Mateusz Guzik