uhppoted / uhppoted-httpd

Browser based user interface for an access control system based on the UHPPOTE TCP/IP controllers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run as service on RPI.

KingSteve032 opened this issue · comments

I'm unable to run this as a service. This is the error I get when trying so. When running it with the normal ./uhppoted-httpd --console command it runs fine but when running it as that the default login does not work.

Jul 05 16:06:11 itisasecret systemd[1]: Started UHPPOTE UTO311-L0x access card controllers HTTPD service/daemon.
Jul 05 16:06:11 itisasecret uhppoted-httpd[1685]: 2022/07/05 16:06:11 uhppoted-httpd service v0.8.0 - Linux (PID 1685)
Jul 05 16:06:11 itisasecret uhppoted-httpd[1685]: ERROR: Error checking PID lockfile '/var/uhppoted/uhppoted-httpd.pid' (stat /var/uhppoted/uhppoted-httpd.pid: permission denied)
Jul 05 16:06:11 itisasecret systemd[1]: uhppoted-httpd.service: Main process exited, code=exited, status=1/FAILURE
Jul 05 16:06:11 itisasecret systemd[1]: uhppoted-httpd.service: Failed with result 'exit-code'.

Hi,

I'm going to go out on a limb and guess that you were running it in console mode as root which means there's a good chance the /var/uhppoted folder and/or the /var/uhppoted/uhppoted-httpd.pid file are owned by root. By default the service runs under the account uhppoted so it may not have write permissions to either /var/uhppoted or /var/uhppoted/uhppoted-httpd.pid

  1. Check the permissions on /var/uhppoted:
sudo ls -la /var | grep uhppoted
  1. Check the permissions on /var/uhppoted/uhppoted-httpd.pid:
sudo ls -la /var/uhppoted/uhppoted-httpd.pid

In both cases the user:group should be uhppoted:uhppoted i.e. something like:

drwxr-xr-x  10 uhppoted  uhppoted  320 Jul  4 11:24 uhppoted
drwxr-xr-x  10 uhppoted  uhppoted  320 Jul  4 11:24 /var/uhppoted/uhppoted-httpd.pid

If not you need to update the permissions:

sudo chown -R uhppoted:uhppoted /var/uhppoted

You may also need to update the permissions on /etc/uhppoted:

sudo chown -R uhppoted:uhppoted /etc/uhppoted

If that doesn't solve the problem let me know and I'll dig into a bit more.

Yep I that fixed it. Thank you!

Oh great!! Thanks for letting me know :-)