0

I use a program to check raid status. The command is megaclisas-status.

Here is the issue :

Has user /usr/sbin/megaclisas-status return : This script requires Administrator privs => OK

Has root /usr/sbin/megaclisas-status return : -- Controller information -- .... => OK

In root crontab 0 */12 * * * bash /root/scripts/script.sh > /root/log/script.log 2>&1 return : This script requires Administrator privs => WHY ???

Some one have an idea why I can't use this command in root crontab ?


Here is the content of the script.sh :

raid=$(/usr/sbin/megaclisas-status) /usr/bin/zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k system.raid.disk.status -o "$raid"


Here is the rights of the scripts : -rwx------ 1 root root 131 févr. 11 14:11 scriptsh

1 Answer 1

0

The issue was not come from cron but programe itself.

It was written in python and os.getenv("USER") return none in cron, os.getenv("LOGNAME") fix the issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .