Unable to install frontail on fresh install OH 4

Use this script:

	curl -fsSL "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" | gpg --dearmor > /usr/share/keyrings/nodesource.gpg
	echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list
	apt-get install --yes nodejs

	#NPM
	apt-get install --yes npm

	#FRONTAIL
	useradd --groups *yourUserHere*,openhab -s /bin/bash -d /var/tmp frontail
	mkdir -p /usr/local/lib/node_modules/frontail
	git clone https://github.com/Interstellar0verdrive/frontail_AEM.git /usr/local/lib/node_modules/frontail
	cd /usr/local/lib/node_modules/frontail
	npm audit fix --omit=dev
	npm update --audit=false --omit=dev
	cp frontail.service /etc/systemd/system/frontail.service
	chmod 644 /etc/systemd/system/frontail.service

file frontail.service:

[Unit]
Description=Frontail openHAB instance, reachable at http://%H:9001
Documentation=https://github.com/mthenw/frontail
After=openhab.service
PartOf=openhab.service

[Service]
Type=simple
ExecStart=/usr/local/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight --ui-highlight-preset /usr/local/lib/node_modules/frontail/preset/openhab_AEM.json --theme openhab_AEM --lines 2000 --number 200 /var/log/openhab/openhab.log /var/log/openhab/events.log
Restart=always
User=frontail
Group=openhab
Environment=PATH=/usr/local/bin:/usr/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/bin/

[Install]
WantedBy=multi-user.target

Make sure you uninstall all components before

1 Like

Would yourUserHere be frontail (as in the frontail.service file)?

#FRONTAIL
	useradd --groups *yourUserHere*,openhab -s /bin/bash -d /var/tmp frontail

so finally

useradd --groups frontail,openhab -s /bin/bash -d /var/tmp frontail

??

no, your openhabian account name. If you haven‘t provided a different name during startup, choose openhabian.

Hi there,
success although not 100% like proposed.
Did run the script,

sudo sh myscript.sh
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
N: Ignoring file 'nodesource.list
   ' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Unable to locate package nodejs
: not found: 4:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
N: Ignoring file 'nodesource.list
   ' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Unable to locate package npm
: not found: 7:
'seradd: invalid user name 'frontail
fatal: destination path '/usr/local/lib/node_modules/frontail?' already exists and is not an empty directory.
myscript.sh: 13: npm: not found
myscript.sh: 14: npm: not found
cp: cannot stat 'frontail.service': No such file or directory
chmod: cannot access '/etc/systemd/system/frontail.service'$'\r': No such file or directory

there were some issues (probably I should have copied frontail.service upfront) but there were other things as well as I understood the output. Therefore tried step by step and installed
manually nodejs as proposed earlier in the thread

 sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 25.9 MB of archives.
After this operation, 177 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_18.x bullseye/main armhf nodejs armhf 18.17.1-deb-1nodesource1 [25.9 MB]
Fetched 25.9 MB in 3s (7,973 kB/s)
N: Ignoring file 'nodesource.list
   ' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
Selecting previously unselected package nodejs.
(Reading database ... 64909 files and directories currently installed.)
Preparing to unpack .../nodejs_18.17.1-deb-1nodesource1_armhf.deb ...
Unpacking nodejs (18.17.1-deb-1nodesource1) ...
Setting up nodejs (18.17.1-deb-1nodesource1) ...
Processing triggers for man-db (2.9.4-2) ...
Updating FireMotD available updates count ...
N: Ignoring file 'nodesource.list
   ' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

and afterwards went again to openhabian-config option 21.

Now it works. Thanks a lot for your help and patience. Its really hard for “non Linux guys” to deal with that “basic” stuff.

the problem was that you probably used Windows to create the script file. Windows eol characters are different from unix. Simply open the script with a Linux editor and convert it or save it under linux character set would have done the job.
But glad it is working now for you.

Hi,
I also lost Frontail during a fresh install of OH (4.1.1) on an RPi4B.
Installation and Restore seems OK (using Win 10 Notepad as a bad Frontail replacement).

Is Frontail removed permanently from openhabian as of OH 4.1.1 (openhabian1.8c-pi-raspios32-202402051947-git4f124c2-crc903d2975.img.xz) or by a mistake?
Will it return or will there be a replacement??
openhabian really needs a log viewer, so what is the thinking here?
Bjorn

It’s not removed. Use the openhabian-config 1X menu to set it up.

Thanks Markus,
I checked 1X but frontail is not mentioned on the 1X front page, so what number X relates to frontail?
I hesitate to run all 1X options to find out.
Bjorn

1x was off top of head

it’s 21

Markus,
Sorry, but 21 throws an error at me saying frontail not installed, which I know.
21 is about adding a log file not installing frontail so, how do I gain access to frontail was the initial question, and why not part of openhabian any more?
Bjorn

Hi,
I use Oliver2 script

curl -fsSL "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" | gpg --dearmor > /usr/share/keyrings/nodesource.gpg
	echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list
	apt-get install --yes nodejs
	apt-get install --yes npm

Then openhabian-config (20 - Optional Components)

or You can install Openhabian 1.9 there is no problem with npm.

No, the first of those three “21” options will install frontail.
It was never “not part of openhabian”.
If that doesn’t work for you, set debugmode=maximum in openhabian.conf and go debug to find out.

Or reinstall using release v1.9 that’s about to get released anyway.

OK. I’ll wait for1.9 to be released.
Thanks,
Bjorn

I’ve finally installed 1.9 successfully and frontail is present. Thanks!

But, OH4 frontail now contains far more events.log entries than OH3.
One difference is that OH4 frontail now seems to enter parameter values that do not change, thereby building a longer events.log and causing frontail to display a shorter time span.
Is there an easy way to return to the OH3 frontail setup/configuration?

Depending on how you did it either during the upgrade you opted to keep your modified version of log4j2.xml and therefore didn’t get the latest version of the file or you restored your 3.x configs over the 4.x instance wiping out the changes to the logging configs.

You can edit the file and add the following two lines near the bottom:

                <Logger level="ERROR" name="openhab.event.ItemStateUpdatedEvent"/>
                <Logger level="ERROR" name="openhab.event.GroupStateUpdatedEvent"/>

Or you can set the level of these loggers to ERROR through the karaf console.

Hi,
I have openhabian 1.9 (OH4.1.2) with frontail running now, but the timestamp in the events.log entries are all 1 hr off. I have selected the proper regional settings with a time zone being Europe/Oslo.
Seems like summer savings is ignored.
Can that be confirmed and fixed by anyone.

I also tried installing Tailscale without success.

Log says:
2024-04-25_15:11:42_CEST [openHABian] Installing tailscale VPN...
2024-04-25_15:11:42_CEST [openHABian] Adding required keys to apt... gpg: no valid OpenPGP data found.
FAILED
# Tailscale packages for raspbian bookworm
deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/raspbian bookworm main
FAILED (update apt lists)

Is there a fix here?
B

check the time settings on the Pi

Thanks,
Well, I guess I could, but it shouldn’t be necessary.
openhabian and OH time zone selection has always done this, so I think it should be fixed. 1.9 was released just a few weeks ago.
B

Thanks for the detailed installation description. :+1:

I ran it all and encountered one minor problem. The file frontail.service does not exist for the cp command.
I updated my documentation by saying:

    npm update --audit=false --omit=dev
    # create the fontail.service file as per below, then...`
    cp frontail.service /etc/systemd/system/frontail.service

I am not sure, if it was necessary at the end:
systemctl start frontail.service
systemctl enable frontail.service to make it permanent, or the frontail.serives file takes care of this at reboot.

In any case, it is working :slight_smile: