Changeset - da535d6bf47b
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-10-20 16:26:20
hanzz.k@gmail.com
Show some output from spectrum2_manager
1 file changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
spectrum_manager/src/main.cpp
Show inline comments
 
@@ -149,9 +149,14 @@ static void start_all_instances(ManagerConfig *config) {
 
					std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
 
				}
 
 
				if (!isRunning(CONFIG_STRING(&cfg, "service.pidfile"))) {
 
				int pid = isRunning(CONFIG_STRING(&cfg, "service.pidfile"));
 
				if (pid == 0) {
 
					std::cout << "Starting " << itr->path() << ": OK\n";
 
					exec_(spectrum2_binary, itr->path().string());
 
				}
 
				else {
 
					std::cout << "Starting " << itr->path() << ": Already started (PID=" << pid << ")\n";
 
				}
 
			}
 
		}
 
	}
 
@@ -185,8 +190,12 @@ static void stop_all_instances(ManagerConfig *config) {
 
 
				int pid = isRunning(CONFIG_STRING(&cfg, "service.pidfile"));
 
				if (pid) {
 
					std::cout << "Stopping " << itr->path() << ": OK\n";
 
					kill(pid, SIGTERM);
 
				}
 
				else {
 
					std::cout << "Stopping " << itr->path() << ": Not running\n";
 
				}
 
			}
 
		}
 
	}
0 comments (0 inline, 0 general)