SCO UNIX 3.2.2 Can't set login uid from cron

Eamonn McManus em at dce.ie
Sat Apr 6 00:13:56 AEST 1991


mju at mudos.ann-arbor.mi.us (Marc Unangst) writes:
>Bad move.  SCO Unix cron, in order to set the LUID to run jobs as
>another user, has to run WITHOUT an LUID.  Since there is no way to
>reset your LUID once it's set, and no way to un-set it, cron has to be
>started from the rc scripts, not from a shell prompt.

As an alternative to launching cron from rc, you can have it spawned by
init.  This is a little complicated, because the first thing the cron
daemon does is to fork itself into the background.  If you just try to
launch it from inittab, init will think it has finished immediately and
will end up launching a lot of cron daemons.  What we do here is to launch
a shell script that starts cron and then execs `pause', a program that
just does a pause() system call.  Then when we want a new cron, we kill
the existing cron and the `pause'.

By the way, 3.2.0 at least does not have a -u option to crontab, making it
really unpleasant to change the crontab for another user except by using
this technique or su-ing to that user.  If you use the default su it can
be quite hard to su to another user even if you know their password.
Luckily we have installed a replacement su too.

,
Eamonn

Here is /etc/startcron, which we invoked from /etc/inittab:
: use /bin/sh
# Start cron by removing an old FIFO and starting cron itself.
# We need this script because inittab commands are execed so there
# can't be more than one shell command.
# Aug 17 1990
rm -f /usr/lib/cron/FIFO
trap "" 2 3	# Don't let console quit and intr affect cron.
. /etc/TIMEZONE	# Probably don't need
/etc/cron
# Cron forks into the background so this script waits forever; kill the
# script when you kill cron, if you want to start a new cron.
exec /etc/pause



More information about the Comp.unix.sysv386 mailing list