Package ovn-vtep: Scripts

Post install

SYSTEMCTL=systemctl
if [ $1 -eq 1 ]; then
    # move log from openvswitch to ovn dir
    [ ! -f /var/log/openvswitch/ovn-controller-vtep.log ] || mv -f /var/log/openvswitch/ovn-controller-vtep.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-vtep.service || : 
    else 
        # Package upgrade, not uninstall 
        /lib/systemd/systemd-update-helper mark-restart-system-units ovn-controller-vtep.service || : 
    fi 
fi
Pre install

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