openvswitch.init 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
  3. # Copyright (C) 2014 OpenWrt.org
  4. START=15
  5. USE_PROCD=1
  6. start_service() {
  7. [ -x /var/run/openvswitch ] || mkdir -p /var/run/openvswitch
  8. [ -e /etc/openvswitch/conf.db ] || {
  9. /usr/bin/ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
  10. }
  11. # ovsdb-server
  12. procd_open_instance
  13. procd_set_param command /usr/sbin/ovsdb-server
  14. procd_append_param command --remote=punix:/var/run/db.sock
  15. procd_append_param command --remote=db:Open_vSwitch,Open_vSwitch,manager_options
  16. procd_append_param command --pidfile=/var/run/ovsdb-server.pid
  17. procd_set_param respawn
  18. procd_append_param respawn 3600
  19. procd_append_param respawn 5
  20. procd_append_param respawn -1
  21. procd_set_param nice
  22. procd_append_param nice -10
  23. procd_close_instance
  24. # ovs-vswitchd
  25. procd_open_instance
  26. procd_set_param command /usr/sbin/ovs-vswitchd
  27. procd_append_param command --pidfile=/var/run/ovs-vswitchd.pid
  28. procd_set_param respawn
  29. procd_append_param respawn 3600
  30. procd_append_param respawn 5
  31. procd_append_param respawn -1
  32. procd_set_param nice
  33. procd_append_param nice -10
  34. procd_close_instance
  35. }