[root@devel3 log]# cat /etc/sudoers # sudoers file. # This file MUST be edited with the 'visudo' command as root. # See the sudoers man page for the details on how to write a sudoers file. # let apache send HUP to squid apache ALL=NOPASSWD:/home/www/utility/sendHUP.pl [root@devel3 log]# ll /home/www/utility/sendHUP.pl -rwxr-xr-x 1 apache coders 1114 Mar 10 02:43 /home/www/utility/sendHUP.pl [root@devel3 log]# cat /home/www/utility/sendHUP.pl #!/usr/bin/perl -w # this script need to be run as root, to do this we add an entry to # /etc/sudoers so that apache can run it (you edit using visudo) # visudo -f /etc/sudoers # add this line # apache ALL=NOPASSWD:/home/www/utility/sendHUP.pl # call as system('sudo', '/home/www/utility/sendHUP.pl'); (kill HUP, $PROGRAM) or exit 42; exit 0;