Search code examples
node.jsdocpad

Docpad run with forever module does not work


I would like to run docpac with the help of the forever module (https://github.com/nodejitsu/forever). I am on a debian server with docpad 6.53.0 and node.js 0.10.15. But when I do

cd mydocpad-website
forever start <path_to_docpad>/docpad run

I find the following errors in the log files:

info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: eco, highlightjs, marked, paged
info: Environment: development
error: Something went wrong with the action
error: An error occured:
Error: Could not start the web server, chances are the desired port 9778 is already in use
at Server.<anonymous> (/home/bru/website/node_modules/docpad/out/lib/docpad.js:4138:17)
at Server.g (events.js:175:14)
at Server.EventEmitter.emit (events.js:95:17)
at net.js:1043:12
at process._tickDomainCallback (node.js:459:13)

When I start docpad without forever, everything works fine.

My plan ist to put forever with @reboot in a crontab file. Or is it better to use inittab?

Thanks for any hints.


Solution

  • Have you tried passing the env argument?

    Try:

    forever start ./node_modules/docpad/bin/docpad run --env static