Hasan,
if you are on a Linux environment, you would use system services of some sort. Depending on your linux distro, you can pick. Common now is systemd, though Ubuntu prefers Upstart. You can use Upstart to restart the service automatically (using the respawn stanza).
Alternatively, you can put into place something like Monit to watch a process.