daemonization: make sure the firewall subproc sends to syslog too.

This commit is contained in:
Avery Pennarun
2011-01-01 00:06:04 -08:00
parent 8a5ae1a40a
commit 5bf6e40682
4 changed files with 33 additions and 24 deletions

16
ssyslog.py Normal file
View File

@ -0,0 +1,16 @@
import sys, os
from compat import ssubprocess
_p = None
def start_syslog():
global _p
_p = ssubprocess.Popen(['logger',
'-p', 'daemon.info',
'-t', 'sshuttle'], stdin=ssubprocess.PIPE)
def stderr_to_syslog():
sys.stdout.flush()
sys.stderr.flush()
os.dup2(_p.stdin.fileno(), 2)