[systemd-devel] %post %preun rpm macros

Alexey Shabalin a.shabalin at gmail.com
Tue Mar 1 03:38:38 PST 2011


Hello.
We use macroses for %post and %preun in rpm in our distributive(ALTLinux).
Like:
%post
%post_service %name

%preun
%preun_service %name

%*_service is script
- "/sbin/chkconfig --add" for install package
- "/sbin/chkconfig "$1" resetpriorities"+"/sbin/service "$1"
condrestart" for upgrade package
- "/sbin/chkconfig --del" for "/sbin/service "$1" condstop" for
uninstall package
This feature of our distributive.
in init-scripts:

        condstop)
                if [ -e "$LOCKFILE" ]; then
                stop
                fi
                ;;
        condrestart)
                if [ -e "$LOCKFILE" ]; then
                restart
                fi
                ;;
        condreload)
                if [ -e "$LOCKFILE" ]; then
                reload
                fi
                ;;

"condrestart" equivalent to a "try-restart"
"condreload" may be like "reload-or-try-restart"
Is it possible to add aliase for "condrestart" to "try-restart"? and
"condreload" to "reload-or-try-restart"?
What use for "condstop"? May be "stop"?

-- 
Alexey Shabalin


More information about the systemd-devel mailing list