I have created a service for systemctl
which works perfectly but whenever I reboot the server it can't auto-restart itself.
The code for the service is:
[Unit]
Description=Service Description
[Service]
User=ubuntu
Group=ubuntu
WorkingDirectory=project_path
Restart=always
ExecStart=/home/ubuntu/.rvm/gems/ruby-2.6.3/wrappers/bundle exec /usr/share/rvm/rubies/ruby-2.6.3/bin/rake QUEUE=* resque:work
Path for the service is
/lib/systemd/system/worker.service