From 30337ac33f4e4187a85c921679b6a16648790e53 Mon Sep 17 00:00:00 2001 From: MathiasB Date: Fri, 18 Nov 2016 17:58:40 +0100 Subject: [PATCH] launchd service file for Mac --- dist/init/mac-launchd/README.md | 12 +++++++ .../mac-launchd/com.caddyserver.web.plist | 31 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 dist/init/mac-launchd/README.md create mode 100644 dist/init/mac-launchd/com.caddyserver.web.plist diff --git a/dist/init/mac-launchd/README.md b/dist/init/mac-launchd/README.md new file mode 100644 index 000000000..168356775 --- /dev/null +++ b/dist/init/mac-launchd/README.md @@ -0,0 +1,12 @@ +launchd service for macOS +========================= + +This is a sample file for a *launchd* service on Mac. +Edit the paths and email in the plist file to match your info. + +Start and Stop the Caddy launchd service using the following commands: + + $ launchctl load ~/Library/LaunchAgents/com.caddyserver.web.plist + $ launchctl unload ~/Library/LaunchAgents/com.caddyserver.web.plist + +More information can be found in this blogpost: [Running Caddy as a service on macOS X server](https://denbeke.be/blog/software/running-caddy-as-a-service-on-macos-os-x-server/) \ No newline at end of file diff --git a/dist/init/mac-launchd/com.caddyserver.web.plist b/dist/init/mac-launchd/com.caddyserver.web.plist new file mode 100644 index 000000000..ac20be902 --- /dev/null +++ b/dist/init/mac-launchd/com.caddyserver.web.plist @@ -0,0 +1,31 @@ + + + + + Label + com.caddyserver.web + EnvironmentVariables + + HOME + /Users/mathias + + ProgramArguments + + sh + -c + ulimit -n 8192; cd /Users/mathias/Sites; ./caddy -agree -email my_email@domain.com -conf=/Users/mathias/Sites/Caddyfile + + UserName + www + RunAtLoad + + KeepAlive + + WorkingDirectory + /Users/mathias/Sites + StandardOutPath + /Users/mathias/Sites/caddy.log + StandardErrorPath + /Users/mathias/Sites/caddy_error.log + + \ No newline at end of file