/// <summary> /// Stop the Chef Client windows service. /// </summary> /// <param name="timeToWait">Wait time for operation to complete.</param> /// <param name="terminateOnFailure">Should the process terminate the processes of the Client service if it failes to stop in alloted time.</param> public static void Stop(TimeSpan timeToWait, bool terminateOnFailure) { var service = new WindowsService() { Name = "chef-client", TerminateOnFailure = terminateOnFailure, TimeToWait = timeToWait }; service.Stop(); }
/// <summary> /// Start Chef Client windows service. /// </summary> public static void Start(TimeSpan timeToWait) { RoleEnvironment.Changing += ChefConfigChanging; RoleEnvironment.StatusCheck += Chef_StatusCheck; // Start Chef Client - wait 30 seconds var service = new WindowsService() { Name = "chef-client", TimeToWait = timeToWait }; service.Start(); ClientService.statusCheckFilePath = CloudConfigurationManager.GetSetting("ChefClient_SetBusyCheck"); }