public static void Stop() { var conf = Application.CurrentConfiguration.Network.WpaSupplicant; var serviceName = CommonString.Append("wpa_supplicant@", conf.Interface, ".service"); Systemctl.Stop(serviceName); }
public static void Stop() { Systemctl.Stop(ServiceName1); Systemctl.Stop(ServiceName2); Systemctl.Stop(ServiceName3); ConsoleLogger.Log("[samba] stop"); }
private static void SaveKeepalived(ClusterNetwork networkConfig, ClusterNode[] nodesConfig) { if (networkConfig == null) { ConsoleLogger.Log("[cluster] keepalived not configured: missing network parameters"); return; } if (!networkConfig.Active) { ConsoleLogger.Log("[cluster] shared network is disabled"); return; } var ports = networkConfig.PortMapping; if (!ports.Any()) { ConsoleLogger.Log("[cluster] exit: !ports.Any()"); return; } ConsoleLogger.Log("[cluster] init keepalived"); const string keepalivedService = "keepalived.service"; if (Systemctl.IsActive(keepalivedService)) { ConsoleLogger.Log("[cluster] stop service"); Systemctl.Stop(keepalivedService); } ConsoleLogger.Log("[cluster] set configuration file"); var lines = new string[] { "vrrp_script chk_haproxy {", " script \"killall -0 haproxy\"", " interval 30", " weight 2", "}", "", "vrrp_instance RH_INT {", $" interface {networkConfig.NetworkInterface}", " state MASTER", " virtual_router_id 51", $" priority 100", " virtual_ipaddress {", $" {networkConfig.VirtualIpAddress}", " }", " track_script {", " chk_haproxy", " }", "}", }; File.WriteAllLines(keepalivedFileOutput, lines); Keepalived.Stop(); Keepalived.Start(keepalivedFileOutput); }
public static void Stop() { Systemctl.Stop(serviceName); ConsoleLogger.Log("[gluster] stop"); }
public static void Stop() { Systemctl.Stop(ServiceName); ConsoleLogger.Log("[nginx] stop"); }