Build the logrotate script according to paths
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 24 Jul 2008 05:21:00 +0000 (05:21 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 24 Jul 2008 05:21:00 +0000 (05:21 +0000)
(Closes issue #13147)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133400 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
contrib/scripts/asterisk.logrotate

index 27b4644..eb7ac50 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -762,7 +762,9 @@ install-logrotate:
        if [ ! -d $(ASTETCDIR)/../logrotate.d ]; then \
                mkdir $(ASTETCDIR)/../logrotate.d ; \
        fi
-       install -m 0644 contrib/scripts/asterisk.logrotate $(ASTETCDIR)/../logrotate.d/asterisk
+       sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
+       install -m 0644 contrib/scripts/asterisk.logrotate.tmp $(ASTETCDIR)/../logrotate.d/asterisk
+       rm -f contrib/scripts/asterisk.logrotate.tmp
 
 config:
        @if [ "${OSARCH}" = "linux-gnu" ]; then \
index f832570..92e6548 100644 (file)
@@ -1,4 +1,4 @@
-/var/log/asterisk/debug /var/log/asterisk/console /var/log/asterisk/full /var/log/asterisk/debug /var/log/asterisk/*log {
+__LOGDIR__/debug __LOGDIR__/console __LOGDIR__/full __LOGDIR__/messages __LOGDIR__/*log {
        weekly
        missingok
        rotate 52
@@ -8,6 +8,6 @@
        create 640 root root 
        sharedscripts
        postrotate
-               /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null 
+               __SBINDIR__/asterisk -rx 'logger reload' > /dev/null 2> /dev/null       
        endscript
-} 
\ No newline at end of file
+}