While logged in and using the terminal I can start uwasgi with a config file with no issue.
However, when it's started as a launch daemon, I can only get the default uwsgi to start. There is a line in the config file that trips it up:
module = wsgihandler:application
In the system.log i get the error:
[strict mode] unknown config directive: module
I don't have much experience with launch daemon so any help and guidance would be greatly appreciated!
Karl
Launch Daemon:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>MFMuwsgi</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/etc/uwsgi/uwsgiStartup.sh</string>
</array>
<key>KeepAlive</key><true/>
<key>StandardErrorPath</key><string>/var/log/system.log</string>
<key>LaunchOnlyOnce</key><true/>
</dict>
</plist>
SCRIPT:
#!/bin/sh
/usr/local/Cellar/uwsgi-2.0.19.1/uwsgi /usr/local/etc/uwsgi/web2py.ini
CONFIG FILE:
[uwsgi]
strict = true
# Base application directory
chdir = /Applications/web2py/
# module = [wsgi_module_name]:[application_callable_name]
module = wsgihandler:application
# master = [master process (true of false)]
master = true
# multi interpreter allows multiple services to be hosted in each worker process.
# Disabling reduces the odds of compatibility issues
single-interpreter = trues
#Without it, kill, or any tool that sends SIGTERM (such as some system monitoring tools)
#would attempt to kill uWSGI without success, confounding the operator of said tools.
die-on-term = true
# prevents uWSGI from starting if it is unable to find or load your application module.
need-app = true
disable-logging = true
log-4xx = true
log-5xx = true
#Worker recycling can prevent issues that become apparent over time such as memory leaks or unintentional states.
max-requests = 1000 ; Restart workers after this many requests
max-worker-lifetime = 3600 ; Restart workers after this many seconds
reload-on-rss = 2048 ; Restart workers after this much resident memory
worker-reload-mercy = 60 ; How long to wait before forcefully killing workers
#help identify the workers
auto-procname = true
procname-prefix = "mysvc " # note the space
# processes = [number of processes]
processes = 5
enable-threads = true
#to stop a forking issue
lazy-apps =true
socket = /Applications/web2py/web2py.sock
chmod-socket = 660
vacuum = true