Running cron jobs as nobody

Mel fbsd.questions at rachie.is-a-geek.net
Sun Oct 5 17:09:04 UTC 2008


On Thursday 02 October 2008 17:11:52 DAve wrote:
> 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
                                                 ^^^
-fm: Bypass .cshrc and only change user, use root env.

> Is setting the user to nobody in /etc/crontab not possible?

pw showuser operator
pw showuser nobody

Spot the difference (hint: /nonexistent)

-- 
Mel

Problem with today's modular software: they start with the modules
    and never get to the software part.


More information about the freebsd-questions mailing list