diff --git a/Makefile b/Makefile index 6a15b7e4c6..cefd0a4957 100644 --- a/Makefile +++ b/Makefile @@ -788,6 +788,8 @@ config: 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; \ if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \ + 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 7aab1f023c..1f5987b72f 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3329,7 +3329,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