+ if (not set_log_file())
+ {
+ return false;
+ }
+
+ arg_buffer << " " << log_file_option() << _log_file;
+ }
+
+ if (getenv("LIBTEST_SYSLOG") and has_syslog())
+ {
+ arg_buffer << " --syslog";
+ }
+
+ // Update pid_file
+ if (pid_file_option())
+ {
+ if (_pid_file.empty() and set_pid_file() == false)
+ {
+ return false;
+ }
+
+ arg_buffer << " " << pid_file_option() << pid_file();
+ }
+
+ assert(daemon_file_option());
+ if (daemon_file_option() and not is_valgrind() and not is_helgrind())
+ {
+ arg_buffer << " " << daemon_file_option();
+ }
+
+ if (_is_socket and socket_file_option())
+ {
+ if (not set_socket_file())
+ {
+ return false;
+ }
+
+ arg_buffer << " " << socket_file_option() << "\"" << _socket << "\"";
+ }
+
+ assert(port_option());
+ if (port_option() and _port > 0)
+ {
+ arg_buffer << " " << port_option() << _port;
+ }
+
+ options+= arg_buffer.str();
+
+ if (not _extra_args.empty())
+ {
+ options+= _extra_args;
+ }
+
+ 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());
+ }
+