[SOLVED] Logview on ubuntu

What does is your linux username?
Replace pi in the service file with your linux username

Where did npm install frontail for you?
The preset directory is in there

1 Like

Hi,

first, i want to fix error to start frontail service. I have changed the user and group to openhab.
And fixed the path in frontail.service to /usr/local/bin.
But the service did not start with code 127.

I can start it with “/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/openhab.log”
and the service is running.

Can you help to debug.

When you log in your ubuntu device, what is your username
Can you show me the service status?

1 Like

My username is “user”.
Here is the the output:

user@ubuntu-18-openhab2:~$ systemctl status frontail
● frontail.service - Frontail
Loaded: loaded (/etc/systemd/system/frontail.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-09-26 06:28:47 UTC; 1min 47s ago
Process: 13075 ExecStart=/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/openhab.log /
Main PID: 13075 (code=exited, status=127)

Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: frontail.service: Main process exited, code=exited, status
Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: frontail.service: Failed with result ‘exit-code’.
Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: frontail.service: Service hold-off time over, scheduling r
Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: frontail.service: Scheduled restart job, restart counter i
Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: Stopped Frontail.
Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: frontail.service: Start request repeated too quickly.
Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: frontail.service: Failed with result ‘exit-code’.
Sep 26 06:28:47 ubuntu-18-openhab2 systemd[1]: Failed to start Frontail.

Can you post your .service file, please?

1 Like

frontail.service file contains:

[Unit]
Description=Frontail

[Service]
ExecStart=/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/open$
Restart=always
User=openhab
Group=openhab
Environment=PATH=/usr/local/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/local/bin/

[Install]
WantedBy=multi-user.target
Alias=frontail.service

change openhab to user

then

sudo chmod 644 /lib/systemd/system/frontail.service
sudo systemctl daemon-reload
sudo systemctl stop fronttail.service
sudo systemctl enable frontail.service
sudo systemctl start frontail.service
1 Like

i changed from openhab to user, here the output:

root@ubuntu-18-openhab2:/lib/systemd/system# nano frontail.service root@ubuntu-18-openhab2:/lib/systemd/system# sudo chmod 644 /lib/systemd/system/ frontail.service
root@ubuntu-18-openhab2:/lib/systemd/system# sudo systemctl daemon-reload
root@ubuntu-18-openhab2:/lib/systemd/system# sudo systemctl stop fronttail.servi ce
Failed to stop fronttail.service: Unit fronttail.service not loaded.
root@ubuntu-18-openhab2:/lib/systemd/system# sudo systemctl enable frontail.serv ice
Failed to enable unit: File /etc/systemd/system/frontail.service already exists.
root@ubuntu-18-openhab2:/lib/systemd/system# sudo systemctl start frontail.servi ce
root@ubuntu-18-openhab2:/lib/systemd/system#

Look good
Does it work?

1 Like

Why are you working in root?
Try to avoid that, it is quite dangerous

1 Like

I switched back to user :slightly_smiling_face:
but the service did not start:

● frontail.service - Frontail
Loaded: loaded (/etc/systemd/system/frontail.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-09-26 09:26:34 CEST; 8s ago
Process: 1786 ExecStart=/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/openhab.log /var/log/openha
Main PID: 1786 (code=exited, status=127)

Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: frontail.service: Main process exited, code=exited, status=127/n/a
Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: frontail.service: Failed with result ‘exit-code’.
Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: frontail.service: Service hold-off time over, scheduling restart.
Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: frontail.service: Scheduled restart job, restart counter is at 5.
Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: Stopped Frontail.
Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: frontail.service: Start request repeated too quickly.
Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: frontail.service: Failed with result ‘exit-code’.
Sep 26 09:26:34 ubuntu-18-openhab2 systemd[1]: Failed to start Frontail.

Ok, try to use the code fences, please

Change the frontail.service file:
I have changes the last lines in the [Service] section

[Unit]
Description=Frontail

[Service]
ExecStart=/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/open$
Restart=always
User=openhab
Group=openhab
Environment=PATH=/usr/local/bin/frontail
Environment=NODE_ENV=production
WorkingDirectory=/usr/local/bin/frontail

[Install]
WantedBy=multi-user.target
Alias=frontail.service
1 Like

i changed the file, and do reboot, but same problem.
here the service

[Unit]
Description=Frontail

[Service]
ExecStart=/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/openhab.log /var/log/openhab2/events.log
Restart=always
User=user
Group=user
Environment=PATH=/usr/local/bin/frontail
Environment=NODE_ENV=production
WorkingDirectory=/usr/local/bin/frontail

[Install]
WantedBy=multi-user.target
Alias=frontail.service

i use the newest ubuntu server 18.04.01 lts

Sorry. But I don’t know anymore
My set-up is exactly as your Ubuntu Server 18.04.01 lts
And apart from the directory it is the same as yours

1 Like

I’ve not used fronttail, but you may get more information about the error using the command:

sudo journalctl -u fronttail.service -b

The latest attempt at startup would be at the bottom.

1 Like

thanks, for the command, i find that the

Environment=PATH=/usr/local/bin/frontail
and
WorkingDirectory=/usr/local/bin/frontail

did not exist, i changed it back to:

Environment=PATH=/usr/local/bin/frontail

WorkingDirectory=/usr/local/bin/frontail

After that, the log shows a problem with the env/ node:

Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: Stopped Frontail.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: Started Frontail.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Main process exited, code=exited, status=127/n/a
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Failed with result 'exit-code'.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Service hold-off time over, scheduling restart.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Scheduled restart job, restart counter is at 4.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: Stopped Frontail.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: Started Frontail.
Sep 26 13:43:09 ubuntu-18-openhab2 frontail[848]: /usr/bin/env: ‘node’: No such file or directory
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Main process exited, code=exited, status=127/n/a
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Failed with result 'exit-code'.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Service hold-off time over, scheduling restart.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Scheduled restart job, restart counter is at 5.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: Stopped Frontail.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Start request repeated too quickly.
Sep 26 13:43:09 ubuntu-18-openhab2 systemd[1]: frontail.service: Failed with result 'exit-code'.

did you install nodejs?

1 Like

yep, it is installed via “apt-get install nodejs”

I found the sulution, the directorys are failed,
here is the working fontail.service:

[Unit]
Description=Frontail

[Service]
ExecStart=/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/openhab.log /var/log/openhab2/events.log
Restart=always
User=user
Group=user
Environment=PATH=/usr/local/bin/frontail
Environment=NODE_ENV=production
WorkingDirectory=/usr/local/bin/frontail

[Install]
WantedBy=multi-user.target
Alias=frontail.service

Thanks very much to the community to find the Solution!!!

Hi All

I can get this to start and display the logs with the config below, but there is no working directory or environment paths because I just could not get the darn thing to start with the entires above. What are they needed for? Using NGINX I cannot get to http://192.168.0.3/frontail


}
location /frontail/ {
    proxy_pass http://localhost:9001;
    proxy_set_header Host                   $http_host;
    proxy_set_header X-Real-IP              $remote_addr;
    proxy_set_header X-Forwarded-For        $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto      $scheme;
}


[Unit]
Description=Frontail

[Service]
ExecStart=/usr/local/bin/frontail --ui-highlight -t dark /var/log/openhab2/openhab.log /var/log/openhab2/events.log /var/log/openhab2/zwave.log
Restart=always
User=openhab
Group=openhab

[Install]
WantedBy=multi-user.target
Alias=frontail.service