MagniComp Sysinfo from the cron!

2007-12-25 3:45:00

Hi all,

I created a non-providledged user called sysinfo and put this in his
crontab:

34 * * * 1 /home/sysinfo/src/sysinfo/bin/sysinfo -class all | grep -v
"sie\:" > /home/sysinfo/logs/sysinfo.`hostname`.`domainname`.`date
+%d.%m.%y.%H\:%M\:%S` 2>&1

The grep -v sie is to remove the error messages like these, which is fine
since I don't need to run sysinfo as root:

sie: WARNING: This program should be run as `root' (uid=0) to obtain all
supported information. Please either make setuid to
root (chown root sysinfo;chmod u+s sysinfo) or invoke as a uid=0 user such
as `root'.
sie: cannot open /dev/kmem

The problem is that the cron fails. If I run this from the cli then the
output is fine. Its only when I run this from cron if fails. The sysinfo
accounts Email from cron reads:

>From sysinfo Mon Jul 26 04:35:56 2004
Date: Mon, 26 Jul 2004 04:35:56 -0400 (CLT)
From: Sysinfo <sysinfo>
To: sysinfo
Subject: Output from "cron" command

Your "cron" job on aguila
/home/sysinfo/src/sysinfo/bin/sysinfo -class all | grep -v "sie\:" >
/home/sysinfo/logs/sysinfo.`hostname`.`domainname`.`date +

produced the following output:

sie: WARNING: This program should be run as `root' (uid=0) to obtain
all supported information. Please either make setuid to
root (chown root sysinfo;chmod u+s sysinfo) or invoke as a
uid=0 user such as `root'.
sie: cannot open /dev/kmem
sie: cannot open /dev/kmem
sie: cannot open /dev/kmem
sie: WARNING: This program should be run as `root' (uid=0) to obtain
all supported information. Please either make setuid to
root (chown root sysinfo;chmod u+s sysinfo) or invoke as a
uid=0 user such as `root'.

As a result nothing is sent to the log file via cron, but the log file is
created when run from the CLI.

Does anyone know why this job fails?

Rdgs/Atentamente,
Simon.

---
Simon Loewenthal
Gemini Observatory
Information Systems Group
Video 139.229.33.88
Voice +56 51 205610

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 22/07/2004

Comments

Got something to say?

You must be logged in to post a comment.