[Pkg-voip-commits] [resiprocate] 05/06: Change from syslog to dedicated logging

Daniel Pocock pocock at moszumanska.debian.org
Mon Jan 27 21:56:26 UTC 2014


This is an automated email from the git hooks/post-receive script.

pocock pushed a commit to annotated tag debian/1.9.0_rc2-1
in repository resiprocate.

commit 2e871c280ff8c95e49e47ec193666d403992db61
Author: Daniel Pocock <daniel at pocock.com.au>
Date:   Mon Jan 27 20:38:04 2014 +0100

    Change from syslog to dedicated logging
---
 debian/conf/reTurnServer.config          | 6 +++---
 debian/conf/repro.config                 | 4 ++--
 debian/repro.dirs                        | 1 +
 debian/repro.init                        | 6 ++++++
 debian/repro.logrotate                   | 9 +++++++++
 debian/repro.postinst                    | 3 +++
 debian/repro.postrm                      | 5 +++++
 debian/resiprocate-turn-server.dirs      | 1 +
 debian/resiprocate-turn-server.init      | 6 ++++++
 debian/resiprocate-turn-server.logrotate | 9 +++++++++
 debian/resiprocate-turn-server.postinst  | 3 +++
 debian/resiprocate-turn-server.postrm    | 5 +++++
 12 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/debian/conf/reTurnServer.config b/debian/conf/reTurnServer.config
index 2f495f3..e907d77 100644
--- a/debian/conf/reTurnServer.config
+++ b/debian/conf/reTurnServer.config
@@ -77,16 +77,16 @@ AltStunPort = 0
 ########################################################
 
 # Logging Type: syslog|cerr|cout|file
-LoggingType = syslog
+LoggingType = file
 
 # Logging level: NONE|CRIT|ERR|WARNING|INFO|DEBUG|STACK
 LoggingLevel = WARNING
 
 # Log Filename
-LogFilename = reTurnServer.log
+LogFilename = /var/log/reTurnServer/reTurnServer.log
 
 # Log file Max Size
-LogFileMaxLines = 50000
+LogFileMaxLines = 0
 
 
 ########################################################
diff --git a/debian/conf/repro.config b/debian/conf/repro.config
index 571cb42..1780928 100644
--- a/debian/conf/repro.config
+++ b/debian/conf/repro.config
@@ -11,13 +11,13 @@
 # Note:  Logging to cout can negatively effect performance.
 #        When repro is placed into production 'file' or 
 #        'syslog' should be used.
-LoggingType = syslog
+LoggingType = file
 
 # Logging level: NONE|CRIT|ERR|WARNING|INFO|DEBUG|STACK
 LogLevel = WARNING
 
 # Log Filename
-LogFilename = repro.log
+LogFilename = /var/log/repro/repro.log
 
 # Log file Max Bytes
 LogFileMaxBytes = 0
diff --git a/debian/repro.dirs b/debian/repro.dirs
index c6a54b3..f4bbec0 100644
--- a/debian/repro.dirs
+++ b/debian/repro.dirs
@@ -1,3 +1,4 @@
 etc/repro/ssl
 usr/share/doc/repro/examples/pyroute
 var/lib/repro
+var/log/repro
diff --git a/debian/repro.init b/debian/repro.init
index 276c08f..d461bc5 100644
--- a/debian/repro.init
+++ b/debian/repro.init
@@ -18,6 +18,7 @@ USER=repro
 GROUP=repro
 PIDFILE="/var/run/$BIN/$NAME.pid"
 PIDFILE_DIR=`dirname $PIDFILE`
+LOG_DIR=/var/log/repro
 
 KILL_SPEC=TERM/20/KILL/5
 
@@ -38,6 +39,11 @@ if [ ! -d "$PIDFILE_DIR" ];then
     chown $USER:$GROUP "$PIDFILE_DIR"
 fi
 
+if [ ! -d "$LOG_DIR" ];then
+        mkdir -p "$LOG_DIR"
+    chown $USER:$GROUP "$LOG_DIR"
+fi
+
 set -e
 
 case "$1" in
