3

I have the following service configured:

[Unit]
Description=HB service started

[Service]
Restart=always # or always, on-abort, etc
RestartSec=3
WorkingDirectory=/home/debian/hb/program
ExecStart=/home/debian/hb/program/program1

[Install]
WantedBy=multi-user.target

Then I do:

ps -ef|grep program1

to get the process id and kill it with "kill". -- just to see if it restarts just as I had it written.

Thing is, the service is NOT restarting!! No matter what I do, whenever I kill the process, the service won't restart. Any idea of what's going on?

Luis Cruz
  • 151

1 Answers1

2

So I figured it out. This solved my issue:

[Unit]
Description=HB service started

[Service]
WorkingDirectory=/home/debian/hb/program
ExecStart=/home/debian/hb/program/program1
Restart=always # or always, on-abort, etc
RestartSec=3

[Install]
WantedBy=multi-user.target

Basically I changed the order of the things, and it worked... Weird but that did the trick.

Luis Cruz
  • 151