Remove Frontail completely from OH 3/4

On my system it looks like frontail is linked into the modules directory:

ls -ld /lib/node_modules/frontail
lrwxrwxrwx 1 root root 21 Aug 10  2021 /lib/node_modules/frontail -> ../../../opt/frontail

What I would do if I would like to remove frontail would be:

  • remove / delete the link to the /opt/frontail directory
  • rename the /opt/frontail directory ( can be deleted later if you really would like to get rid off it )
  • remove three lines from runtime.cfg file ( lines contain the string frontail )
1 Like

Because i’m scared. My system has been upated from OH 2 onwards until now.

Basically same for me.

openhabian@openhabian:/var/lib $ ls -ld /usr/lib/node_modules/frontail
lrwxrwxrwx 1 root root 21 Sep 26 17:53 /usr/lib/node_modules/frontail -> ../../../opt/frontail

But will i, or lets say openhabian-config then correctly reinstall if i trigger it via the menu 20?

I expect it to work. What could happen is that the underlying nodejs will be installed in a newer version. Its dependencies might not be compatible with frontail resp. its required npm modules.
But this is nothing that can be influenced by using the menu.

If you have a tested backup (i.e. you know how to restore from it and you’ve shown it to be complete), that fear can go away. If things blow up you are only out a little bit of time to go back to where you started.

Limping along patching this existing system is probably something to fear more than starting fresh and importing.

If you don’t have a backup than that’s really something to make you afraid and you shouldn’t even be contemplating mucking around with the system.

Definitely so!

That’s a variant of the XY problem then here. You’re asking for a solution to a wrongly defined problem.

On a Pi it’s soooo much easier and - unlike what you’re asking for here so far- without(!) risk to install a second fresh system on another SD card and just try.
You can fall back to the old card at any time.

Good Morning All,

Yes, i do on weekly base with:

 $OPENHAB_RUNTIME/bin/backup

I would argue that the problem statement of having an option to purge frontail and reinstall is not given yet. The why can have multiple reasons, agree.

yes that was just my idea, to get a fresh installation on another sdcard and transfer the backup there.

And once backup is through on new sd card i will defintiely check this out to have a conclusion.

openhabian-config uses these lines of code

  frontailBase="$(npm list -g | head -n 1)/node_modules/frontail"

  if ! (id -u ${frontailUser} &> /dev/null || cond_redirect useradd --groups "${username:-openhabian}",openhab -s /bin/bash -d /var/tmp ${frontailUser}); then echo "FAILED (adduser)"; return 1; fi

  echo -n "$(timestamp) [openHABian] Installing openHAB Log Viewer (frontail)... "
  if [[ -d $frontailBase ]]; then
    cond_echo "Removing any old installations... "
    cond_redirect npm uninstall -g frontail
  fi

This is part of the openhabian-code that installs frontail. Before the installation is done it is checked if frontail is already installed. In case it is installed it will be removed before installing it again.
So the command to deinstall frontail on command line using npm would be: npm uninstall -g frontail
Knowing the location where is is installed ( see the other post ) you can check if it is removed.

You don’t. This will only backup the OH config but not the system.
But it’s the OS, the system under and around OH you’re putting at risk when messing with frontail. Or any of the upgrades you have made.
XY again.

Yes but that was the idea, no? To backup OH config and transfer to a newly created openhabian image on a new card.

It’s one way of exporting the OH config, yes (btw there’s a menu option, too).
Name it initial.zip and put it on the boot partition before you boot from your fresh SD to get it auto-imported on install.
However you said you use this to backup your system, that’s what my response was to.
You don’t backup your system so today you will have no means of restoring it should your attempts to remove frontail cause any damage.

Ok i get your point. Thanks for clarification.
Re initial.zip: so that means if i copy it to boot, it picks it up automatically on reboot?
I would have copied it to /var/lib/openhab/backups and used menu 51.

Many roads lead to Rome.

Not what I meant. Like @mstormi said, you are mucking around with your operating system. You have a non-zero chance that something will go wrong and you’ll end up with a non-bootable SD card. If that happens, you’ll want a backup of the whole SD card so you can simply plug in that card and try again, taking note not to do what you just did to ruin the system the first time.

If you have a full backup of the whole system that is tested and known to be complete and uncorrupted, you are free to experiment with abandon. If you destroy everything, you are only a quick SD card swap away from being back where you started.

Fully agrree, and that was actually my approach. So i basically created a new sd card and imported the latest backup to it via openhabian-config.

@mstormi

Name it initial.zip and put it on the boot partition before you boot from your fresh SD to get it auto-imported on install.

This approach didnt work for me. But maybe it applies only for first boot up after creating sd card.

In any case, it worked for me via restore functionality. So for the moment it is working and also the frontail is back on track.

Thanks all for all your support!

I said so, didn’t I.

You did! And after reading it three times, i also finally got it. Sorry

Because I’m a masochist :smiley: How can I install that shiny Frontail. I didn’t found documentation anywhere.

My use case: I develop add-on with IntelliJ (because unable to get Eclipse working after 3 days). I’ve downloaded OH 4.1 snapshot to my Windows 10, unzipped it and running it using start.bat. I like to view the logs at the same time as I give commands to OH in console (so I can’t run log:tail at the same time).

Everything works like a charm in openHabian, but my dev env is Windows. Or should I install openHabian on virtual machine in my Windows PC and use that as an test environment?

It would be far easier to use powershell to tail the logs. See How to watch and look through logging which has both Linux and Windows commands. Or you can tail the logs from an WSL2 terminal.

Beyond that, Frontail is a third party service so details on how to install it on Windows can be found at Frontail’s sites.

1 Like

Yep. I would. I do in fact.

2 Likes