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:
parent
a26809a223
commit
aea18165a8
@ -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
|
||||
|
10
files/image_config/watchdog-control/watchdog-control.service
Normal file
10
files/image_config/watchdog-control/watchdog-control.service
Normal 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
|
22
files/image_config/watchdog-control/watchdog-control.sh
Normal file
22
files/image_config/watchdog-control/watchdog-control.sh
Normal 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
|
Reference in New Issue
Block a user