i would suggest changing pkill  g  service pid to kill  service pid because instant killing of parent and child processes with sigterm when a parent is supposed to stop children itself does not seem a good thing to do and leads to failures in grenade see 