浏览代码

Make sure the logfile exists and has the correct permissions.

svn:r9941
Andrew Lewman 17 年之前
父节点
当前提交
197745f285
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      contrib/osx/TorPostflight

+ 7 - 3
contrib/osx/TorPostflight

@@ -30,9 +30,13 @@ fi
 chown $TORUSER $TORDIR
 chgrp daemon $TORDIR
 chmod 700 $TORDIR
-chown $TORUSER $LOGFILE
-chgrp daemon $LOGFILE
-chmod 660 $LOGFILE
+
+if [ ! -f $LOGFILE ]; then
+    touch $LOGFILE
+    chown $TORUSER $LOGFILE
+    chgrp daemon $LOGFILE
+    chmod 660 $LOGFILE
+fi
 
 # Create the configuration file only if there wasn't one already.
 if [ ! -f $TARGET/torrc ]; then