+ app.add_option("--syslog");
+ }
+
+ // Update pid_file
+ {
+ if (_pid_file.empty() and set_pid_file() == false)
+ {
+ return false;
+ }
+
+ pid_file_option(app, pid_file());
+ }
+
+ assert(daemon_file_option());
+ if (daemon_file_option() and not is_valgrind() and not is_helgrind())
+ {
+ app.add_option(daemon_file_option());
+ }
+
+ if (_is_socket and has_socket_file_option())
+ {
+ if (not set_socket_file())
+ {
+ return false;
+ }
+
+ socket_file_option(app, _socket);
+ }
+
+ if (has_port_option())
+ {
+ port_option(app, _port);
+ }
+
+ for (Options::const_iterator iter= _options.begin(); iter != _options.end(); iter++)
+ {
+ if ((*iter).second.empty() == false)
+ {
+ app.add_option((*iter).first, (*iter).second);
+ }
+ else
+ {
+ app.add_option((*iter).first);
+ }
+ }
+
+ return true;
+}
+
+bool Server::is_debug() const
+{
+ return bool(getenv("LIBTEST_MANUAL_GDB"));
+}
+
+bool Server::is_valgrind() const
+{
+ return bool(getenv("LIBTEST_MANUAL_VALGRIND"));
+}
+
+bool Server::is_helgrind() const
+{
+ return bool(getenv("LIBTEST_MANUAL_HELGRIND"));
+}
+
+bool Server::kill(pid_t pid_arg)
+{
+ if (check_pid(pid_arg) and kill_pid(pid_arg)) // If we kill it, reset
+ {
+ if (broken_pid_file() and pid_file().empty() == false)
+ {
+ unlink(pid_file().c_str());
+ }
+
+ if (broken_socket_cleanup() and has_socket() and not socket().empty())
+ {
+ unlink(socket().c_str());
+ }
+