From 98feac173e4e60a3f1fd45f332a5a92e06315ca4 Mon Sep 17 00:00:00 2001 From: Dermot Bradley Date: Sat, 29 Jan 2022 21:01:20 +0000 Subject: [PATCH] init.d/bootmisc.in: prevent error due to nonexistant file During boot if the "previous_dmesg" setting is enabled in /etc/conf.d/bootmisc then during the 1st boot of a machine the bootmisc init.d script will attempt to move a nonexistant dmesg file, so generating an error on the console. Modify the script to only move an existing file. --- init.d/bootmisc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index 4a2e7f02..233dfc55 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -226,7 +226,7 @@ start() case "$RC_SYS" in VSERVER|OPENVZ|LXC|SYSTEMD-NSPAWN) ;; *) - if yesno ${previous_dmesg:-no}; then + if yesno ${previous_dmesg:-no} && [ -e /var/log/dmesg ]; then mv /var/log/dmesg /var/log/dmesg.old fi dmesg > /var/log/dmesg