From 4c8f14b7cf6fbea8c7644d14777d2c8bffe3f033 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Mon, 15 Mar 2010 01:37:04 +0000 Subject: [PATCH] Merged revisions 252361 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r252361 | tilghman | 2010-03-14 20:33:50 -0500 (Sun, 14 Mar 2010) | 4 lines Launch Asterisk on Mac OS X with launchd. Reviewboard: https://reviewboard.asterisk.org/r/551/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252362 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- Makefile | 2 + contrib/init.d/org.asterisk.asterisk.plist | 47 ++++++++++++++++++++++ main/asterisk.c | 2 +- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 contrib/init.d/org.asterisk.asterisk.plist diff --git a/Makefile b/Makefile index 2febcd893b..6e292718c1 100644 --- a/Makefile +++ b/Makefile @@ -851,6 +851,8 @@ config: elif [ -f /etc/arch-release -o -f /etc/arch-release ]; then \ 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 [ -d $(DESTDIR)/Library/LaunchDaemons -a ! -f $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist ]; then \ + $(INSTALL) -m 644 contrib/init.d/org.asterisk.asterisk.plist $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist; \ elif [ -f /etc/slackware-version ]; then \ echo "Slackware is not currently supported, although an init script does exist for it."; \ else \ diff --git a/contrib/init.d/org.asterisk.asterisk.plist b/contrib/init.d/org.asterisk.asterisk.plist new file mode 100644 index 0000000000..a0c87e8359 --- /dev/null +++ b/contrib/init.d/org.asterisk.asterisk.plist @@ -0,0 +1,47 @@ + + + + + Label + org.asterisk.asterisk.launchagent + Disabled + + UserName + asterisk + GroupName + asterisk + OnDemand + + KeepAlive + + RunAtLoad + + Umask + 432 + Program + /usr/local/sbin/asterisk + ProgramArguments + + /usr/local/sbin/asterisk + -f + + EnvironmentVariables + + TERM + xterm-color + + SoftResourceLimits + + NumberOfFiles + 1024 + Core + 0 + + StandardInPath + /dev/null + StandardOutPath + /dev/null + StandardErrorPath + /dev/null + + diff --git a/main/asterisk.c b/main/asterisk.c index 60f818e09f..532bbc709b 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3501,7 +3501,7 @@ int main(int argc, char *argv[]) } else ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", ast_config_AST_PID, strerror(errno)); #else - ast_log(LOG_WARNING, "Mac OS X detected. Use '/sbin/launchd -d' to launch with the nofork option.\n"); + ast_log(LOG_WARNING, "Mac OS X detected. Use 'launchctl load /Library/LaunchDaemon/org.asterisk.asterisk.plist'.\n"); #endif } #endif -- 2.47.2