[snmp] remove hostname change as it share uts namespace with host (#4206)

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
This commit is contained in:
Stepan Blyshchak 2020-02-29 01:57:03 +02:00 committed by GitHub
parent d19bba0ec0
commit 41ae7a2102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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