Skip to content

Commit

Permalink
bug fix: fix syncd.init undefined variables when stopping daemons (so…
Browse files Browse the repository at this point in the history
  • Loading branch information
stcheng authored Jul 26, 2016
1 parent f2e19a8 commit b2fca1b
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions debian/syncd.init
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,39 @@ DAEMON_SYNCD=/usr/bin/syncd
DAEMON_DSSERVE=/usr/local/bin/dsserve
DAEMON_DSSERVE_ARGS="-d $DAEMON_SYNCD --diag"

if [ -x $DAEMON_DSSERVE ]; then
DAEMON=$DAEMON_DSSERVE
DAEMON_ARGS=$DAEMON_DSSERVE_ARGS
else
DAEMON=$DAEMON_SYNCD
fi

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
start_mlnx()
{
mkdir -p /dev/sxdevs
[ -e /dev/sxdevs/sxcdev ] || mknod /dev/sxdevs/sxcdev c 231 193
}

case "$1" in
start)
. /etc/machine.conf
[ -r /etc/machine.conf ] && . /etc/machine.conf

if [ "$onie_platform" == "x86_64-dell_s6000_s1220-r0" ]; then
start_bcm

elif [ "$onie_platform" == "x86_64-dell_s6100_c2538-r0" ]; then
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
elif [ "$onie_platform" == "x86_64-mlnx_x86-r5.0.1400" ]; then
start_mlnx
DAEMON_ARGS="-p /etc/syncd.d/mlnx_2700.profile -N"
fi

Expand Down

0 comments on commit b2fca1b

Please sign in to comment.