From 73483eab108c47aec0dbe20b797f7fc8a5d12165 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Fri, 22 Jul 2016 16:31:55 -0700 Subject: [PATCH] Add domain socket server (dsserve) when it is available (#40) --- debian/syncd.init | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/debian/syncd.init b/debian/syncd.init index 0ecf760389e7..2da98cecd7fe 100644 --- a/debian/syncd.init +++ b/debian/syncd.init @@ -10,26 +10,42 @@ # Description: Enable service syncd. ### END INIT INFO -DAEMON=/usr/bin/syncd +DAEMON_SYNCD=/usr/bin/syncd + +# dsserve: domain socket server for stdio +DAEMON_DSSERVE=/usr/local/bin/dsserve +DAEMON_DSSERVE_ARGS="-d $DAEMON_SYNCD --diag" + +start_bcm() +{ + [ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0 + [ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0 + [ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0 + + if [ -x $DAEMON_DSSERVE ]; then + DAEMON=$DAEMON_DSSERVE + DAEMON_ARGS=$DAEMON_DSSERVE_ARGS + else + DAEMON=$DAEMON_SYNCD + fi +} case "$1" in start) . /etc/machine.conf if [ "$onie_platform" == "x86_64-dell_s6000_s1220-r0" ]; then - [ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0 - [ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0 - [ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0 + start_bcm + elif [ "$onie_platform" == "x86_64-dell_s6100_c2538-r0" ]; then - [ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0 - [ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0 - [ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0 - - DAEMON_ARGS="-p /etc/syncd.d/dell_s6100.profile -N" + start_bcm + + DAEMON_ARGS+=" -p /etc/syncd.d/dell_s6100.profile -N" elif [ "onie_platform" == "x86_64-mlnx_x86-r5.0.1400" ]; then mkdir -p /dev/sxdevs [ -e /dev/sxdevs/sxcdev ] || mknod /dev/sxdevs/sxcdev c 231 193 + DAEMON=$DAEMON_SYNCD DAEMON_ARGS="-p /etc/syncd.d/mlnx_2700.profile -N" fi