restart.c (725B)
1 /************************************************************************* 2 * This file is part of Crosroads 1.23, a load balancer and fail over 3 * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. 4 * Visit http://crossroads.e-tunity.com for information. 5 *************************************************************************/ 6 #include "crossroads.h" 7 8 int restart (int ac, char **av) { 9 10 create_commandline_space(); 11 12 /* First run the 'stop' action. */ 13 if (!stop_daemon (ac, av)) 14 error ("Daemon stop failed, restart failure"); 15 16 sleep (1); 17 18 /* Now run 'start' */ 19 if (!serve (ac, av)) 20 error ("Daemon start failed, restart failure"); 21 22 /* All ok.. */ 23 return (1); 24 }