Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 06-01-2012, 12:39 PM   #1
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:

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.
Old 11-19-2018, 05:01 AM   #2
LQ Newbie
Registered: Nov 2018
Posts: 1

Rep: Reputation: Disabled
I am struggling

How did you achieve the same. I am using freeradius with mysql and i want to restart freeradius after any changes.


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 01:10 PM
run php script from command line blizunt7 Programming 11 11-06-2008 12:59 PM
Command to log a user out? Or restart X within a script? BogusTrumper Linux - Desktop 1 06-29-2007 03:05 PM
to run a html or php script with php5 command vincent_fr_60 Linux - Software 1 01-20-2006 07:41 AM
Is their a way to run a command as root..or another user.. in php BaerRS Programming 2 04-25-2002 03:38 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 AM.

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