summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1996-05-18 20:30:04 +0000
committernate <nate@FreeBSD.org>1996-05-18 20:30:04 +0000
commit44df49b4536a35c7bf54ae9eaa3b4c33942dbf37 (patch)
tree1c45cd09375e360e4bbc63012260d7ced835f1de
parent48c7921229adb774573ec2bf35cde958636a4578 (diff)
downloadFreeBSD-src-44df49b4536a35c7bf54ae9eaa3b4c33942dbf37.zip
FreeBSD-src-44df49b4536a35c7bf54ae9eaa3b4c33942dbf37.tar.gz
Fixed *annoying* error with the weekly files. Do you get these whenver
/etc/weekly is run? Rebuilding locate database: stty: stdin isn't a terminal TERM: Undefined variable. 'su' apparently runs in root's environment before doing a seteuid(), so it reads root's .cshrc. The problem lies in the fact that $prompt is *always* set by the time the command is executed, so you can't protect your interactive commands from the non-interactive commands by the normal: if ($?prompt) then # interactive stuff here endif Set the -f flag (su -fm) which causes it not to read root's .cshrc file, since there should be no reason to do so for these scripts since /etc/crontab sets up all of the necessary environment.
-rw-r--r--etc/weekly6
1 files changed, 3 insertions, 3 deletions
diff --git a/etc/weekly b/etc/weekly
index 0e283e1..3c32b56 100644
--- a/etc/weekly
+++ b/etc/weekly
@@ -1,7 +1,7 @@
#!/bin/sh -
#
# @(#)weekly 5.14 (Berkeley) 6/23/91
-# $Id: weekly,v 1.14 1996/05/12 21:10:34 wosch Exp $
+# $Id: weekly,v 1.15 1996/05/13 22:05:10 wosch Exp $
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
export PATH
@@ -46,7 +46,7 @@ echo ""
echo "Rebuilding locate database:"
locdb=/var/db/locate.database
touch ${locdb}; chown nobody ${locdb}; chmod 644 ${locdb}
-echo /usr/libexec/locate.updatedb | nice -5 su -m nobody 2>&1 |\
+echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody 2>&1 |\
fgrep -v 'Permission denied'
chmod 444 ${locdb}
@@ -58,7 +58,7 @@ makewhatis.local "${MANPATH}"
#echo ""
#echo "Reformatting manual pages:"
-#echo catman.local "${MANPATH}" | su -m man
+#echo catman.local "${MANPATH}" | su -fm man
echo ""
echo "Cleaning up kernel database files:"
OpenPOWER on IntegriCloud