I have some Plack apps for REST API's that I can launch via plackup or start_server if want to daemonize and control them. The target server I'm going to run them on is Centos 7 which encourages using systemd. I'd like the apps to launch on reboot and be controllable via the systemctl command like other services.
I've tried a simple unit file like this:
[Unit]
Description=Kelp API PSGI app
After=network.target
[Service]
ExecStart=/usr/bin/plackup -E deployment -p 8081 -s Starman --max-workers=2 app.psgi
User=www-data
WorkingDirectory=/usr/local/www/kelp/ajax_api/
[Install]
WantedBy=multi-user.target
However, this fails to launch, I get this error:
Jul 10 13:59:35
p4904302.pubip.peer1.net systemd[1]: Started Kelp API plack.
Jul 10 13:59:35
p4904302.pubip.peer1.net systemd[1]: Starting Kelp API plack...
Jul 10 13:59:35
p4904302.pubip.peer1.net systemd[123826]: Failed at step USER spawning /usr/bin/plackup: No such process
Jul 10 13:59:35
p4904302.pubip.peer1.net systemd[1]: kelp-api.service: main process exited, code=exited, status=217/USER
J
/usr/bin/plackup exists; I've tried using start_server as a wrapper around plackup in the ExecStart line, but that fails also.
I've also tried using uwsgi to serve the application, and while it works from the command line it doesn't seem to work with systemd either.
Does anyone have any examples of how this should work?
Thanks.