I advise you to look into systemd. Very useful … Some ideas here : Systemd service file for cardano-node - #8 by hanswurst