Add watchdog-control service to disable watchdog during bootup (#3877)

* Add watchdog-control service to disable watchdog during bootup

Disable only if it's applicable and the watchdog is enabled.

* Address the review comment

* Correct the watchdog start script name

* Change to call common watchdog api instead of platform specific

* Start watchdog control service after swss starts

* advance sonic-utility submodule
This commit is contained in:
Sujin Kang 2019-12-13 12:44:11 -08:00 committed by GitHub
parent a26809a223
commit aea18165a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 1 deletions

View File

@ -138,6 +138,11 @@ sudo sed -i -e '/^passwd/s/ tacplus//' $FILESYSTEM_ROOT/etc/nsswitch.conf
# Copy crontabs
sudo cp -f $IMAGE_CONFIGS/cron.d/* $FILESYSTEM_ROOT/etc/cron.d/
# Copy watchdog-control files
sudo LANG=C cp $IMAGE_CONFIGS/watchdog-control/watchdog-control.sh $FILESYSTEM_ROOT/usr/local/bin/watchdog-control.sh
sudo LANG=C cp $IMAGE_CONFIGS/watchdog-control/watchdog-control.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable watchdog-control.service
# Copy NTP configuration files and templates
sudo cp $IMAGE_CONFIGS/ntp/ntp-config.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable ntp-config.service

View File

@ -0,0 +1,10 @@
[Unit]
Description=watchdog control service
After=swss.service
[Service]
Type=simple
ExecStart=/usr/bin/watchdog-control.sh
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,22 @@
#! /bin/bash
VERBOSE=no
function debug()
{
/usr/bin/logger "$0 : $1"
if [[ x"${VERBOSE}" == x"yes" ]]; then
echo "$(date) $0: $1"
fi
}
function disable_watchdog()
{
if [[ -x /usr/bin/watchdog ]]; then
debug "Disabling Watchdog during bootup"
/usr/bin/watchdog -d
fi
}
disable_watchdog

@ -1 +1 @@
Subproject commit 8237848b73169c7ab3d88e3e309533a88fa6891d
Subproject commit 792df2038ef7f270b46f8e6d3c2c0a73ceb25911