Back to index

nordugrid-arc-nox  1.1.0~rc6
daemon.h
Go to the documentation of this file.
00001 #ifndef __GM_DAEMON_H__
00002 #define __GM_DAEMON_H__
00003 
00004 #include <string>
00005 #include <arc/Logger.h>
00006 
00007 #define DAEMON_OPTS "ZzFL:U:P:d:"
00008 
00009 class Daemon {
00010  private:
00011   std::string logfile_;
00012   int logsize_;
00013   int lognum_;
00014   uid_t uid_;
00015   gid_t gid_;
00016   bool daemon_;
00017   std::string pidfile_;
00018   int debug_;
00019   Arc::Logger& logger_;
00020   std::string key_path_;
00021   std::string cert_path_;
00022   std::string cadir_path_;
00023  public:
00024   Daemon(void);
00025   ~Daemon(void);
00026   int arg(char c);
00027   int config(const std::string& cmd,std::string& rest);
00028   static int skip_config(const std::string& cmd);
00029   int getopt(int argc, char * const argv[],const char *optstring);
00030   int daemon(bool close_fds = false);
00031   const char* short_help(void);
00032   void logfile(const char* path);
00033   void pidfile(const char* path);
00034   const std::string& keypath(void) { return key_path_; };
00035   const std::string& certpath(void) { return cert_path_; };
00036   const std::string& cadirpath(void) { return cadir_path_; };
00037 };
00038 
00039 #endif // __GM_DAEMON_H__