Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!dce.ie!em From: em@dce.ie (Eamonn McManus) Newsgroups: comp.unix.sysv386 Subject: Re: SCO UNIX 3.2.2 Can't set login uid from cron Message-ID: Date: 5 Apr 91 14:13:56 GMT References: <1991Apr02.123535.11230@pfm.rmt.sub.org> Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 37 mju@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