I have the following script in the /etc/systemd/system/ folder
# Start the ruby on rails app on boot
[Unit]
Description=Start Ruby Online Ordering Application
[Service]
Type=simple
RemainAfterExit=yes
Username=root
PIDFile=/home/deviant/www/tmp/pids/server.pid
WorkingDirectory=/home/deviant/www
ExecStart=/home/deviant/www/run.sh
TimeoutSec=300
[Install]
WantedBy=multi-user.target
with a permission of -rw-r--r-- 1 root root
The run.sh script contains
#!/bin/sh
service httpd stop
rails s -p 80 -d
with a permission of -rwxrwxr-x 1 root root
In short, it is supposed to start a ruby application upon restart of a server, however, it does not appear to be working.
Where can I check to see system error logs? What would cause it NOT to start upon a server restart?
UPDATE
tried changing the script to
[Service]
Type=oneshot
RemainAfterExit=yes
PIDFile=/home/deviant/www/tmp/pids/server.pid
WorkingDirectory=/home/deviant/www
ExecStart=/home/deviant/www/run.sh
TimeoutSec=300
And I now get on systemctl enable....
Unknown lvalue 'Username' in section 'Service' ...has Restart= setting other than no, which isn't allowed for Type=oneshot services. Refusing.
I'm not sure what this even means.......what does it mean?