I have a Mojolicious app that I would like to run automatically when the server starts. Normally, if I want to deploy the application, I use carton install
to grab the appropriate dependencies, then I run carton exec -- hypnotoad script/myapp
and I'm up and running.
I've created an init.d script that starts|stops the application by calling carton exec -- hypnotoad script/myapp
, but Carton doesn't seem to be working properly. Instead, I get sudo: carton: command not found
followed by a number of Can't locate <MODULE>.pm in @INC...
errors.
How do I go about making Carton available to an init.d script? Or how do I run a Carton command from an init.d script?