From 78a04c9fc2b426231f3aedf8961491b238fc78bb Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 7 Feb 2011 11:44:54 -0800 Subject: [PATCH] debian: Store more system information in OVSDB. Store the OVS version in OVSDB. Additionally, if the "lsb_release" command is available, store information about the system type and version. Bug #4576 --- debian/openvswitch-switch.init | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 96eb00cf8..60cc369f5 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -193,6 +193,23 @@ unload_modules() { unload_module openvswitch_mod } +set_system_info() { + ovs_version=`ovs-vswitchd --version | sed 's/.*) //;1q'` + ovs-vsctl --no-wait --timeout=5 set Open_vSwitch . \ + ovs-version="$ovs_version" + + if (lsb_release --id) >/dev/null 2>&1; then + system_type=`lsb_release --id -s` + system_release=`lsb_release --release -s` + system_codename=`lsb_release --codename -s` + system_version="${system_release}-${system_codename}" + + ovs-vsctl --no-wait --timeout=5 set Open_vSwitch . \ + system-type="$system_type" \ + system-version="$system_version" + fi +} + case "$1" in start) conf_file=/etc/openvswitch/conf.db @@ -264,6 +281,8 @@ case "$1" in ovs-vsctl --no-wait --timeout=5 init -- set Open_vSwitch . db-version="$schema_ver" + set_system_info + # Start ovs-vswitchd. set -- set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err -- 2.43.0