[ovs-dev] [PATCH] debian: Add an upstart job file

Ben Pfaff blp at nicira.com
Fri Jul 25 14:56:29 UTC 2014


On Thu, Jul 24, 2014 at 03:14:02PM -0600, Andrew James wrote:
> This adds the upstart job configuration file written by James Page from
> Ubuntu's openvswitch-2.0.1+git20140120 package plus the changes proposed in
> https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/1314888
> 
> Signed-off-by: Andrew James <andrew.james at hp.com>

It looks pretty redundant with the sysv init script.  Why not replace
all of:

> +pre-start script
> +  (test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0
> +
> +  . /usr/share/openvswitch/scripts/ovs-lib
> +  test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch
> +
> +  if ovs_ctl load-kmod; then
> +    :
> +  else
> +    echo "Module has probably not been built for this kernel."
> +    if ! test -d /usr/share/doc/openvswitch-datapath-dkms; then
> +      echo "Install the openvswitch-datapath-dkms package."
> +    fi
> +
> +    if test X"$OVS_MISSING_KMOD_OK" = Xyes; then
> +      # We're being invoked by the package postinst.  Do not
> +      # fail package installation just because the kernel module
> +      # is not available.
> +      exit 0
> +    fi
> +  fi
> +  set ovs_ctl start --system-id=random
> +  if test X"$FORCE_COREFILES" != X; then
> +    set "$@" --force-corefiles="$FORCE_COREFILES"
> +  fi
> +  set "$@" $OVS_CTL_OPTS
> +  "$@" || exit $?
> +  
> +end script

with:

pre-start script
  /etc/init.d/openvswitch-switch start
  initctl emit ovs-up
end script

I'm also confused about the test for $OVS_MISSING_KMOD_OK.  Are you
planning to submit some other commit that makes the package postinst
invoke this upstart job?



More information about the dev mailing list