Skip to content

Commit

Permalink
[reboot cause] Move reboot-cause files to /host directory so they per…
Browse files Browse the repository at this point in the history
…sist across SONiC upgrades (sonic-net#446)
  • Loading branch information
jleveque authored Jan 28, 2019
1 parent 2619fea commit 97ac8c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

REBOOT_USER=$(logname)
REBOOT_TIME=$(date)
REBOOT_CAUSE_FILE="/var/cache/sonic/reboot-cause.txt"
REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt"
WARM_DIR=/host/warmboot
REDIS_FILE=dump.rdb
REBOOT_SCRIPT_NAME=$(basename $0)
Expand Down
2 changes: 1 addition & 1 deletion scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
DEVPATH="/usr/share/sonic/device"
PLAT_REBOOT="platform_reboot"
REBOOT_CAUSE_FILE="/var/cache/sonic/reboot-cause.txt"
REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt"

function stop_sonic_services()
{
Expand Down
2 changes: 1 addition & 1 deletion show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ def mmu():
@cli.command('reboot-cause')
def reboot_cause():
"""Show cause of most recent reboot"""
PREVIOUS_REBOOT_CAUSE_FILE = "/var/cache/sonic/previous-reboot-cause.txt"
PREVIOUS_REBOOT_CAUSE_FILE = "/host/reboot-cause/previous-reboot-cause.txt"

# At boot time, PREVIOUS_REBOOT_CAUSE_FILE is generated based on
# the contents of the 'reboot cause' file as it was left when the device
Expand Down

0 comments on commit 97ac8c7

Please sign in to comment.