[Nut-upsuser] Running NUT within an unprivileged LXD container?

Linus Lüssing linus.luessing at c0d3.blue
Mon Jul 18 02:09:25 BST 2022


On Mon, Jul 18, 2022 at 02:29:18AM +0200, Linus Lüssing wrote:
> Hi,
> 
> I'm trying to set up NUT within an unprivileged LXD container.
> So within the container there is its own user namespace with
> a root user with UID 0, which does not actually have overall
> system root rights.
> 
> Both the host and the container run Debian Bullseye.
> NUT is version 2.7.4-13.
> [...]

PS: During installation of NUT via apt in the container I got some
errors, leaving the package in an uncompleted state. Not sure if
they would matter (other than being a bit annoying for future
use of apt, as apt now continously complains). Other than that
generally all files from the NUT installation seem to be there.

```
root at nut:~# apt-get install nut-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  bash-completion libltdl7 libnspr4 libnss3 libnutscan1 libsqlite3-0 libupsclient4 libusb-0.1-4 nut-client
Suggested packages:
  nut-monitor nut-cgi nut-ipmi nut-snmp nut-xml
The following NEW packages will be installed:
  bash-completion libltdl7 libnspr4 libnss3 libnutscan1 libsqlite3-0 libupsclient4 libusb-0.1-4 nut-client nut-server
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 4191 kB of archives.
After this operation, 14.2 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://deb.debian.org/debian bullseye/main arm64 libnspr4 arm64 2:4.29-1 [105 kB]
Get:2 http://deb.debian.org/debian bullseye/main arm64 libsqlite3-0 arm64 3.34.1-3 [750 kB]
Get:3 http://deb.debian.org/debian bullseye/main arm64 libnss3 arm64 2:3.61-1+deb11u2 [1210 kB]
Get:4 http://deb.debian.org/debian bullseye/main arm64 libupsclient4 arm64 2.7.4-13 [186 kB]
Get:5 http://deb.debian.org/debian bullseye/main arm64 nut-client arm64 2.7.4-13 [249 kB]
Get:6 http://deb.debian.org/debian bullseye/main arm64 libltdl7 arm64 2.4.6-15 [390 kB]
Get:7 http://deb.debian.org/debian bullseye/main arm64 libnutscan1 arm64 2.7.4-13 [191 kB]
Get:8 http://deb.debian.org/debian bullseye/main arm64 libusb-0.1-4 arm64 2:0.1.12-32 [21.5 kB]
Get:9 http://deb.debian.org/debian bullseye/main arm64 nut-server arm64 2.7.4-13 [855 kB]
Get:10 http://deb.debian.org/debian bullseye/main arm64 bash-completion all 1:2.11-2 [234 kB]
Fetched 4191 kB in 3s (1217 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libnspr4:arm64.
(Reading database ... 14573 files and directories currently installed.)
Preparing to unpack .../0-libnspr4_2%3a4.29-1_arm64.deb ...
Unpacking libnspr4:arm64 (2:4.29-1) ...
Selecting previously unselected package libsqlite3-0:arm64.
Preparing to unpack .../1-libsqlite3-0_3.34.1-3_arm64.deb ...
Unpacking libsqlite3-0:arm64 (3.34.1-3) ...
Selecting previously unselected package libnss3:arm64.
Preparing to unpack .../2-libnss3_2%3a3.61-1+deb11u2_arm64.deb ...
Unpacking libnss3:arm64 (2:3.61-1+deb11u2) ...
Selecting previously unselected package libupsclient4:arm64.
Preparing to unpack .../3-libupsclient4_2.7.4-13_arm64.deb ...
Unpacking libupsclient4:arm64 (2.7.4-13) ...
Selecting previously unselected package nut-client.
Preparing to unpack .../4-nut-client_2.7.4-13_arm64.deb ...
Unpacking nut-client (2.7.4-13) ...
Selecting previously unselected package libltdl7:arm64.
Preparing to unpack .../5-libltdl7_2.4.6-15_arm64.deb ...
Unpacking libltdl7:arm64 (2.4.6-15) ...
Selecting previously unselected package libnutscan1:arm64.
Preparing to unpack .../6-libnutscan1_2.7.4-13_arm64.deb ...
Unpacking libnutscan1:arm64 (2.7.4-13) ...
Selecting previously unselected package libusb-0.1-4:arm64.
Preparing to unpack .../7-libusb-0.1-4_2%3a0.1.12-32_arm64.deb ...
Unpacking libusb-0.1-4:arm64 (2:0.1.12-32) ...
Selecting previously unselected package nut-server.
Preparing to unpack .../8-nut-server_2.7.4-13_arm64.deb ...
Unpacking nut-server (2.7.4-13) ...
Selecting previously unselected package bash-completion.
Preparing to unpack .../9-bash-completion_1%3a2.11-2_all.deb ...
Unpacking bash-completion (1:2.11-2) ...
Setting up libsqlite3-0:arm64 (3.34.1-3) ...
Setting up libusb-0.1-4:arm64 (2:0.1.12-32) ...
Setting up libnspr4:arm64 (2:4.29-1) ...
Setting up bash-completion (1:2.11-2) ...
Setting up libltdl7:arm64 (2.4.6-15) ...
Setting up libnutscan1:arm64 (2.7.4-13) ...
Setting up libnss3:arm64 (2:3.61-1+deb11u2) ...
Setting up libupsclient4:arm64 (2.7.4-13) ...
Setting up nut-client (2.7.4-13) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nut-monitor.service → /lib/systemd/system/nut-monitor.service.
Job for nut-monitor.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status nut-monitor.service" and "journalctl -xe" for details.
Setting up nut-server (2.7.4-13) ...
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-0:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-0:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.2/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.2/2-2.2:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.3/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.3/2-2.3:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.1/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.1/2-2.4.1:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.2/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.2/2-2.4.2:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.3/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.3/2-2.4.3:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.4/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4.4/2-2.4.4:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2.4/2-2.4:1.0/uevent': Permission denied
Failed to write 'change' to '/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2:1.0/uevent': Permission denied
dpkg: error processing package nut-server (--configure):
 installed nut-server package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.31-13+deb11u3) ...
Errors were encountered while processing:
 nut-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
root at nut:~#
```



More information about the Nut-upsuser mailing list