I am translating my upstart
scripts to systemd
scripts and I am wondring what is the best practice of transalting the following:
start on started postgresql
stop on stopping postgresql
Is the Requires=
section is the right for me or there is a better section?
start on
andstart on started
according to upstart:So in your case,
start on started postgresql
means it needs to start after postgresql has successfully started because it depends on it.In systemd that would be:
Because according to the systemd.unit man page:
As for
stop on
andstop on stopped
according to upstart:The
After=postgresql
mentioned above has you covered because again, according to the systemd.unit man page: