Permalink
Browse files

Daemon化できました……. _(:3 」∠)_

  • Loading branch information...
1 parent 410c2b9 commit 2b8db2fa316eb9ba7599eb34938ff049237c6271 @non117 committed Feb 13, 2012
Showing with 6 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +0 −1 README
  3. +4 −2 src/boxnya.py
  4. +1 −1 src/settings.py.example
View
1 .gitignore
@@ -3,5 +3,6 @@
.settings/*
.DS_Store
settings.py
+boxnya.pid
*.pyc
log/
View
1 README
@@ -2,7 +2,6 @@ settings.pyに設定を書きます.
DAEMON = Trueなら,
$ python boxnya.py start|stop|restar
で起動終了などが制御できます. boxnyaはデーモンプロセスとなります.
-※ 現在調整中. 使えません.
boxnyaは全ての入力, 出力がプラグイン方式で実現されています.
src/lib/input,filter,outputにプラグインは格納されます.
View
6 src/boxnya.py
@@ -74,10 +74,12 @@ def twitterinitializer():
class Daemon(object):
def __init__(self):
+ global settings
+ log = settings["LOG_SETTINGS"]["LOG_DIR"] + "/system.log"
self.pidfile = os.path.join(os.path.dirname(os.path.abspath(__file__)), "boxnya.pid")
self.stdin = '/dev/null'
- self.stdout = 'dev/null'
- self.stderr = 'dev/null'
+ self.stdout = log
+ self.stderr = log
def daemonize(self):
try:
pid = os.fork()
View
2 src/settings.py.example
@@ -2,7 +2,7 @@
import os
# 基本設定
-DAEMON = False #今は使えません
+DAEMON = False
LOGGING = True
LOG_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),"log")
LOG_OUT = []

0 comments on commit 2b8db2f

Please sign in to comment.