How to automatically restart pbs_server on failure?

We have a site running OpenPBS 19.1.1 and recently pbs_server was failing due to a segfault

kernel: pbs_server.bin[19889]: segfault at 59 ip 000000000044fd21 sp 00007ffca58f87a0 error 4 in pbs_server.bin[400000+147000]

Despite that failure the pbs.service is still showing as active.

How can I automatically restart pbs_server in such case ? I’ve tried to add Restart=on-failure in the pbs.service file without success.

Thank you

Restarting it automatically would not be good practice. You should try to find out what is causing the segfault. It’s unlikely to be a bug in OpenPBS, possible but unlikely. A possible reason is that its running out of stack space. Have a search on Google for segfaults and setting ulimit.

Thank you, will have a look at the ulimits as this may be a change done at the OS level.