[SOLVED] OpenHABian - first-boot.log always shown during ssh

While my OpenHABian installation has been running happily since March 2017 and has just upgraded to OH2.1 without problems, I have an issue relating to ssh-ing into the box.

Everytime I ssh in, I am greeted by the ‘Every 1.0s: cat /boot/first-boot.log’ message that displays about 20 lines of the log ending with the message:

2017-05-15_22:28:53_BST [openHABian] First time boot setup successfully finished.

If I ctrl-c I can get to the command line, but I NEVER see the normal welcome screen. I’ve got all the files I would expect to see - afterfirstboot.lock & openHABian-install-successful.

It doesn’t stop the system working, but it is annoying - any suggestions about how can I fix this?

1 Like

Hey! certainly strange. You should be able to get it to work by executing:

sudo rm /home/pi/openHABian-install-failed
sudo rm /opt/openHABian-install-failed
sudo rm /opt/openHABian-install-inprogress
sudo touch /opt/afterfirstboot.lock
sudo touch /opt/openHABian-install-successful
1 Like

Hi Thom,

Yup - weird isn’t it… anyway

sudo rm /home/pi/openHABian-install-failed
sudo rm /opt/openHABian-install-failed
sudo rm /opt/openHABian-install-inprogress
sudo touch /opt/afterfirstboot.lock
sudo touch /opt/openHABian-install-successful

Does not exist
Does not exist
Does not exist
Exists - contents are:

[openHABian] Created after first boot script succeeded (see /etc/rc.local). Do not delete.

Exists - no contents.

Run the commands, no change - ssh still shows the first-boot.log on login.

Sorry.

Could you check the content of /etc/rc.local? I wonder if you’ll find a file with just one-two lines of code. In this case your installation failed at an early stage, I wonder if your setup is benefiting from all openHABian has to offer…

#!/bin/sh -e
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.

FLAG="/opt/afterfirstboot.lock"
FIRSTBOOT="/boot/first-boot.sh"

# Only executed after first boot
if [ ! -f "$FLAG" ]; then
  echo "[openHABian] Flag file 'afterfirstboot.lock' not found, continuing with '$FIRSTBOOT' script."
  if [ ! -f "$FIRSTBOOT" ]; then "[openHABian] 'first-boot.sh' not found, Exiting."; exit 0; fi
  if (/bin/bash "$FIRSTBOOT"); then
    echo "[openHABian] Created after first boot script succeeded (see /etc/rc.local). Do not delete." > "$FLAG"
    modprobe ledtrig_heartbeat
    echo "heartbeat" >/sys/class/leds/led0/trigger
  else
    echo "[openHABian] Script '$FIRSTBOOT' failed."
    modprobe ledtrig_timer
    echo "timer" >/sys/class/leds/led0/trigger
    echo 100 >/sys/class/leds/led0/delay_on
    echo 100 >/sys/class/leds/led0/delay_off
  fi
fi

exit 0

# vim: filetype=sh

:see_no_evil: sorry, I meant cat ~/.bash_profile.

Don’t have one.

cat: /home/openhabian/.bash_profile.: No such file or directory

Did you copy the dot at the end as part of the command?

Yup - and I went back and checked it again.

And the response also includes the ‘.’

cat: /home/openhabian/.bash_profile.: No such file or directory

Having moment… I’m guessing I shouldn’t have the extra ‘.’!!
Sorry - been long day already!

Nothing in my .bash_profile, although it does exist.

UPDATE

I ran the command

cat ~/.bash_profile

and although it returned nothing, logging out and back in again now drops me directly to the command line. The first-boot.log no longer shows - so some progress.

I’m guessing that the .bash_profile has been corrupted and is missing vital stuff?

I think so too but that should be easily fixed. Execute sudo openhabian-config, then select “Apply Improvements”, then run all options. The one solving the issue is “Bash&Vim Settings”. Good luck!

Running now…

… and done.

Ran all 4 options under the ‘Apply improvements’ menu item
Updated the openhabian-config tool itself
Updated the system

Logout
Login…

… and success. I can see the FireMoD summary once again.

Thanks Thom.

1 Like