Restart service problem with sudo

Sil <Spam> smog1 at free.fr
Wed Mar 28 08:30:44 CEST 2007


Le mardi 27 mars 2007 21:00, Andy Shellam a écrit :
> check your /etc/sudoers
> file does not have a "defaults requiretty" option set - if it does,
> comment it out and try your event handler again.

Thanks, I check my sudoers file and there's no "defaults requiretty" 
line but
I've try it and the result is :
Mar 27 19:21:01 localhost sudo:   nagios : sorry, you must have a tty to 
run
sudo ; TTY=unknown ; PWD=/var/log/nagios ; USER=root ;
COMMAND=/etc/init.d/mysql restart

and if I change the line in "defaults ! requiretty" or if I remove it the
result is the same :
Mar 27 19:23:01 localhost sudo:   nagios : TTY=unknown ; 
PWD=/var/log/nagios ;
USER=root ; COMMAND=/etc/init.d/mysql restart
But mysql don't restart.
I don't understand. :-(

I test a cron job too with the plugin on the nagios user and it works !
# 23 19 27 3 2 /usr/lib/nagios/plugins/eventhandlers/restart-mysql CRITICAL
SOFT 3
The log (the same) :
Mar 27 19:38:21 localhost sudo:   nagios : TTY=unknown ; 
PWD=/var/log/nagios ;
USER=root ; COMMAND=/etc/init.d/mysql restart
And mysql restarts !

It's very strange a cron job works but a nagios command fail and no logs 
have
any errors.

If someone have any ideas...
Thanks
Sil

PS sorry for the answer on your personal address.




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list