diff --git a/debian/repro.logrotate b/debian/repro.logrotate
new file mode 100644
index 0000000..ed99d96
--- /dev/null
+++ b/debian/repro.logrotate
@@ -0,0 +1,9 @@
+/var/log/repro/repro.log {
+	rotate 14
+	daily
+	compress
+	missingok
+	postrotate
+		start-stop-daemon -K -p /var/run/repro/repro.pid -s HUP -x /usr/sbin/repro -q
+	endscript
+}
diff --git a/debian/repro.postinst b/debian/repro.postinst
index dd4d626..e974638 100644
--- a/debian/repro.postinst
+++ b/debian/repro.postinst
@@ -42,6 +42,9 @@ install() {
     chown ${REPRO_USER}:${REPRO_GROUP} "${REPRO_HOME}"
     chmod 0700 "${REPRO_HOME}"
 
+    chown ${REPRO_USER}:${REPRO_GROUP} /var/log/repro
+    chmod 0750 /var/log/repro
+
 }
 
 case "$1" in
diff --git a/debian/repro.postrm b/debian/repro.postrm
index 827d295..c01b7fe 100644
--- a/debian/repro.postrm
+++ b/debian/repro.postrm
@@ -16,6 +16,11 @@ if [ "$1" = "purge" ] ; then
         if getent group repro >/dev/null; then
                 groupdel repro
         fi
+
+        if [ -d /var/log/repro ];
+        then
+                rm -rf /var/log/repro
+        fi
 fi
 
 
diff --git a/debian/resiprocate-turn-server.dirs b/debian/resiprocate-turn-server.dirs
index 86ef4f6..ba2671e 100644
--- a/debian/resiprocate-turn-server.dirs
+++ b/debian/resiprocate-turn-server.dirs
@@ -1 +1,2 @@
 etc/reTurn
+var/log/reTurnServer
diff --git a/debian/resiprocate-turn-server.init b/debian/resiprocate-turn-server.init
index 16ded2e..76f8351 100644
--- a/debian/resiprocate-turn-server.init
+++ b/debian/resiprocate-turn-server.init
@@ -18,6 +18,7 @@ USER=return
 GROUP=return
 PIDFILE="/var/run/$BIN/$NAME.pid"
 PIDFILE_DIR=`dirname $PIDFILE`
+LOG_DIR=/var/log/reTurnServer
 
 . /lib/lsb/init-functions
 
@@ -36,6 +37,11 @@ if [ ! -d "$PIDFILE_DIR" ];then
     chown $USER:$GROUP "$PIDFILE_DIR"
 fi
 
+if [ ! -d "$LOG_DIR" ];then
+        mkdir -p "$LOG_DIR"
+    chown $USER:$GROUP "$LOG_DIR"
+fi
+
 set -e
 
 case "$1" in
diff --git a/debian/resiprocate-turn-server.logrotate b/debian/resiprocate-turn-server.logrotate
new file mode 100644
index 0000000..996fa13
--- /dev/null
+++ b/debian/resiprocate-turn-server.logrotate
@@ -0,0 +1,9 @@
+/var/log/reTurnServer/reTurnServer.log {
+	rotate 14
+	daily
+	compress
+	missingok
+	postrotate
+		start-stop-daemon -K -p /var/run/reTurnServer/reTurnServer.pid -s HUP -x /usr/sbin/reTurnServer -q
+	endscript
+}
diff --git a/debian/resiprocate-turn-server.postinst b/debian/resiprocate-turn-server.postinst
index aaf8cd0..202ee5a 100644
--- a/debian/resiprocate-turn-server.postinst
+++ b/debian/resiprocate-turn-server.postinst
@@ -51,6 +51,9 @@ install() {
     #    openssl dhparam -outform PEM -out ${DH_PARAM_FILE} 512 > /dev/null
     #fi
 
+    chown ${RETURN_USER}:${RETURN_GROUP} /var/log/reTurnServer
+    chmod 0750 /var/log/reTurnServer
+
 }
 
 case "$1" in
diff --git a/debian/resiprocate-turn-server.postrm b/debian/resiprocate-turn-server.postrm
index f525bb5..ed0b035 100644
--- a/debian/resiprocate-turn-server.postrm
+++ b/debian/resiprocate-turn-server.postrm
@@ -9,6 +9,11 @@ if [ "$1" = "purge" ] ; then
         if getent group return >/dev/null; then
                 groupdel return
         fi
+
+        if [ -d /var/log/reTurnServer ];
+        then
+                rm -rf /var/log/reTurnServer
+        fi
 fi
 
 dpkg-maintscript-helper mv_conffile \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/resiprocate.git



More information about the Pkg-voip-commits mailing list