From dc6abe86d2730b16cb155a02b3ec9d79fcaa72f7 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 5 Jul 2010 09:49:42 +0000 Subject: Make server write its pid file. Daemon class ported from pentominos. --- server/src/daemon.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server/src/daemon.h') diff --git a/server/src/daemon.h b/server/src/daemon.h index 89c3f1c..ef6eecc 100644 --- a/server/src/daemon.h +++ b/server/src/daemon.h @@ -3,7 +3,7 @@ * daemon.h * * Thu Jun 9 10:27:59 CEST 2005 - * Copyright 2005 Bent Bisballe + * Copyright 2005 Bent Bisballe Nyeng * deva@aasimon.org ****************************************************************************/ @@ -28,6 +28,8 @@ #include +#include + class Daemon { public: Daemon(); @@ -36,10 +38,12 @@ public: /** * Use NOBODY_GROUP and NOBODY_USER if no privileges are needed to run. */ - int run(const char* user, const char* group, bool detach = true); + int run(const char* user, const char* group, bool detach = true, + std::string pidfile = ""); private: virtual int daemon_main() = 0; + }; #endif/*__DAEMON_H__*/ -- cgit v1.2.3