X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=debian%2Fopenvswitch-switch.postinst;h=c50853a11879da0501c88060c5734745b1139f5f;hb=169390eed03f9854441ca76dc74fd906f614b761;hp=39b2de4611ecd78974909c7c26c003ccef313cea;hpb=b3a43165749f80d7f3eda34e2e2b07f7a349e298;p=openvswitch diff --git a/debian/openvswitch-switch.postinst b/debian/openvswitch-switch.postinst index 39b2de46..c50853a1 100755 --- a/debian/openvswitch-switch.postinst +++ b/debian/openvswitch-switch.postinst @@ -33,30 +33,6 @@ case "$1" in fi done fi - - if /etc/init.d/openvswitch-switch status >/dev/null 2>&1; then - running=true - /etc/init.d/openvswitch-switch stop - else - running=false - fi - - if test ! -e /etc/openvswitch-switch/conf; then - # Create configuration database. - ovsdb-tool -vANY:console:emer \ - create /etc/openvswitch-switch/conf \ - /usr/share/openvswitch/vswitch-idl.ovsschema - - # Initialize configuration database. - ovsdb-tool -vANY:console:emer \ - transact /etc/openvswitch-switch/conf \ - '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \ - > /dev/null - fi - - if $running; then - /etc/init.d/openvswitch-switch start - fi ;; abort-upgrade|abort-remove|abort-deconfigure) @@ -68,6 +44,23 @@ case "$1" in ;; esac +HAVE_KMOD="no" + +init_script_error () { + if test X"$HAVE_KMOD" = Xno; then + exit 0 + fi + exit 1 +} + +# Do not fail package installation just because the kernel module +# is not available. +if test -x /etc/init.d/openvswitch-switch; then + if invoke-rc.d openvswitch-switch load-kmod; then + HAVE_KMOD="yes" + fi +fi + #DEBHELPER# exit 0