Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!jupiter!al From: al@ee.pitt.edu (Alan Martello) Newsgroups: comp.lang.perl Subject: why does system() not work when from root's crontab? Message-ID: <6998@pitt.UUCP> Date: 1 Mar 90 19:47:13 GMT Sender: news@pitt.UUCP Reply-To: al@ee.pitt.edu (Alan Martello) Organization: University of Pittsburgh Electrical Engineering Dept. Lines: 35 Ok, I regret not having followed the previous discussion concerning privledged "perl" programs, but anyway... I have a perl program which 1) kills processes (via the perl call 'kill') 2) attempts to unmount file systems 3) backs up the file systems which were successfully unmounted 4) remounts all file systems My perl script works fine when I run it as root interactively, however, when it is run from crontab (as root), I can kill the processes just fine, but the "umount", "dump" and "mount -av" commands all fail. I am calling these programs via a perl system() call. I was (finally) able to get it to work by copying the desired programs, (mount, umount, and dump) and making the PROGRAMS setuid (I also made the mode 700 for good measure). Now, the question I have is why did I have to do it this way? Is perl being too cautious when performing the "system" calls or is crontab getting in the way? Trying to use /usr/local/bin/suidperl didn't work any better since perl complained about the pipe which I was openned to /bin/mail to log information about the backups.... I'm running on a Sun 3 under 4.0.1 (perl patchlevel 6) A confused perl programmer... ******************************************************************* Alan R. Martello Electrical Engineering Dept. al@ee.pitt.edu University of Pittsburgh *******************************************************************