Dhanamerdeka
Is more like you will need to create a watchdog because I doubt there is one created already.
The most easy way to do that is to use path unit see examples in here
https://www.redhat.com/sysadmin/introduction-path-units
To edit a service file you need to use this command sudo systemctl edit, allways make a backup of the original and make a backup in a notepad with the modification in case of update the service file could be overwritten and you will lose the modification.
https://www.freedesktop.org/software/systemd/man/systemd.service.html
Above link is a more detailed explanation about how systemd works.
This would take much more time to create it but once is done would be a properly modification.
P.S. A watchdog is more like a watcher but is the closest thing that dropped in my mind to name a modification like this one.