Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Dec 2008
    Posts
    153

    Default 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
    0 pureftpd No such service
    0 proftpd No such service
    0 ftpserver No such service
    Any idea? I know im using pure-ftpd
    pure-ftpd 0ff 1ff 2ff 3n 4ff 5n 6ff

  2. #2
    Member
    Join Date
    Dec 2008
    Posts
    153

    Default

    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 09:34 PM.

  3. #3
    Member
    Join Date
    Dec 2008
    Posts
    153

    Default

    anyone got any ideas for this one?

  4. #4
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    On this one - RestartService < AllDocumentation/AutomationIntegration < TWiki

    So you should be passed "ftpd" into the service name.
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  5. #5
    Member
    Join Date
    Dec 2008
    Posts
    153

    Default

    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

  6. #6
    Member
    Join Date
    Dec 2008
    Posts
    153

    Default

    got it!
    PHP Code:
    $str $xmlapi-> xmlapi_query('reboot', array('force'=>1)); 

Similar Threads & Tags
Similar threads

  1. Restart Services - are these all graceful?
    By spaceman in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-12-2007, 05:17 PM
  2. restart services
    By shanit in forum New User Questions
    Replies: 6
    Last Post: 12-21-2005, 10:37 AM
  3. How do you restart services from shell?
    By bjdea1 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 06-17-2004, 04:15 PM
  4. Restart Services Not Working
    By Lamar in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 07-29-2003, 04:03 AM
  5. Auto Restart of Services
    By LinuxFreaky in forum cPanel and WHM Discussions
    Replies: 17
    Last Post: 09-11-2002, 01:27 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube