Have been working on creating some systemd services to launch some features on a raspberrypi that is used for running a rails app. No issues with a service for launching a python script nor one for putting the pi in kiosk mode, when it comes to launching the systemd service for rails it is failing.
Here is my service file:
Description=evr server boot
ExecStart=/home/pi/.rbenv/bin/rbenv bundle exec rails s -b 192.168.1.66
when running it produces this error:
$ systemctl status evrserver
● evrserver.service - evr server boot
Loaded: loaded (/etc/systemd/system/evrserver.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2019-04-03 18:34:22 BST; 2min 51s ago
Process: 425 ExecStart=/home/pi/.rbenv/bin/rbenv bundle exec rails s -b 192.168.1.66 (code=exited, status=1/FAILURE)
Apr 03 18:34:22 raspberrypi systemd: Failed to start evr server boot.
Apr 03 18:34:22 raspberrypi systemd: evrserver.service: Unit entered failed state.
Apr 03 18:34:22 raspberrypi systemd: evrserver.service: Failed with result ‘exit-code’.
any thoughts here? thinking the rbenv PATH is causing the issue, not sure how its needing to be structured to access that correct PATH to execute the ‘rails’ command.