[Exherbo-dev] systemd paludis uninstall phase

Vasiliy G Tolstov v.tolstov at selfip.ru
Mon Jan 17 17:12:58 GMT 2011


Hello. I read documentation about system and have one question:

http://0pointer.de/public/systemd-man/daemon.html - this is for rpm
packaging system, but why paludis systemd-service does not contain 
this? 


%post
if [ $1 -eq 1 ]; then
        # On install (not upgrade), enable (but don't start) the
        # units by default
        /bin/systemctl enable foobar.service foobar.socket >/dev/null 2>&1 || :

        # Alternatively, just call
        # /bin/systemctl daemon-reload >/dev/null 2>&1 || :
        # here, if the daemon should not be enabled by default on
        # installation
fi

%preun
if [ $1 -eq 0 ]; then
        # On uninstall (not upgrade), disable and stop the units
        /bin/systemctl disable foobar.service foobar.socket >/dev/null 2>&1 || :
        /bin/systemctl stop foobar.service foobar.socket >/dev/null 2>&1 || :
fi

%postun
# Reload init system configuration, to make systemd honour changed
# or deleted unit files
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
        # On upgrade (not uninstall), optionally, restart the daemon
        /bin/systemctl try-restart foobar.service >/dev/null 2>&1 || :
fi


-- 
Vasiliy G Tolstov <v.tolstov at selfip.ru>
Selfip.Ru




More information about the Exherbo-dev mailing list