aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-21 13:13:35 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-21 13:13:35 +0000
commit7421c44b11479277fe71b95ec5b0e286918c7d72 (patch)
tree93fbf45ec6291d167e7a644983bb0f63f5141661 /Makefile
parentaa99ddd21253ddd33a945727b8a6aea5f6df6ea0 (diff)
set ASTVARRUNDIR=$(localstatedir)/run/asterisk as default path
When running asterisk as non-root and without this patch the pidfile wants to go into /var/run/asterisk.pid. This directory is not writable for the non-root user and changing permissions is not an option. Putting it in /var/run/asterisk/asterisk.pid makes it possible to set permissions on the /var/run/asterisk dir so everything works as it should be. Patched committed is based on pabelanger's patch. (closes issue #13153) Reported by: pabelanger Patches: 2009012900_bug13153-nonrootscripts.diff.txt uploaded by mvanbaak (license 7) Review: http://reviewboard.digium.com/r/139/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177852 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index dc2a208cd..3e2950e86 100644
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,7 @@ else
ASTSBINDIR=$(sbindir)
ASTSPOOLDIR=$(localstatedir)/spool/asterisk
ASTLOGDIR=$(localstatedir)/log/asterisk
- ASTVARRUNDIR=$(localstatedir)/run
+ ASTVARRUNDIR=$(localstatedir)/run/asterisk
ASTMANDIR=$(mandir)
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
@@ -805,22 +805,28 @@ install-logrotate:
config:
@if [ "${OSARCH}" = "linux-gnu" ]; then \
if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
- $(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
+ cat contrib/init.d/rc.redhat.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
+ chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
elif [ -f /etc/debian_version ]; then \
- $(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
+ cat contrib/init.d/rc.debian.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
+ chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
elif [ -f /etc/gentoo-release ]; then \
- $(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk $(DESTDIR)/etc/init.d/asterisk; \
+ cat contrib/init.d/rc.gentoo.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
+ chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
- $(INSTALL) -m 755 contrib/init.d/rc.mandriva.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
+ cat contrib/init.d/rc.mandriva.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
+ chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
- $(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk $(DESTDIR)/etc/init.d/asterisk; \
+ cat contrib/init.d/rc.suse.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
+ chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
elif [ -f /etc/arch-release -o -f /etc/arch-release ]; then \
- $(INSTALL) -m 755 contrib/init.d/rc.archlinux.asterisk $(DESTDIR)/etc/rc.d/asterisk; \
+ cat contrib/init.d/rc.archlinux.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/asterisk ;\
+ chmod 755 $(DESTDIR)/etc/rc.d/asterisk;\
elif [ -f /etc/slackware-version ]; then \
echo "Slackware is not currently supported, although an init script does exist for it." \
else \