1748028 Members
5051 Online
108757 Solutions
New Discussion юеВ

Re: su from cron

 
James R. Ferguson
Acclaimed Contributor

Re: su from cron

Hi (again):

> Right now only root user has cron and because of service guard they just want one crontab to maintain... Small IT group.

Regardless, would you humor us and try running as a crontask of 'wmsusr' (without the need to 'su')?

> Hostname is a bad var name but I don't see how it causes the problem

Of course not. I merely was pointing out that when you ask someone to look at your code, it always helps to have used *meaningful* variable names. You wouldn't show me an orange and tell me that the apple you have is rotten, would you?

Regards!

...JRF...
Wilfred Chau_1
Respected Contributor

Re: su from cron

what is the result, if you do not invoking a login shell? i.e.

50 * * * * "su wmsusr -c /wms/app/zabbix/check_zabbix.sh"
P-Dicky
Frequent Advisor

Re: su from cron

Hi All... I just moved the su into the script and it is fine now...
echo 4
su - wmsusr -c "/wms/app/zabbix/zabbix_agentd -c /wms/app/zabbix/zabbix_agentd.conf"
echo 5

P-Dicky
Frequent Advisor

Re: su from cron

See above, opps.