LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-01-2012, 11:39 AM   #1
buee
Member
 
Registered: May 2009
Posts: 81

Rep: Reputation: 16
Restart FreeRadius from PHP Script (Run command as another user)


Ok, so I've been trying to find a way to refresh the configuration files of FreeRadius from a PHP page that I've been working on. I can do this one of two ways:
  1. /etc/init.d/freeradius force-reload
  2. /usr/sbin/freeradius -C

However, the trouble I'm running in to is privileges. I know I have to do this from the sudoers file, but I can't seem to get it to work. The user for apache is www-data as default, the user for FreeRadius is freerad. My assumption is that I need to give www-data permissions to run one of those commands (preferably /usr/sbin/freeradius -C) as either root or freerad without prompting for a password. But HOW?!

I've edited the sudoers file a million different times. Anything that's bold is something I haven't changed:

Code:
www-data        localhost = (ALL) NOPASSWD: /usr/sbin/freeradius -C
I have a feeling it's something stupid like a space where it shouldn't be, but I've played around with different formatting and still can't get the command to work. What's worse is the /usr/sbin/freeradius -C doesn't return an output that I can tell nor does an entry appear to show up in /var/log/auth.log. My brain is shot, someone help me please.
 
  


Reply

Tags
apache2, freeradius, permissions, sudoers


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH into a windows PC and run a command from PHP script peterjfrancis Linux - Newbie 6 07-30-2009 12:10 PM
run php script from command line blizunt7 Programming 11 11-06-2008 11:59 AM
Command to log a user out? Or restart X within a script? BogusTrumper Linux - Desktop 1 06-29-2007 02:05 PM
to run a html or php script with php5 command vincent_fr_60 Linux - Software 1 01-20-2006 06:41 AM
Is their a way to run a command as root..or another user.. in php BaerRS Programming 2 04-25-2002 02:38 PM


All times are GMT -5. The time now is 09:30 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration