diff options
author | irregulator <irregulator@riseup.net> | 2014-05-23 17:28:32 +0300 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-07-01 16:05:41 -0700 |
commit | 7a54923591125894440b9ff7020e4b413a1c6fb5 (patch) | |
tree | b54089264bdd00ad8ea333a60ffea2e3eccc1f71 /puppet/modules/obfsproxy/files | |
parent | 2f318f0be937f0bace467640f4011ba422a736b7 (diff) |
Address logging for obfsproxy daemon
Create obfsproxy directory in /var/log, specify log file when
obfsproxy is spawned by init script, create a logrotate
configuration for obfsproxy's logs.
Diffstat (limited to 'puppet/modules/obfsproxy/files')
-rwxr-xr-x | puppet/modules/obfsproxy/files/obfsproxy_init | 5 | ||||
-rw-r--r-- | puppet/modules/obfsproxy/files/obfsproxy_logrotate | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/puppet/modules/obfsproxy/files/obfsproxy_init b/puppet/modules/obfsproxy/files/obfsproxy_init index 5223ec9d..7a7e7609 100755 --- a/puppet/modules/obfsproxy/files/obfsproxy_init +++ b/puppet/modules/obfsproxy/files/obfsproxy_init @@ -19,6 +19,7 @@ USER=obfsproxy DATDIR=/etc/obfsproxy PIDFILE=/var/run/obfsproxy.pid CONF=$DATDIR/obfsproxy.conf +LOGFILE=/var/log/obfsproxy/log # If the daemon is not there, then exit. test -x $DAEMON || exit 0 @@ -30,8 +31,8 @@ else exit 2 fi -DAEMONARGS=" --log-min-severity=$LOG --data-dir=$DATDIR $TRANSPORT \ - $PARAM --dest=$DEST_IP:$DEST_PORT server 0.0.0.0:$PORT" +DAEMONARGS=" --log-min-severity=$LOG --log-file=$LOGFILE --data-dir=$DATDIR \ + $TRANSPORT $PARAM --dest=$DEST_IP:$DEST_PORT server 0.0.0.0:$PORT" start_obfsproxy() { start-stop-daemon --start --quiet --oknodo -m --pidfile $PIDFILE \ diff --git a/puppet/modules/obfsproxy/files/obfsproxy_logrotate b/puppet/modules/obfsproxy/files/obfsproxy_logrotate new file mode 100644 index 00000000..623bbab1 --- /dev/null +++ b/puppet/modules/obfsproxy/files/obfsproxy_logrotate @@ -0,0 +1,14 @@ +/var/log/obfsproxy/log { + weekly + missingok + rotate 10 + compress + delaycompress + notifempty + create 600 obfsproxy obfsproxy + postrotate + if [ -f /var/run/obfsproxy.pid ]; then + /etc/init.d/obfsproxy restart > /dev/null + fi + endscript +} |