quit hijacking stderr for the python process id, just write it straight to the file
This commit is contained in:
parent
506bc1ad6e
commit
982e165d0e
|
@ -76,7 +76,9 @@ class Handlers(object):
|
|||
|
||||
|
||||
def main():
|
||||
print >> sys.stderr, "%d\n" % os.getpid()
|
||||
fp = open(sys.argv[1], 'a')
|
||||
fp.write("%d\n" % os.getpid())
|
||||
fp.close()
|
||||
h = Handlers()
|
||||
notifier_init()
|
||||
try:
|
||||
|
|
4
start.sh
4
start.sh
|
@ -3,11 +3,11 @@
|
|||
DIR=$HOME/.mcabber
|
||||
|
||||
pidtail() {
|
||||
tail -F $1 &
|
||||
tail -F $1 2>/dev/null &
|
||||
echo $! 1>&2
|
||||
}
|
||||
|
||||
echo -n > $DIR/notify_pids
|
||||
echo -n > $DIR/last_event
|
||||
(pidtail $DIR/last_event 2>> $DIR/notify_pids | python $DIR/mcabbernotify.py 2>> $DIR/notify_pids) &
|
||||
(pidtail $DIR/last_event 2>> $DIR/notify_pids | python $DIR/mcabbernotify.py $DIR/notify_pids) &
|
||||
echo $! >> $DIR/notify_pids
|
||||
|
|
Loading…
Reference in New Issue