Hi,
I am trying to allow an unprivileged container to communicate with my APC UPS using apcupsd.
I have modified my conf file and added the two following lines :
On the host (after changing owner and group) :
In the container :
Still :
STATUS : COMMLOST shows that the daemon cannot communicate with the UPS.
As you can see or guess, I am stuck ;-)
I am trying to allow an unprivileged container to communicate with my APC UPS using apcupsd.
I have modified my conf file and added the two following lines :
Code:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001/006 dev/bus/usb/001/006 none bind,optional,create=file
On the host (after changing owner and group) :
Code:
ls -l /dev/bus/usb/001/006
crw-rw---- 1 100000 100000 189, 5 May 1 06:10 /dev/bus/usb/001/006
In the container :
Code:
# ls -l /dev/bus/usb/001/006
crw-rw---- 1 root root 189, 5 May 1 06:10 /dev/bus/usb/001/006
Still :
Code:
# apcaccess
APC : 001,018,0436
DATE : 2021-05-01 08:28:20 +0200
HOSTNAME : m1
VERSION : 3.14.14 (31 May 2016) debian
UPSNAME : APC750
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2021-05-01 08:28:05 +0200
STATUS : COMMLOST
MBATTCHG : 5 Percent
MINTIMEL : 10 Minutes
MAXTIME : 0 Seconds
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
STATFLAG : 0x05000100
END APC : 2021-05-01 08:33:00 +0200
STATUS : COMMLOST shows that the daemon cannot communicate with the UPS.
Code:
# systemctl status apcupsd
* apcupsd.service - UPS power management daemon
Loaded: loaded (/lib/systemd/system/apcupsd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-05-01 08:28:05 CEST; 6min ago
Docs: man:apcupsd(8)
Process: 1615 ExecStartPre=/lib/apcupsd/prestart (code=exited, status=0/SUCCESS)
Process: 1619 ExecStart=/sbin/apcupsd (code=exited, status=0/SUCCESS)
Main PID: 1620 (apcupsd)
Tasks: 4 (limit: 4915)
Memory: 840.0K
CGroup: /system.slice/apcupsd.service
`-1620 /sbin/apcupsd
May 01 08:28:05 m1 systemd[1]: Starting UPS power management daemon...
May 01 08:28:05 m1 systemd[1]: apcupsd.service: Can't open PID file /run/apcupsd.pid (yet?) after start: No such file or directory
May 01 08:28:05 m1 apcupsd[1620]: apcupsd 3.14.14 (31 May 2016) debian startup succeeded
May 01 08:28:05 m1 systemd[1]: Started UPS power management daemon.
May 01 08:28:15 m1 apcupsd[1620]: NIS server startup succeeded
May 01 08:29:15 m1 apcupsd[1620]: Communications with UPS lost.
As you can see or guess, I am stuck ;-)