Package ovn-host: Скрипты

Post install

if [ $1 -eq 1 ]; then
    # move log from openvswitch to ovn dir
    [ ! -f /var/log/openvswitch/ovn-controller.log ] || mv -f /var/log/openvswitch/ovn-controller.log* /var/log/ovn/
    chown -R openvswitch:openvswitch /var/log/ovn
fi

 
if sd_booted; then 
    systemctl daemon-reload 
    if [ $1 -eq 1 ]; then 
        # Initial installation 
        systemctl --no-reload preset ovn-controller.service || : 
    else 
        # Package upgrade, not uninstall 
        /lib/systemd/systemd-update-helper mark-restart-system-units ovn-controller.service || : 
    fi 
fi
Pre install

# Save the "enabled" state across the transition of
# ownership of ovn-controller.service from openvswitch-ovn-host to
# ovn-host.
SYSTEMCTL=systemctl
if [ $1 -eq 1 ]; then
    if sd_booted && "$SYSTEMCTL" --quiet is-enabled ovn-controller; then
        touch /run/openvswitch-rpm-state-ovn-controller ||:
    fi
    if sd_booted && [ -f /run/openvswitch/ovn-controller.pid ]; then
        touch /run/openvswitch-rpm-state-ovn-controller-started ||:
        "$SYSTEMCTL" --quiet stop ovn-controller ||:
    fi
fi
Pre uninstall

1
2
3
4
5
 
if [ $1 -eq 0 ] && sd_booted; then 
    # Package removal, not upgrade 
    systemctl --no-reload -q disable --now ovn-controller.service || : 
fi