26050ffef8
Fix for the host unmount issue through PR https://github.com/Azure/sonic-buildimage/pull/4558 and https://github.com/Azure/sonic-buildimage/pull/4865 creates the timeout of syslog.socket closure during reboot since the journald socket closure has been included in syslog.socket Removed the journal socket closure. The host unmount is fixed with just stopping the services which gets restarted only after /var/log unmount and not causing the unmount issues.
32 lines
675 B
Bash
Executable File
32 lines
675 B
Bash
Executable File
#!/bin/bash
|
|
# This script is invoked at the closure of syslog socket during reboot
|
|
# This will stop journal services, unmount /var/log and delete loop device
|
|
# associated to /host to ensure proper unmount of /host
|
|
|
|
journal_stop() {
|
|
systemctl stop systemd-journald.service
|
|
}
|
|
|
|
delete_loop_device() {
|
|
umount /var/log
|
|
if [[ $? -ne 0 ]]
|
|
then
|
|
exit 0
|
|
fi
|
|
loop_exist=$(losetup -a | grep loop1 | wc -l)
|
|
if [ $loop_exist -ne 0 ]; then
|
|
losetup -d /dev/loop1
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
journal_stop|delete_loop_device)
|
|
$1
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {journal_stop|delete_loop_device}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|