Marius Burkard
2016-07-10 e1ceb050e19c7574bca146a8da7047ee4ff456b5
server/mods-available/xmpp_module.inc.php
@@ -79,6 +79,8 @@
        */
        $app->modules->registerTableHook('xmpp_domain', 'xmpp_module', 'process');
        $app->services->registerService('metronome', 'xmpp_module', 'reloadXMPP');
        $app->services->registerService('metronome', 'xmpp_module', 'restartXMPP');
    }
@@ -104,6 +106,25 @@
        } // end switch
    } // end function
    function restartXMPP($action = 'restart') {
        global $app, $conf;
        // load the server configuration options
        $app->uses('getconf,system');
        $daemon = 'metronome';
        $retval = array('output' => '', 'retval' => 0);
        if($action == 'restart') {
            $cmd = $app->system->getinitcommand($daemon, 'restart');
        } else {
            $cmd = $app->system->getinitcommand($daemon, 'reload');
        }
        exec($cmd.' 2>&1', $retval['output'], $retval['retval']);
        $app->log("Restarting xmpp: $cmd", LOGLEVEL_DEBUG);
        return $retval;
    }
} // end class
?>