Skip to content

Commit

Permalink
Add domain socket server (dsserve) when it is available (sonic-net#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
stcheng authored and lguohan committed Jul 22, 2016
1 parent 6f2c8b6 commit 73483ea
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions debian/syncd.init
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 73483ea

Please sign in to comment.