== mbrownnyc [266b4002@gateway] has joined ##linux
-ChanServ- [##linux] Welcome to ##Linux! Can't speak? Please see http://linuxassist.net/irc on how to register or identify your nick. By joining this channel you agree to abide by the channel rules and guidelines stated on the official ##Linux website http://www.linuxassist.net/rules .
<loomsen> there are different ways to solve this, but all of them are ugly and discouraged
<loomsen> mbrownnyc, you could add apache to the icinga group, make that script ug+x and set a sticky bit
<nb-ben> mbrownnyc, you should take a look at suEXEC for php
<koala_man> mbrownnyc: works fine: http://pastebin.com/JhefHzCh
<koala_man> mbrownnyc: I still think you're just confusing your users
<koala_man> mbrownnyc: you add permissions for apache to run lconf_deploy as root, and then test using your icinga user
<koala_man> to run it as apache
Solução:
# cat /etc/passwd | grep icinga
icinga:x:499:500:icinga:/var/icinga:/bin/false
# cat /etc/passwd | grep apache
apache:x:48:48:Apache:/var/www:/bin/false
# grep -v "#" /etc/sudoers
Defaults !requiretty
Defaults !visiblepw
Defaults always_set_home
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
root ALL=(ALL) ALL
User_Alias LCONF=apache,icinga
Defaults:LCONF !requiretty
LCONF ALL=(apache) NOPASSWD: /usr/local/LConf/lconf_deploy.sh
LCONF ALL=(icinga) NOPASSWD: /usr/local/LConf/LConfExport.pl -o /etc/icinga/lconf -v
# cat /usr/local/LConf/lconf_deploy.sh
#!/bin/bash
echo start of script
sudo -u icinga /usr/local/LConf/LConfExport.pl -o /etc/icinga/lconf -v
/etc/init.d/icinga reload