Date: Wed, 25 Jun 2008 09:50:58 +0200 From: Nicolas Letellier <nicolas@nicoelro.net> To: Manolis Kiagias <sonic2000gr@gmail.com> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: restart named in a cron Message-ID: <20080625095058.25af42c8@nogrod.nicoelro.net> In-Reply-To: <4861418A.30603@gmail.com> References: <20080624201720.e90b1a07.nicolas@nicoelro.net> <4861418A.30603@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Le Tue, 24 Jun 2008 21:48:42 +0300, Manolis Kiagias <sonic2000gr@gmail.com> a =E9crit : > 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? > > > > Thanks! > > > > =20 > Well, probably cron does not share your environment, thus it does > not have your PATH. It simply cannot find the commands you see as > "not found". Try inserting something like: >=20 > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/loca= l/bin:/usr/X11R6/bin >=20 > at the top of your script. Alternatively, you could use full paths to=20 > the commands in the script, but it seems the errors come from the > system scriprt, /etc/rc.d/named and you wouldn't want to touch that. > Thanks, it works when I define my PATH in the script. Indeed, I couldn't add full path in the script because the error was due to /etc/rc.d/named script. Thanks for the help! --=20 - Nicolas.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080625095058.25af42c8>