예제 #1
0
        private static void do_reinit(ServiceController ctl)
        {
            try
            {
                ctl.Stop();
                ctl.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(5));
            }
            catch (Exception e)
            {
                ChMonitoring.Helpers.Logger.Log.Error("Couldn't stop MonitWindowsAgent service");
                return;
            }

            ControlFileParser.parse();

            try
            {
                ctl.Start(new string[] { "reloaded" });
                ctl.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(5));
            }
            catch (Exception e)
            {
                ChMonitoring.Helpers.Logger.Log.Error("Couldn't start MonitWindowsAgent service");
                return;
            }
        }
예제 #2
0
 private static void do_init()
 {
     ControlFileParser.parse();
 }