I'm really getting crazy trying to figure out why my systemd service won't start at boot, or whenever the ruby script associated fails (like what should do in my intention). I'm running it on a EC2 Ubuntu instance.
Here's the code of the service:
[Unit]
Description=Test
[Service]
User=ubuntu
Type=simple
ExecStart=/usr/bin/ruby /home/ubuntu/main/test.rb
Restart=on-failure
RestartSec=1s
[Install]
WantedBy=multi-user.target
I tried changing the target, or the user name, or the type...nothing happens. And the journal doesn't give me any particular info. The service works smoothly if I start it.
But if the script fails, or whenever I kill it to test it, it just ignore the restart thing.
sudo systemctl status yourservice
? A