]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 252362 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 15 Mar 2010 01:37:44 +0000 (01:37 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 15 Mar 2010 01:37:44 +0000 (01:37 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r252362 | tilghman | 2010-03-14 20:37:04 -0500 (Sun, 14 Mar 2010) | 11 lines

  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/branches/1.6.0@252363 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
contrib/init.d/org.asterisk.asterisk.plist [new file with mode: 0644]
main/asterisk.c

index e51288c7218e1ebdbcd31e869afd2b99b2ba9589..66047b1f581e9260fbbf8761db879e21725a2779 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -786,6 +786,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 (file)
index 0000000..a0c87e8
--- /dev/null
@@ -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>
index 74bd91198b4a0133dbfa983b6b00b72e069d7c94..5adc7db55c06f8a410e6af7282bd4d61ff81f79c 100644 (file)
@@ -3303,7 +3303,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