I have a script which streams important logs from another system.

Unfortunately the machines are separated by a large distance which means that the connection between them can be poor.

How to deal with a script which streams data, but has a tendency to stop? Is there an easy way to turn a script into a daemon so that upon an exit, the kernel restarts the process?


Are you on a systemd OS? Writing a unit file is pretty straightforward.


  • Yes, Ubuntu 16.04LTS which uses systemd. Thank you – Greg Sep 28 '17 at 5:10

Your Answer

