diff --git a/doc/api.qdoc b/doc/api.qdoc index ea5d02b2..d1b2cfdb 100644 --- a/doc/api.qdoc +++ b/doc/api.qdoc @@ -5,15 +5,12 @@ The guh server provides two different API's: \list \li \l{JSON-RPC API}{JSON-RPC} - \li \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST} + \li \l{https://github.com/guh/guh/wiki/REST-API}{REST} \endlist - The \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST API} is accessable on the \l{guhserver::WebServer}{WebServer}. The JSON-RPC API can be accessed from the \l {guhserver::TcpServer}{TcpServer} and the \l {guhserver::WebSocketServer}{WebSocketServer} interface. The command line interface \b {\tt guh-cli} communicates with the \l {guhserver::TcpServer}{TcpServer} and \l {JSON-RPC API}. The \b {\tt guh-webinterface} uses the \l{guhserver::WebServer}{WebServer} with the \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST-API} and catches notifications from the \l {guhserver::WebSocketServer}{WebSocketServer}. \image api-overview.png - - */ diff --git a/server/guhservice.cpp b/server/guhservice.cpp index c8ba18bb..d0396c26 100644 --- a/server/guhservice.cpp +++ b/server/guhservice.cpp @@ -31,10 +31,16 @@ \sa QtService */ -#include +#include "unistd.h" +#include "stdio.h" + +#include + #include "guhservice.h" +#include "guhsettings.h" #include "loggingcategories.h" + namespace guhserver { /*! Constructs the forked guhd application with the given argument count \a argc and argument vector \a argv. */ @@ -59,6 +65,11 @@ GuhService::~GuhService() /*! Starts the forked guhd application. */ void GuhService::start() { + // check if config directory for logfile exists + if (!QDir().mkpath(GuhSettings::settingsPath())) { + fprintf(stdout, "Could not create guh settings directory %s", qPrintable(GuhSettings::settingsPath())); + exit(EXIT_FAILURE); + } qCDebug(dcApplication) << "====================================="; qCDebug(dcApplication) << "guhd" << GUH_VERSION_STRING << "started as daemon."; qCDebug(dcApplication) << "====================================="; diff --git a/server/main.cpp b/server/main.cpp index 45870c28..519ffd87 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -191,7 +191,6 @@ int main(int argc, char *argv[]) fprintf(stdout, "Could not create guh settings directory %s", qPrintable(GuhSettings::settingsPath())); exit(EXIT_FAILURE); } - qCDebug(dcApplication) << "====================================="; qCDebug(dcApplication) << "guhd" << GUH_VERSION_STRING << "started with user ID" << userId; qCDebug(dcApplication) << "=====================================";