summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-09-04 12:01:53 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-09-04 12:01:53 +0300
commit614b78470c5ed3c701abdd32bc65412f363a6fc2 (patch)
tree288d7967378bb980544c2ca74fd6bf04e4efd590
parent3ab3d03b8b603f210d878d352b56442eec14f6af (diff)
added restarter project (code wcreated to restart critical services on server without root access)
-rw-r--r--client/main.cpp11
-rw-r--r--client/mainwindow.cpp204
-rw-r--r--client/mainwindow.h55
-rw-r--r--client/mainwindow.ui100
-rw-r--r--client/resources.qrc7
-rw-r--r--client/restarter.pro29
-rw-r--r--empty0
-rw-r--r--server/main.cpp305
-rw-r--r--server/restarter_server.project106
-rw-r--r--server/restarter_server.workspace12
10 files changed, 829 insertions, 0 deletions
diff --git a/client/main.cpp b/client/main.cpp
new file mode 100644
index 0000000..9ae175b
--- /dev/null
+++ b/client/main.cpp
@@ -0,0 +1,11 @@
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.show();
+
+ return a.exec();
+}
diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp
new file mode 100644
index 0000000..c6aa5cc
--- /dev/null
+++ b/client/mainwindow.cpp
@@ -0,0 +1,204 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::MainWindow)
+{
+ ui->setupUi(this);
+#ifdef MINIMAL
+ ui->halt->hide();
+ ui->reboot->hide();
+ ui->reboot->hide();
+ ui->restart_cups->hide();
+ ui->restart_ppp->hide();
+ ui->state_lbl->hide();
+ this->setFixedSize(ui->restart_vbox_btn->geometry().width() +17, ui->restart_vbox_btn->geometry().height() +17);
+#else
+ this->setFixedSize(this->size());
+#endif
+ ui->state_lbl->setText(" ");
+}
+
+QSslSocket *MainWindow::get_socket()
+{
+ QSslSocket *s = new QSslSocket;
+ QFile in(":/res/ca.crt");
+ in.open(QIODevice::ReadOnly);
+ QByteArray buf = in.readAll();
+ in.close();
+ QList<QSslCertificate> ca_list;
+ ca_list.push_back(QSslCertificate(buf));
+ s->setCaCertificates(ca_list);
+ in.setFileName(":/res/client.crt");
+ in.open(QIODevice::ReadOnly);
+ buf = in.readAll();
+ in.close();
+ QSslCertificate c(buf);
+ s->setLocalCertificate(c);
+ in.setFileName(":/res/client.key");
+ in.open(QIODevice::ReadOnly);
+ buf = in.readAll();
+ QSslKey key(buf, QSsl::Rsa);
+ s->setPrivateKey(key);
+ s->setPeerVerifyMode(QSslSocket::VerifyPeer);
+ s->setProtocol(QSsl::SslV3);
+ connect(s, SIGNAL(peerVerifyError(QSslError)), this, SLOT(ssl_verify_error_handler(QSslError)));
+
+ return s;
+}
+
+void MainWindow::ssl_verify_error_handler(const QSslError error)
+{
+ switch(error.error())
+ {
+ case QSslError::InvalidCaCertificate: case QSslError::NoPeerCertificate: case QSslError::UnspecifiedError:
+ case QSslError::AuthorityIssuerSerialNumberMismatch:
+ ui->state_lbl->setText(QString::fromUtf8("Ошибка соединения !"));
+ sock->abort();
+ return;
+ default:
+ break;
+ }
+ sock->ignoreSslErrors();
+}
+
+MainWindow::~MainWindow()
+{
+ delete ui;
+}
+
+void MainWindow::enable_buttons(bool enable)
+{
+ ui->restart_vbox_btn->setEnabled(enable);
+ ui->reboot->setEnabled(enable);
+ ui->halt->setEnabled(enable);
+ ui->restart_cups->setEnabled(enable);
+ ui->restart_ppp->setEnabled(enable);
+ ui->restart_vbox_btn->setEnabled(enable);
+}
+
+
+void MainWindow::on_restart_vbox_btn_clicked()
+{
+ ui->state_lbl->setText(QString::fromUtf8("Подготовка.."));
+ sock = get_socket();
+ ui->state_lbl->setText(QString::fromUtf8("Соединение.."));
+ sock->connectToHostEncrypted(host, 1313);
+ connect(sock, SIGNAL(encrypted()), SLOT(restart_vbox_sock_connected()));
+ connect(sock, SIGNAL(disconnected()), SLOT(disconnected()));
+}
+
+void MainWindow::restart_vbox_sock_connected()
+{
+ ui->state_lbl->setText(QString::fromUtf8("Выполнение.."));
+ enable_buttons(false);
+ sock->write("restart vbox\0");
+}
+void MainWindow::reboot()
+{
+ ui->state_lbl->setText(QString::fromUtf8("Выполнение.."));
+ enable_buttons(false);
+ sock->write("reboot now\0");
+}
+
+void MainWindow::halt()
+{
+ ui->state_lbl->setText(QString::fromUtf8("Выполнение.."));
+ enable_buttons(false);
+ sock->write("halt now\0");
+}
+
+void MainWindow::restart_cups()
+{
+ ui->state_lbl->setText(QString::fromUtf8("Выполнение.."));
+ enable_buttons(false);
+ sock->write("restart cups\0");
+}
+
+void MainWindow::restart_ppp()
+{
+ ui->state_lbl->setText(QString::fromUtf8("Выполнение.."));
+ enable_buttons(false);
+ sock->write("restart ppp\0");
+}
+
+
+void MainWindow::disconnected()
+{
+ enable_buttons(true);
+ ui->state_lbl->setText(QString::fromUtf8(" "));
+ sock->deleteLater();
+}
+
+void MainWindow::on_reboot_clicked()
+{
+#ifndef MINIMAL
+ QMessageBox msg;
+ msg.setText(QString::fromUtf8("Вы видели куда ткнули ?"));
+ msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ if(msg.exec() == QMessageBox::Yes)
+ {
+ QMessageBox msg;
+ msg.setText(QString::fromUtf8("Уверены что хотите перезагрузить сервер ?"));
+ msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ if(msg.exec() == QMessageBox::Yes)
+ {
+ ui->state_lbl->setText(QString::fromUtf8("Подготовка.."));
+ sock = get_socket();
+ ui->state_lbl->setText(QString::fromUtf8("Соединение.."));
+ sock->connectToHostEncrypted(host, 1313);
+ connect(sock, SIGNAL(encrypted()), SLOT(reboot()));
+ connect(sock, SIGNAL(disconnected()), SLOT(disconnected()));
+ }
+ }
+#endif
+}
+
+void MainWindow::on_halt_clicked()
+{
+#ifndef MINIMAL
+ QMessageBox msg;
+ msg.setText(QString::fromUtf8("Вы видели куда ткнули ?"));
+ msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ if(msg.exec() == QMessageBox::Yes)
+ {
+ QMessageBox msg;
+ msg.setText(QString::fromUtf8("Уверены что хотите выключить сервер ?"));
+ msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ if(msg.exec() == QMessageBox::Yes)
+ {
+ ui->state_lbl->setText(QString::fromUtf8("Подготовка.."));
+ sock = get_socket();
+ ui->state_lbl->setText(QString::fromUtf8("Соединение.."));
+ sock->connectToHostEncrypted(host, 1313);
+ connect(sock, SIGNAL(encrypted()), SLOT(halt()));
+ connect(sock, SIGNAL(disconnected()), SLOT(disconnected()));
+ }
+ }
+#endif
+}
+
+void MainWindow::on_restart_cups_clicked()
+{
+#ifndef MINIMAL
+ ui->state_lbl->setText(QString::fromUtf8("Подготовка.."));
+ sock = get_socket();
+ ui->state_lbl->setText(QString::fromUtf8("Соединение.."));
+ sock->connectToHostEncrypted(host, 1313);
+ connect(sock, SIGNAL(encrypted()), SLOT(restart_cups()));
+ connect(sock, SIGNAL(disconnected()), SLOT(disconnected()));
+#endif
+}
+
+void MainWindow::on_restart_ppp_clicked()
+{
+#ifndef MINIMAL
+ ui->state_lbl->setText(QString::fromUtf8("Подготовка.."));
+ sock = get_socket();
+ ui->state_lbl->setText(QString::fromUtf8("Соединение.."));
+ sock->connectToHostEncrypted(host, 1313);
+ connect(sock, SIGNAL(encrypted()), SLOT(restart_ppp()));
+ connect(sock, SIGNAL(disconnected()), SLOT(disconnected()));
+#endif
+}
diff --git a/client/mainwindow.h b/client/mainwindow.h
new file mode 100644
index 0000000..dea9301
--- /dev/null
+++ b/client/mainwindow.h
@@ -0,0 +1,55 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QMessageBox>
+#include <QSslSocket>
+#include <QFile>
+#include <QSslKey>
+
+#ifdef MINIMAL
+const QString host = "192.168.0.1";
+#else
+const QString host = "gluzskaya.ru";
+#endif
+
+namespace Ui {
+ class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ explicit MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+protected slots:
+ void ssl_verify_error_handler(const QSslError);
+
+private slots:
+ void on_restart_vbox_btn_clicked();
+ void restart_vbox_sock_connected();
+ void reboot();
+ void halt();
+ void restart_cups();
+ void restart_ppp();
+ void disconnected();
+
+ void on_reboot_clicked();
+
+ void on_halt_clicked();
+
+ void on_restart_cups_clicked();
+
+ void on_restart_ppp_clicked();
+
+private:
+ void enable_buttons(bool);
+ QSslSocket *get_socket();
+ Ui::MainWindow *ui;
+ QSslSocket *sock;
+};
+
+#endif // MAINWINDOW_H
diff --git a/client/mainwindow.ui b/client/mainwindow.ui
new file mode 100644
index 0000000..5894198
--- /dev/null
+++ b/client/mainwindow.ui
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>685</width>
+ <height>389</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Окно</string>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <widget class="QPushButton" name="restart_vbox_btn">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>181</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Перезапустить vm (1c)</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="reboot">
+ <property name="geometry">
+ <rect>
+ <x>520</x>
+ <y>320</y>
+ <width>161</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Перезагрузить сервер</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="halt">
+ <property name="geometry">
+ <rect>
+ <x>520</x>
+ <y>350</y>
+ <width>161</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Выключить серверер</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="restart_cups">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>231</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Перезапустить сервер печати</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="restart_ppp">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>70</y>
+ <width>191</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Перезапустить интернет</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="state_lbl">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>370</y>
+ <width>491</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/client/resources.qrc b/client/resources.qrc
new file mode 100644
index 0000000..34e2d9e
--- /dev/null
+++ b/client/resources.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>res/ca.crt</file>
+ <file>res/client.key</file>
+ <file>res/client.crt</file>
+ </qresource>
+</RCC>
diff --git a/client/restarter.pro b/client/restarter.pro
new file mode 100644
index 0000000..31052b5
--- /dev/null
+++ b/client/restarter.pro
@@ -0,0 +1,29 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2011-12-15T07:02:21
+#
+#-------------------------------------------------
+
+QT += core gui network
+
+TARGET = restarter
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+ mainwindow.cpp
+
+HEADERS += mainwindow.h
+
+FORMS += mainwindow.ui
+
+#DEFINES += MINIMAL
+
+QMAKE_CXXFLAGS += -Os -fomit-frame-pointer -std=gnu++0x
+QMAKE_CFLAGS += -Os -fomit-frame-pointer -std=gnu99
+
+LIBS += -Wl,-O1
+
+RESOURCES += \
+ resources.qrc
+
diff --git a/empty b/empty
deleted file mode 100644
index e69de29..0000000
--- a/empty
+++ /dev/null
diff --git a/server/main.cpp b/server/main.cpp
new file mode 100644
index 0000000..240ee22
--- /dev/null
+++ b/server/main.cpp
@@ -0,0 +1,305 @@
+//
+// async_tcp_echo_server.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+
+#include <signal.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include <iostream>
+#include <fstream>
+#include <boost/bind.hpp>
+#include <boost/asio.hpp>
+#include <boost/asio/ssl.hpp>
+
+using boost::asio::ip::tcp;
+typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> ssl_socket;
+
+class session
+{
+public:
+ session(boost::asio::io_service& io_service,
+ boost::asio::ssl::context& context)
+ : socket_(io_service, context) {
+ }
+
+ ssl_socket::lowest_layer_type& socket()
+ {
+ return socket_.lowest_layer();
+ }
+
+ void handle_handshake(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ socket_.async_read_some(boost::asio::buffer(data_, max_length),
+ boost::bind(&session::handle_read, this,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred));
+ }
+ else
+ {
+ delete this;
+ }
+ }
+
+ void start()
+ {
+ socket_.async_handshake(boost::asio::ssl::stream_base::server,
+ boost::bind(&session::handle_handshake, this,
+ boost::asio::placeholders::error));
+ }
+
+private:
+ void handle_read(const boost::system::error_code& error,
+ size_t bytes_transferred)
+ {
+ if (!error)
+ {
+// std::cout<<"recieved: "<<data_<<"\n";
+ if(strstr(data_, "restart vbox"))
+ {
+ FILE *f = popen("/sbin/runscript /etc/init.d/vbox_headles restart --nodeps","r");
+ if(f != NULL)
+ {
+ char buf[128];
+ while(fgets(buf, 128, f) != NULL)
+ ; //TODO: do something with output
+ int s = pclose(f); // TODO: handle exit status
+ }
+ else
+ ; //TODO: handle fail
+ }
+ else if(strstr(data_, "reboot now"))
+ {
+ FILE *f = popen("reboot","r");
+ if(f != NULL)
+ {
+ char buf[128];
+ while(fgets(buf, 128, f) != NULL)
+ ; //TODO: do something with output
+ int s = pclose(f); // TODO: handle exit status
+ }
+ else
+ ; //TODO: handle fail
+ }
+ else if(strstr(data_, "halt now"))
+ {
+ FILE *f = popen("halt","r");
+ if(f != NULL)
+ {
+ char buf[128];
+ while(fgets(buf, 128, f) != NULL)
+ ; //TODO: do something with output
+ int s = pclose(f); // TODO: handle exit status
+ }
+ else
+ ; //TODO: handle fail
+ }
+ else if(strstr(data_, "restart cups"))
+ {
+ FILE *f = popen("/sbin/runscript /etc/init.d/cupsd restart --nodeps","r");
+ if(f != NULL)
+ {
+ char buf[128];
+ while(fgets(buf, 128, f) != NULL)
+ ; //TODO: do something with output
+ int s = pclose(f); // TODO: handle exit status
+ }
+ else
+ ; //TODO: handle fail
+ }
+ else if(strstr(data_, "restart ppp"))
+ {
+ FILE *f = popen("/sbin/runscript /etc/init.d/net.ppp0 stop --nodeps","r");
+ char buf[128];
+ int s = 0;
+ if(f != NULL)
+ {
+ while(fgets(buf, 128, f) != NULL)
+ ; //TODO: do something with output
+ s = pclose(f); // TODO: handle exit status
+ }
+ else
+ ; //TODO: handle fail
+ sleep(3);
+ f = popen("killall pppd","r");
+ if(f == NULL)
+ {
+ while(fgets(buf, 128, f) != NULL)
+ ; //TODO: do something with output
+ s = pclose(f); // TODO: handle exit status
+ }
+ else
+ ; //TODO: handle fail
+ sleep(1);
+ f = popen("/sbin/runscript /etc/init.d/net.ppp0 start --nodeps","r");
+ if(f == NULL)
+ {
+ while(fgets(buf, 128, f) != NULL)
+ ; //TODO: do something with output
+ s = pclose(f); // TODO: handle exit status
+ }
+ else
+ ; //TODO: handle fail
+ }
+/* boost::asio::async_write(socket_,
+ boost::asio::buffer(data_, bytes_transferred),
+ boost::bind(&session::handle_write, this,
+ boost::asio::placeholders::error)); */
+ }
+ delete this;
+ }
+
+/* void handle_write(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ socket_.async_read_some(boost::asio::buffer(data_, max_length),
+ boost::bind(&session::handle_read, this,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred));
+ }
+ else
+ {
+ delete this;
+ }
+ }*/
+
+ ssl_socket socket_;
+ enum { max_length = 32 };
+ char data_[max_length];
+};
+
+class server
+{
+public:
+/* server(boost::asio::io_service& io_service, short port)
+ : io_service_(io_service),
+ acceptor_(io_service, tcp::endpoint(boost::asio::ip::address_v4::from_string("192.168.0.1"), port)),
+ context_(boost::asio::ssl::context::sslv23) */
+ server(boost::asio::io_service& io_service, short port)
+ : io_service_(io_service),
+ acceptor_(io_service, tcp::endpoint(boost::asio::ip::address_v4(), port)),
+ context_(boost::asio::ssl::context::sslv23)
+ {
+ context_.set_options(
+ boost::asio::ssl::context::default_workarounds
+ | boost::asio::ssl::context::no_sslv2);
+ context_.set_password_callback(boost::bind(&server::get_password, this));
+ context_.use_certificate_chain_file("/etc/restarter_server/serv.crt");
+ context_.use_rsa_private_key_file("/etc/restarter_server/serv.key", boost::asio::ssl::context::pem);
+ context_.load_verify_file("/etc/restarter_server/ca.crt");
+ context_.set_verify_mode(boost::asio::ssl::verify_peer | boost::asio::ssl::verify_client_once);
+ start_accept();
+ }
+
+private:
+ void start_accept()
+ {
+ session* new_session = new session(io_service_, context_);
+ acceptor_.async_accept(new_session->socket(),
+ boost::bind(&server::handle_accept, this, new_session,
+ boost::asio::placeholders::error));
+ }
+ std::string get_password() const
+ {
+ return "";
+ }
+
+ void handle_accept(session* new_session,
+ const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ new_session->start();
+ }
+ else
+ {
+ delete new_session;
+ }
+
+ start_accept();
+ }
+
+ boost::asio::io_service& io_service_;
+ boost::asio::ip::tcp::acceptor acceptor_;
+ boost::asio::ssl::context context_;
+};
+
+extern "C" void handle_term(int i)
+{
+ remove("/var/run/restarter_server.pid");
+ exit(1);
+}
+
+int main(int argc, char* argv[])
+{
+ if(geteuid())
+ {
+ std::cout<<"Program must be runned with root privilegies\n";
+ exit(EXIT_FAILURE);
+ }
+ {
+ std::ifstream in_pid;
+ in_pid.open("/var/run/restarter_server.pid");
+ if(in_pid.is_open() && in_pid.good())
+ {
+ char szpid[16];
+ in_pid.read(szpid, 16);
+ if(!strcmp(szpid, "0"))
+ remove("/var/run/restarter_server.pid");
+ else
+ {
+ std::string cmd = "kill ";
+ for(int i = 0; i < 16 && szpid[i] != '\n' && szpid[i] != '\0'; i++)
+ cmd.push_back(szpid[i]);
+ system(cmd.c_str());
+ remove("/var/run/restarter_server.pid");
+ }
+ }
+ }
+ pid_t pid;
+ pid = fork();
+ if(pid < 0)
+ {
+ std::cerr<<"Failed to fork\n";
+ exit(EXIT_FAILURE);
+ }
+ if(pid > 0)
+ {
+ std::cerr<<"Successfuly forked\n";
+ std::ofstream out;
+ out.open("/var/run/restarter_server.pid");
+ char szpid[16];
+ snprintf(szpid, 15, "%d", pid);
+ out<<pid<<"\n";
+ out.close();
+ exit(EXIT_SUCCESS);
+ }
+ signal (SIGTERM, handle_term);
+
+ try
+ {
+
+ boost::asio::io_service io_service;
+
+ server s(io_service, 1313);
+
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+} \ No newline at end of file
diff --git a/server/restarter_server.project b/server/restarter_server.project
new file mode 100644
index 0000000..f48e175
--- /dev/null
+++ b/server/restarter_server.project
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<CodeLite_Project Name="restarter_server" InternalType="Console">
+ <Plugins>
+ <Plugin Name="qmake">
+ <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]>
+ </Plugin>
+ </Plugins>
+ <Description/>
+ <Dependencies/>
+ <VirtualDirectory Name="src">
+ <File Name="main.cpp"/>
+ </VirtualDirectory>
+ <Settings Type="Executable">
+ <GlobalSettings>
+ <Compiler Options="" C_Options="">
+ <IncludePath Value="."/>
+ </Compiler>
+ <Linker Options="">
+ <LibraryPath Value="."/>
+ </Linker>
+ <ResourceCompiler Options=""/>
+ </GlobalSettings>
+ <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+ <Compiler Options="-g" C_Options="-g" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+ <IncludePath Value="."/>
+ </Compiler>
+ <Linker Options="" Required="yes">
+ <Library Value="boost_system"/>
+ <Library Value="pthread"/>
+ <Library Value="ssl"/>
+ <Library Value="crypto"/>
+ </Linker>
+ <ResourceCompiler Options="" Required="no"/>
+ <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+ <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+ <![CDATA[]]>
+ </Environment>
+ <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+ <PostConnectCommands/>
+ <StartupCommands/>
+ </Debugger>
+ <PreBuild/>
+ <PostBuild/>
+ <CustomBuild Enabled="no">
+ <RebuildCommand/>
+ <CleanCommand/>
+ <BuildCommand/>
+ <PreprocessFileCommand/>
+ <SingleFileCommand/>
+ <MakefileGenerationCommand/>
+ <ThirdPartyToolName>None</ThirdPartyToolName>
+ <WorkingDirectory/>
+ </CustomBuild>
+ <AdditionalRules>
+ <CustomPostBuild/>
+ <CustomPreBuild/>
+ </AdditionalRules>
+ <Completion>
+ <ClangCmpFlags/>
+ <ClangPP/>
+ <SearchPaths/>
+ </Completion>
+ </Configuration>
+ <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
+ <Compiler Options="" C_Options="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
+ <IncludePath Value="."/>
+ </Compiler>
+ <Linker Options="-O2" Required="yes">
+ <Library Value="boost_system"/>
+ <Library Value="pthread"/>
+ <Library Value="ssl"/>
+ <Library Value="crypto"/>
+ </Linker>
+ <ResourceCompiler Options="" Required="no"/>
+ <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+ <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
+ <![CDATA[]]>
+ </Environment>
+ <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
+ <PostConnectCommands/>
+ <StartupCommands/>
+ </Debugger>
+ <PreBuild/>
+ <PostBuild/>
+ <CustomBuild Enabled="no">
+ <RebuildCommand/>
+ <CleanCommand/>
+ <BuildCommand/>
+ <PreprocessFileCommand/>
+ <SingleFileCommand/>
+ <MakefileGenerationCommand/>
+ <ThirdPartyToolName>None</ThirdPartyToolName>
+ <WorkingDirectory/>
+ </CustomBuild>
+ <AdditionalRules>
+ <CustomPostBuild/>
+ <CustomPreBuild/>
+ </AdditionalRules>
+ <Completion>
+ <ClangCmpFlags/>
+ <ClangPP/>
+ <SearchPaths/>
+ </Completion>
+ </Configuration>
+ </Settings>
+</CodeLite_Project>
diff --git a/server/restarter_server.workspace b/server/restarter_server.workspace
new file mode 100644
index 0000000..9ce2648
--- /dev/null
+++ b/server/restarter_server.workspace
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<CodeLite_Workspace Name="restarter_server" Database="./restarter_server.tags">
+ <Project Name="restarter_server" Path="restarter_server.project" Active="Yes"/>
+ <BuildMatrix>
+ <WorkspaceConfiguration Name="Debug" Selected="no">
+ <Project Name="restarter_server" ConfigName="Debug"/>
+ </WorkspaceConfiguration>
+ <WorkspaceConfiguration Name="Release" Selected="yes">
+ <Project Name="restarter_server" ConfigName="Release"/>
+ </WorkspaceConfiguration>
+ </BuildMatrix>
+</CodeLite_Workspace>