I have successfully found the solution.
The Chapter Server Process
in Deploying Your Yesod Webapp describes how to run a Yesod App as a server process. It says to create the following Upstart config file in /etc/init/mySite
description "My awesome Yesod application"
start on runlevel [2345];
stop on runlevel [!2345];
respawn
chdir /home/michael/sites/mysite
exec /home/michael/sites/mysite/dist/build/mysite/mysite
The problem is that the last line is incomplete. Yesod offers you to run your webapp in Development, Testing, Staging or Production mode. Therefore, you need to specify it in the exec
command.
Here is an example:
exec /home/michael/sites/mysite/dist/build/mysite/mysite Development
or
exec /home/michael/sites/mysite/dist/build/mysite/mysite MODE
where MODE = Development, Testing, Staging or Production .