From owner-freebsd-questions@FreeBSD.ORG Tue Jun 24 18:28:41 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0F581065670 for ; Tue, 24 Jun 2008 18:28:41 +0000 (UTC) (envelope-from kdk@daleco.biz) Received: from ezekiel.daleco.biz (southernuniform.com [66.76.92.18]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6B58FC1A for ; Tue, 24 Jun 2008 18:28:41 +0000 (UTC) (envelope-from kdk@daleco.biz) Received: from localhost (localhost [127.0.0.1]) by ezekiel.daleco.biz (8.13.8/8.13.8) with ESMTP id m5OISdGW047341; Tue, 24 Jun 2008 13:28:39 -0500 (CDT) (envelope-from kdk@daleco.biz) X-Virus-Scanned: amavisd-new at daleco.biz Received: from ezekiel.daleco.biz ([127.0.0.1]) by localhost (ezekiel.daleco.biz [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ujxMk-HDt6cv; Tue, 24 Jun 2008 13:28:36 -0500 (CDT) Received: from archangel.daleco.biz (dsl.daleco.biz [209.125.108.70]) by ezekiel.daleco.biz (8.13.8/8.13.8) with ESMTP id m5OISY1C047335; Tue, 24 Jun 2008 13:28:35 -0500 (CDT) (envelope-from kdk@daleco.biz) Message-ID: <48613CCD.9080202@daleco.biz> Date: Tue, 24 Jun 2008 13:28:29 -0500 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.11) Gecko/20080213 SeaMonkey/1.1.7 MIME-Version: 1.0 To: Nicolas Letellier References: <20080624201720.e90b1a07.nicolas@nicoelro.net> In-Reply-To: <20080624201720.e90b1a07.nicolas@nicoelro.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions Subject: Re: restart named in a cron X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2008 18:28:41 -0000 Nicolas Letellier wrote: > Hi. > > I want to restart named in a script executed by a cron. My script is: > > #!/bin/sh > # verify named conf and restart it > /usr/sbin/named-checkconf > if [ ! $? -eq 0 ]; then > echo "Errors when verifying named configuration" > exit 1 > else > /etc/rc.d/named restart > /dev/null > fi > > # Ok, it's done > exit 0 > > > However, the cron returns some errors: > umount: not found > mtree: not found > umount: not found > mount: not found > /etc/rc.d/named: WARNING: devfs_domount(): Unable to mount devfs on /var/named/dev > devfs: not found > devfs: not found > > I can restart named manually, but not with a cron. > > Do you have an idea to solve this problem? Why could I restart it manually and not with a cron? > cron doesn't know about your $PATH, but has a very limited $PATH of its own. Rewrite the script using the full pathnames to the desired executables. Kevin Kinsey -- But these pills can't be habit forming; I've been taking them for years.