From owner-freebsd-questions@FreeBSD.ORG Thu Oct 2 15:12:03 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 0E4A81065686 for ; Thu, 2 Oct 2008 15:12:03 +0000 (UTC) (envelope-from dave.list@pixelhammer.com) Received: from smtp2.tls.net (smtp2.tls.net [65.124.104.105]) by mx1.freebsd.org (Postfix) with ESMTP id A98498FC15 for ; Thu, 2 Oct 2008 15:12:02 +0000 (UTC) (envelope-from dave.list@pixelhammer.com) Received: (qmail 82544 invoked from network); 2 Oct 2008 15:12:01 -0000 Received: by simscan 1.2.3 ppid: 82527, pid: 82541, t: 0.1325s scanners: attach: 1.2.3 spam: 3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on smtp-2.tls.net X-Spam-Level: X-Spam-Status: No, score=0.2 required=10.0 tests=ALL_TRUSTED,TVD_RCVD_IP autolearn=disabled version=3.2.1 Received: from 64-184-11-201.bb.hrtc.net (HELO ?192.168.1.46?) (ldg@tls.net@64.184.11.201) by ssl-smtp2.tls.net with ESMTPA; 2 Oct 2008 15:12:01 -0000 Message-ID: <48E4E4B8.90202@pixelhammer.com> Date: Thu, 02 Oct 2008 11:11:52 -0400 From: DAve User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: 'User Questions' Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Running cron jobs as nobody 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: Thu, 02 Oct 2008 15:12:03 -0000 Good morning all, We have a cronjob we need to run as nobody from /etc/crontab and it seems to be not working. The job runs, but not as user nobody. I noticed two things, 1) the job to update the locate DB runs as nobody, because the script uses su to become nobody. echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody || rc=3 2) nobody, as expected, has no shell or home dir in /etc/password. I searched around for an answer but didn't see anything concerning this other than a patch to cron to check if setuid fails. Is setting the user to nobody in /etc/crontab not possible? Thanks, DAve -- Don't tell me I'm driving the cart!