Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old October 15th, 2004, 07:52 PM
cscartman cscartman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 307 cscartman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Restarting bind and displaying output?

i have the code below but i need to have some kind of output...
The reason im using this code is, im making a hosting with cpanel and such. but the problem is my ISP told me its smart to restart BIND after each signup. So im doing so, but i want it to send me a email and i want output of the bind restart...

php Code:
Original - php Code
  1.  
  2. exec("/usr/sbin/ndc restart");


Thats all i have right now, i know for sure it does restart, but i want that emailed to me as well... well many thanks

Reply With Quote
  #2  
Old October 15th, 2004, 10:00 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Restarting bind and displaying output?

read up on the mail() function.

to get your output, do this:

$output = system('/usr/sbin/ndc restart');

that will store the command output into the $output variable.

By the way, you need to make sure you have sufficient privileges to execute that comand. Root access is usually required to restart a daemon.


Reply With Quote
  #3  
Old October 15th, 2004, 10:15 PM
cscartman cscartman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 307 cscartman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Restarting bind and displaying output?

i have a dedicated server and i know how to use mail(); plus i dont use mail i use a smtp class i made. Im just not familar with linux commands or using system();

Reply With Quote
  #4  
Old October 15th, 2004, 10:30 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Restarting bind and displaying output?

I can all but guarantee that you are going to run into permissions problems when restarting bind from a web application.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > Restarting bind and displaying output?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway