Skip to content

Commit

Permalink
[snmp] remove hostname change as it share uts namespace with host (so…
Browse files Browse the repository at this point in the history
…nic-net#4206)

Signed-off-by: Stepan Blyschak <[email protected]>
  • Loading branch information
stepanblyschak authored and tiantianlv committed Apr 24, 2020
1 parent 7c7231a commit 875d03e
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions dockers/docker-snmp-sv2/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ sonic-cfggen -d -y /etc/sonic/snmp.yml -t /usr/share/sonic/templates/snmpd.conf.
mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status

CURRENT_HOSTNAME=`hostname`
HOSTNAME=`sonic-cfggen -d -v DEVICE_METADATA[\'localhost\'][\'hostname\']`

if [ "$?" == "0" ] && [ "$HOSTNAME" != "" ]; then
echo $HOSTNAME > /etc/hostname
hostname -F /etc/hostname

sed -i "/\s$CURRENT_HOSTNAME$/d" /etc/hosts
echo "127.0.0.1 $HOSTNAME" >> /etc/hosts
fi

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd
Expand Down

0 comments on commit 875d03e

Please sign in to comment.