#1 (permalink)  
Old 06-22-2009, 11:55 AM
Registered User
 
Join Date: Dec 2008
Posts: 145
jhyland87 is on a distinguished road
Restart Services?

I am trying to make a script that will restart services via php. Here is what I have

PHP Code:
        $service 'pureftpd';
        print 
$xmlapi-> restartsrv($service);
        echo 
"<br>";
        
$service 'proftpd';
        print 
$xmlapi-> restartsrv($service);
        echo 
"<br>";
        
$service 'ftpserver';
        print 
$xmlapi-> restartsrv($service); 
Here is what it returns
Quote:
0 pureftpd No such service
0 proftpd No such service
0 ftpserver No such service
Any idea? I know im using pure-ftpd
Quote:
pure-ftpd 0ff 1ff 2ff 3n 4ff 5n 6ff
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-22-2009, 01:20 PM
Registered User
 
Join Date: Dec 2008
Posts: 145
jhyland87 is on a distinguished road
In addition to the above, i was looking at RebootServer < AllDocumentation/AutomationIntegration < TWiki, but I couldnt figure out how to enforce the reboot.

PHP Code:
print $xmlapi-> restartsrv('graceful'); 
and
PHP Code:
print $xmlapi-> restartsrv(1); 
didnt seem to do the trick

Last edited by jhyland87; 06-22-2009 at 08:34 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-24-2009, 12:56 AM
Registered User
 
Join Date: Dec 2008
Posts: 145
jhyland87 is on a distinguished road
anyone got any ideas for this one?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-24-2009, 11:39 AM
Staff
 
Join Date: Apr 2005
Location: Houston, TX
Posts: 212
cPanelMatt is on a distinguished road
On this one - RestartService < AllDocumentation/AutomationIntegration < TWiki

So you should be passed "ftpd" into the service name.
__________________
Matt Dees
cPanel, Inc.
cPanel Integration Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-24-2009, 12:07 PM
Registered User
 
Join Date: Dec 2008
Posts: 145
jhyland87 is on a distinguished road
Awesome, will try that, any idea on the full server reboot? Thats kind of a big one right now. I have an extra cpanel server, but only for a few days, I dont wanna test rebooting on a production server, lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-24-2009, 12:36 PM
Registered User
 
Join Date: Dec 2008
Posts: 145
jhyland87 is on a distinguished road
got it!
PHP Code:
$str $xmlapi-> xmlapi_query('reboot', array('force'=>1)); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
restart services shanit cPanel Newbies 6 12-21-2005 09:37 AM
Restart Services WHM jackal cPanel and WHM Discussions 18 06-17-2005 01:50 AM
Restart Services (ProFTPd) ??? flash7 cPanel and WHM Discussions 3 09-10-2004 01:09 AM
How do you restart services from shell? bjdea1 cPanel and WHM Discussions 3 06-17-2004 03:15 PM
Auto Restart of Services LinuxFreaky cPanel and WHM Discussions 17 09-11-2002 12:27 PM


All times are GMT -5. The time now is 06:56 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc