The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Restart Services?

Discussion in 'cPanel Developers' started by jhyland87, Jun 22, 2009.

  1. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    I am trying to make a script that will restart services via php. Here is what I have

    PHP:
            $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
    Any idea? I know im using pure-ftpd
     
  2. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    #2 jhyland87, Jun 22, 2009
    Last edited: Jun 22, 2009
  3. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    anyone got any ideas for this one?
     
  4. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  5. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    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. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    got it!
    PHP:
    $str $xmlapi-> xmlapi_query('reboot', array('force'=>1));
     
Loading...

Share This Page