Spec file bits for packages migrating from sysv to systemd, for cases where the daemon is not allowed to autostart, and the old package's %postun will successfully restart the daemon on migration upgrades (i.e. it uses "service" to do the try-restart/condrestart). BuildRequires: systemd-units Requires(pre): systemd-sysv chkconfig Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %pre if [ $1 -gt 1 ] && [ ! -e %{_unitdir}/FOO.service ] && \ [ -e %{_initddir}/FOO ] ; then systemd-sysv-convert --save FOO &>/dev/null chkconfig --del FOO &>/dev/null || : fi %post systemctl daemon-reload &>/dev/null || : %preun if [ $1 -eq 0 ] ; then systemctl --no-reload disable FOO.service &>/dev/null systemctl stop FOO.service &>/dev/null || : fi %postun systemctl daemon-reload &>/dev/null [ $1 -gt 0 ] && systemctl try-restart FOO.service &>/dev/null || :