Nomad lifecycle hook tasks

I have one job tha have three tasks.
One prestart hook lifecycle sidecar = false
One main service docker task.
And one poststart hook lifecycle sidecar = false.

With the first i initiate some values that task 2 need.
After that task 2 docker service start. And with 3 task poststart i modify some values.
When i start the job (nomad job run xxxxx) everything working fine.
On server restart tho when nomad cluster is up again, all services are runnig exept this job because the lifecycle tasks do not run again.
I search the docs for an answer but no luck. Maybe there is another way to trigger that one time exec lifecycle tasks?
In senario that host that nomad cluster is hosted these services will not run correctly unfortunately!

Hi @dtzampanakis, I think it sounds like you want to disable task restarts, instead forcing them to be rescheduled so that the entire task lifecycle is run again.

You can do that by setting a restart block on the task, e.g.

restart {
  attempts = 0
  mode     = "fail"