diff options
author | Dirk Opfer <dirk@do13.de> | 2009-08-12 10:06:44 +0200 |
---|---|---|
committer | Dirk Opfer <dirk@do13.de> | 2009-08-12 10:41:53 +0200 |
commit | 110422e26fb5f1e56b22e1ea00e393a187114793 (patch) | |
tree | 7a2e177539ff2bb7b301be892ac35b0da7d9133e /recipes/linknx/files | |
parent | b5b13fcd2a5a7fb213e544971db9f5f59d6f3474 (diff) |
linknx: Fix crash on startup
- restructure recipe and add .inc
- Add patch to fix a crash on startup during static initialization of a map
- Add startup script
- Enable curl and smtp
- Add recipe for cvs version
Diffstat (limited to 'recipes/linknx/files')
-rwxr-xr-x | recipes/linknx/files/linknx.start | 57 | ||||
-rw-r--r-- | recipes/linknx/files/logger-initialisations.patch | 59 |
2 files changed, 116 insertions, 0 deletions
diff --git a/recipes/linknx/files/linknx.start b/recipes/linknx/files/linknx.start new file mode 100755 index 0000000000..444d6c05c3 --- /dev/null +++ b/recipes/linknx/files/linknx.start @@ -0,0 +1,57 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/bin + +DAEMON="linknx" + +test -f /usr/bin/${DAEMON} || exit 0 + +if test -f /etc/default/${DAEMON} ; then +. /etc/default/${DAEMON} +else +: +fi + +if [ "$START_LINKNX" != "yes" ] +then + exit 0 +fi + +startdaemon(){ + echo -n "Starting ${DAEMON}: " + start-stop-daemon --start -x /usr/bin/${DAEMON} -- ${CMDLINE} -d -p/var/run/${DAEMON}.pid + echo "done" +} + +stopdaemon(){ + echo -n "Stopping ${DAEMON}: " + start-stop-daemon --stop -p /var/run/${DAEMON}.pid + echo "done" +} + +case "$1" in + start) + startdaemon + ;; + stop) + stopdaemon + ;; + force-reload) + stopdaemon + startdaemon + ;; + restart) + stopdaemon + startdaemon + ;; + reload) + stopdaemon + startdaemon + ;; + *) + echo "Usage: ${DAEMON} { start | stop | restart | reload }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/recipes/linknx/files/logger-initialisations.patch b/recipes/linknx/files/logger-initialisations.patch new file mode 100644 index 0000000000..857014ea79 --- /dev/null +++ b/recipes/linknx/files/logger-initialisations.patch @@ -0,0 +1,59 @@ +Index: linknx/src/logger.h +=================================================================== +RCS file: /cvsroot/linknx/linknx/linknx/src/logger.h,v +retrieving revision 1.5 +diff -u -r1.5 logger.h +--- linknx/src/logger.h 8 Mar 2009 22:34:23 -0000 1.5 ++++ linknx/src/logger.h 17 May 2009 22:29:02 -0000 +@@ -132,7 +132,7 @@ + std::string cat_m; + typedef std::pair<std::string ,Logger*> LoggerPair_t; + typedef std::map<std::string ,Logger*> LoggerMap_t; +- static LoggerMap_t loggerMap_m; ++ static LoggerMap_t* getLoggerMap(); + static int level_m; // 10=DEBUG, 20=INFO, 30=NOTICE, 40=WARN, 50=ERROR, + static bool timestamp_m; + static std::ostream nullStream_m; +Index: linknx/src/logger.cpp +=================================================================== +RCS file: /cvsroot/linknx/linknx/linknx/src/logger.cpp,v +retrieving revision 1.6 +diff -u -r1.6 logger.cpp +--- linknx/src/logger.cpp 12 Mar 2009 21:56:55 -0000 1.6 ++++ linknx/src/logger.cpp 17 May 2009 22:29:02 -0000 +@@ -118,7 +118,7 @@ + + #include <ctime> + +-Logger::LoggerMap_t Logger::loggerMap_m; ++//Logger::LoggerMap_t Logger::loggerMap_m; + int Logger::level_m; + bool Logger::timestamp_m; + NullStreamBuf Logger::nullStreamBuf_m; +@@ -157,14 +157,23 @@ + pConfig->SetAttribute("level", level_m); + } + ++Logger::LoggerMap_t* Logger::getLoggerMap() { ++ // This static local is used to avoid problems with ++ // initialization order of static object present in ++ // different compilation units ++ static LoggerMap_t* loggerMap = new LoggerMap_t(); ++ return loggerMap; ++} ++ + Logger& Logger::getInstance(const char* cat) { +- LoggerMap_t::iterator it = loggerMap_m.find(cat); ++ LoggerMap_t* map = getLoggerMap(); ++ LoggerMap_t::iterator it = map->find(cat); + Logger* logger; +- if (it != loggerMap_m.end()) ++ if (it != map->end()) + logger = it->second; + else { + logger = new Logger(cat); +- loggerMap_m.insert(LoggerPair_t(cat, logger)); ++ map->insert(LoggerPair_t(cat, logger)); + } + return *(logger); + } |