packages/net/openvswitch/files/etc/init.d/openvswitch.init
Helmut Schaa 03515b807d openvswitch: Run with nice -10 (#1765)
This is default if ovs is started through ovs-ctl but we start it directly, hence
tell procd to use nice -10 for ovs.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
2014-09-22 18:10:48 +03:00

41 lines
1.2 KiB
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
# Copyright (C) 2014 OpenWrt.org
START=15
USE_PROCD=1
start_service() {
[ -x /var/run/openvswitch ] || mkdir -p /var/run/openvswitch
[ -e /etc/openvswitch/conf.db ] || {
/usr/bin/ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
}
# ovsdb-server
procd_open_instance
procd_set_param command /usr/sbin/ovsdb-server
procd_append_param command --remote=punix:/var/run/db.sock
procd_append_param command --remote=db:Open_vSwitch,Open_vSwitch,manager_options
procd_append_param command --pidfile=/var/run/ovsdb-server.pid
procd_set_param respawn
procd_append_param respawn 3600
procd_append_param respawn 5
procd_append_param respawn -1
procd_set_param nice
procd_append_param nice -10
procd_close_instance
# ovs-vswitchd
procd_open_instance
procd_set_param command /usr/sbin/ovs-vswitchd
procd_append_param command --pidfile=/var/run/ovs-vswitchd.pid
procd_set_param respawn
procd_append_param respawn 3600
procd_append_param respawn 5
procd_append_param respawn -1
procd_set_param nice
procd_append_param nice -10
procd_close_instance
}