aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-15 01:37:04 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-15 01:37:04 +0000
commitecfc5f5016bd40225a8b80b131225f6fee34fda0 (patch)
tree7bf0bbb2bcf6d822a359a71e36ecc484ca8d104e
parent4425687c69941c1d841d82b524c05d19bbd7914a (diff)
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: http://svn.digium.com/svn/asterisk/trunk@252362 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--Makefile2
-rw-r--r--contrib/init.d/org.asterisk.asterisk.plist47
-rw-r--r--main/asterisk.c2
3 files changed, 50 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2febcd893..6e292718c 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 000000000..a0c87e835
--- /dev/null
+++ b/contrib/init.d/org.asterisk.asterisk.plist
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>org.asterisk.asterisk.launchagent</string>
+ <key>Disabled</key>
+ <false/><!-- Change this to '<true/>' to disable Asterisk -->
+ <key>UserName</key>
+ <string>asterisk</string>
+ <key>GroupName</key>
+ <string>asterisk</string>
+ <key>OnDemand</key><!-- For 10.4 (deprecated in 10.5 and above) -->
+ <false/>
+ <key>KeepAlive</key><!-- For 10.5 and above -->
+ <true/>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>Umask</key>
+ <integer>432</integer><!-- 0660 -->
+ <key>Program</key>
+ <string>/usr/local/sbin/asterisk</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/usr/local/sbin/asterisk</string>
+ <string>-f</string><!-- Don't fork. This option is mandatory when running with launchd. -->
+ </array>
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>TERM</key>
+ <string>xterm-color</string>
+ </dict>
+ <key>SoftResourceLimits</key>
+ <dict>
+ <key>NumberOfFiles</key>
+ <integer>1024</integer>
+ <key>Core</key>
+ <integer>0</integer>
+ </dict>
+ <key>StandardInPath</key>
+ <string>/dev/null</string>
+ <key>StandardOutPath</key>
+ <string>/dev/null</string>
+ <key>StandardErrorPath</key>
+ <string>/dev/null</string>
+</dict>
+</plist>
diff --git a/main/asterisk.c b/main/asterisk.c
index 60f818e09..532bbc709 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