Re: Crontab v. Applescript & Command Line
Re: Crontab v. Applescript & Command Line
- Subject: Re: Crontab v. Applescript & Command Line
- From: John W Baxter <email@hidden>
- Date: Thu, 15 Nov 2001 12:26:53 -0800
At 10:38 -0800 11/15/2001, Christopher Nebel wrote:
>
> Could a task started by cron use the su command to change its ownership
>
> from root to some other user or start a process that would be owned by
>
> some other user? If this works, it would amount to a 5th option for
>
> Gary, wouldn't it?
>
>
I don't think so, but it might be worth trying anyway. su (and the
>
underlying setuid function) change the user id of the process, but I
>
doubt that affects the process group. I'm not enough of a Unix geek to
>
know for sure.
Processes started in an individual user's crontab are run as that user
(which makes them rather safer than those run out of the system crontab,
which is /etc/crontab).
Processes started in the system crontab are run as the user specified in
the line for that task...it is so often "root" in /etc/crontab that people
tend to think that the word root is some sort of required syntax.
I doubt that the process group is affected by either of these. Can I
successfully execute setsid as part of a root (or, worse, nonroot) cron
task, thereby creating a new process group? I've never had to find out,
but I'm doubtful.
See
man crontab
for the means of creating a user crontab (the program which does so is
called crontab...unfortunately so is the file). And if you experimented,
be prepared to be tossed into the vi editor, although there is a way to
create a text file and hand that to the crontab program.
See
man 5 crontab
for a description of a crontab file (the format differs slightly between a
user and a system crontab).
--John