buumann
(Martin)
September 25, 2018, 9:38pm
5
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.
vzorglub
(Vincent Regaud)
September 26, 2018, 6:09am
6
When you log in your ubuntu device, what is your username
Can you show me the service status?
1 Like
buumann
(Martin)
September 26, 2018, 6:31am
7
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.
vzorglub
(Vincent Regaud)
September 26, 2018, 6:32am
8
Can you post your .service file, please?
1 Like
buumann
(Martin)
September 26, 2018, 7:04am
9
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
vzorglub
(Vincent Regaud)
September 26, 2018, 7:07am
10
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
buumann
(Martin)
September 26, 2018, 7:12am
11
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#
vzorglub
(Vincent Regaud)
September 26, 2018, 7:24am
13
Why are you working in root?
Try to avoid that, it is quite dangerous
1 Like
buumann
(Martin)
September 26, 2018, 7:27am
14
I switched back to user
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.
vzorglub
(Vincent Regaud)
September 26, 2018, 8:11am
15
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
buumann
(Martin)
September 26, 2018, 8:38am
16
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
vzorglub
(Vincent Regaud)
September 26, 2018, 10:50am
17
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
Benjy
(Ben Clark)
September 26, 2018, 11:29am
18
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
buumann
(Martin)
September 26, 2018, 11:51am
19
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'.
buumann
(Martin)
September 26, 2018, 2:01pm
21
yep, it is installed via “apt-get install nodejs”
buumann
(Martin)
September 26, 2018, 2:23pm
22
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
Don’t know if you solved this, but you need to use frontail
with --url-path /frontail
for it to work through nginx