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 onandstart on startedaccording to upstart:So in your case,
start on started postgresqlmeans 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 onandstop on stoppedaccording to upstart:The
After=postgresqlmentioned above has you covered because again, according to the systemd.unit man page: