<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ingrate+one</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ingrate+one"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Ingrate_one"/>
	<updated>2026-05-09T22:51:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Podman&amp;diff=32441</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Podman&amp;diff=32441"/>
		<updated>2026-05-05T14:32:54Z</updated>

		<summary type="html">&lt;p&gt;Ingrate one: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://podman.io/ Podman] is a utility provided as part of the libpod library. It can be used to create and maintain containers. Podman (Pod Manager) is a fully featured container engine that is a simple daemonless tool. In Alpine linux, [[Distrobox]] automatically installs and uses Podman.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Podman can be installed via {{Pkg|podman}} package in the community repository: {{Cmd|# apk add podman}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
To run podman with full functionality you&#039;ll need to enable the [[OpenRC#cgroups|cgroups]] service in v2 or &#039;&#039;&#039;unified&#039;&#039;&#039; mode, which is the current default. {{Cmd|&amp;lt;nowiki&amp;gt;# rc-update add cgroups&lt;br /&gt;
# rc-service cgroups start&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The default storage driver setting in {{Path|/etc/containers/storage.conf}} is {{ic|overlay}}. If you&#039;re running podman inside a container or using [[Btrfs]] filesystem, change the storage driver to {{ic|vfs}} or {{ic|btrfs}} respectively. &lt;br /&gt;
&lt;br /&gt;
You might need to restart your machine at this stage for the above changes to work properly.&lt;br /&gt;
&lt;br /&gt;
=== Running as root ===&lt;br /&gt;
&lt;br /&gt;
No further steps are required to run as root. Run an example container to verify everything works: {{Cmd|# podman run --rm hello-world}}&lt;br /&gt;
&lt;br /&gt;
=== Running in rootless mode ===&lt;br /&gt;
&lt;br /&gt;
To avoid [[#Permission problems with rootless podman|permission problems]] with rootless podman, consider using [[runc#Crun|Crun]].&lt;br /&gt;
&lt;br /&gt;
To run podman in rootless mode, run the following commands. Replace &amp;lt;USER&amp;gt; with your username in the following commands: {{Cmd|&amp;lt;nowiki&amp;gt;# modprobe tun&lt;br /&gt;
# echo tun &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
# echo &amp;lt;USER&amp;gt;:100000:65536 &amp;gt;/etc/subuid&lt;br /&gt;
# echo &amp;lt;USER&amp;gt;:100000:65536 &amp;gt;/etc/subgid &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Run an example container to verify everything works: {{Cmd|$ podman run --rm hello-world}}&lt;br /&gt;
&lt;br /&gt;
=== Getting socket ===&lt;br /&gt;
&lt;br /&gt;
To use the podman API or use podman remotely, you need podman socket. Socket is not needed, if podman CLI is used locally.&lt;br /&gt;
To get socket, start the podman service: {{Cmd|# rc-service podman start}}&lt;br /&gt;
The default location of the socket is {{Path|/run/podman/podman.sock}}&lt;br /&gt;
&lt;br /&gt;
=== Shared mount ===&lt;br /&gt;
&lt;br /&gt;
Containers on linux might require filesystems to be mounted with different propagation than the kernel default of &#039;private&#039;.  &lt;br /&gt;
{{Cmd|$ findmnt -o PROPAGATION /}} will produce the following output:&lt;br /&gt;
 PROPAGATION&lt;br /&gt;
 private&lt;br /&gt;
&lt;br /&gt;
This section explains few ways to mount your root(&#039;&#039;&#039;/&#039;&#039;&#039;) as shared for Distrobox to function. This is not needed when running in rootless mode. &lt;br /&gt;
&lt;br /&gt;
Method1:&lt;br /&gt;
Fill in the file {{path|/etc/local.d/mount-rshared.start}} as follows:{{Cat|/etc/local.d/mount-rshared.start|&amp;lt;nowiki&amp;gt;#!/bin/sh&lt;br /&gt;
mount --make-rshared /&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Mark it as executable:  {{cmd|# chmod +x /etc/local.d/mount-rshared.start}}&lt;br /&gt;
&lt;br /&gt;
Then enable the service to autostart through [[OpenRC]]. {{cmd|&amp;lt;nowiki&amp;gt;# rc-update add local default&lt;br /&gt;
# rc-service local start &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Method2: &lt;br /&gt;
An alternate solution with OpenRC v0.54.2-r1 onwards, edit the file {{path|/etc/fstab}} and add {{ic|shared}} option to the root partition such that:{{Cat|/etc/fstab|...&lt;br /&gt;
/dev/sda2 / ext4 rw,relatime,shared 0 1&lt;br /&gt;
...}}&lt;br /&gt;
&lt;br /&gt;
For both the above cases, after a reboot test the working of shared &#039;&#039;&#039;/&#039;&#039;&#039; mount using the command: {{Cmd|# findmnt -o PROPAGATION /}} which will produce the following output:&lt;br /&gt;
 PROPAGATION&lt;br /&gt;
 shared&lt;br /&gt;
&lt;br /&gt;
=== Docker compose ===&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|podman-compose}} package from provides a drop-in replacement for docker compose.  Each time a docker compose is used, a warning will remind that this is using podman under the hood. This warning can be squelched permanently by running: {{cmd|# touch /etc/containers/nodocker}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
===  &amp;quot;/&amp;quot; is not a shared mount ===&lt;br /&gt;
&lt;br /&gt;
If you see a warning:&lt;br /&gt;
: WARN[0000] &amp;quot;/&amp;quot; is not a shared mount, this could cause issues or missing mounts with rootless containers &lt;br /&gt;
&lt;br /&gt;
You might want to fix this temporarily, for currently running system by issuing the command:{{ic|# mount --make-rshared /}}&lt;br /&gt;
Alternately, refer to [[#Shared mount|Shared mount]] section for permanent solution(s).&lt;br /&gt;
&lt;br /&gt;
=== Permission problems with rootless podman ===&lt;br /&gt;
&lt;br /&gt;
You may encounter an error when entering your rootless container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Error: unable to start container &amp;quot;XYZ&amp;quot;: runc: runc create failed: unable to start container process: unable to apply cgroup configuration: rootless needs no limits + no cgrouppath when no permission is granted for cgroups: mkdir /sys/fs/cgroup/XYZ: permission denied: OCI permission denied&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This problem may be solved by replacing [[runc|runc]] by [[runc#Crun|Crun]] and recreating your container. Keep in mind that {{Pkg|crun}} replaces {{Pkg|runc}}, which will render containers made with the latter unusable until recreated.&lt;br /&gt;
&lt;br /&gt;
=== Error: netavark: iptables: No such file or directory (os error 2) ===&lt;br /&gt;
&lt;br /&gt;
Podman depends on {{Pkg|iptables}} package:&lt;br /&gt;
{{cmd|# apk add iptables}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.podman.io/en/latest/ Official Podman Documentation]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Ingrate one</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Nut-ups&amp;diff=32333</id>
		<title>Nut-ups</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Nut-ups&amp;diff=32333"/>
		<updated>2026-04-17T08:25:39Z</updated>

		<summary type="html">&lt;p&gt;Ingrate one: Add information for setup of network server/clients includes the following configuration files nut.conf, upsd.users and mupsmon.conf. Finally to perform Live shutdown to hosts with matching users and ups fields.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page shows how to install and configure the Network UPS Tools (NUT) package to monitor and report the statistics for a USB-attached Uninterruptible Power Supply (UPS) and make the UPS status available over the network, so that it can be monitored and used to trigger actions in a home automation system like [https://www.home-assistant.io/ Home Assistant].&lt;br /&gt;
&lt;br /&gt;
The UPS model used in the examples is an APC SmartUPS 1000, but any UPS on the [https://networkupstools.org/stable-hcl.html list of compatible models] should work.&lt;br /&gt;
&lt;br /&gt;
== Determine UPS USB parameters ==&lt;br /&gt;
&lt;br /&gt;
The first step is to plug in the USB cable between your UPS and your Alpine Linux host to see how it appears to the system. Information about the UPS can be seen with the {{ic|dmesg}} command. See the example below.{{Cmd|&amp;lt;nowiki&amp;gt;# dmesg&lt;br /&gt;
 [400269.428612] usb 1-3: new low-speed USB device number 3 using xhci_hcd&lt;br /&gt;
 [400269.580728] usb 1-3: New USB device found, idVendor=051d, idProduct=0002, bcdDevice= 0.06&lt;br /&gt;
 [400269.580751] usb 1-3: New USB device strings: Mfr=3, Product=1, SerialNumber=2&lt;br /&gt;
 [400269.580759] usb 1-3: Product: Smart-UPS 1000 FW:600.3.D USB FW:1.4&lt;br /&gt;
 [400269.580765] usb 1-3: Manufacturer: American Power Conversion&lt;br /&gt;
 [400269.580771] usb 1-3: SerialNumber: AS0123456789&lt;br /&gt;
 [400269.687883] usbcore: registered new interface driver usbhid&lt;br /&gt;
 [400269.687894] usbhid: USB HID core driver&lt;br /&gt;
 [400269.698356] hid-generic 0003:051D:0002.0001: hiddev96,hidraw0: USB HID v1.10 Device [American Power Conversion Smart-UPS 1000 FW:600.3.D USB FW:1.4] on usb-0000:00:15.0-3/input0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
From this output, we can see a Smart-UPS 1000 has been detected. We can also see two important parameters: &#039;&#039;&#039;idVendor=051d&#039;&#039;&#039; and &#039;&#039;&#039;idProduct=0002&#039;&#039;&#039;. These will be used later in the udev rules, so keep them handy.&lt;br /&gt;
&lt;br /&gt;
These parameters can also simply be retrieved from {{ic|lsusb}}. See the example below.{{Cmd|&amp;lt;nowiki&amp;gt;# lsusb&lt;br /&gt;
 Bus 001 Device 001: ID 1d6b:0002 Linux 6.12.67-0-rpi dwc_otg_hcd DWC OTG Controller&lt;br /&gt;
 Bus 001 Device 003: ID 0424:2514&lt;br /&gt;
 Bus 001 Device 002: ID 0424:2514&lt;br /&gt;
 Bus 001 Device 004: ID 0463:ffff EATON Ellipse ECO&lt;br /&gt;
 Bus 001 Device 005: ID 0424:7800&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
From this output, we can see a EATON Ellipse ECO UPS has been detected. We can also see the two important parameters from the ID field, with &#039;&#039;&#039;0463&#039;&#039;&#039; being the &#039;&#039;&#039;idVendor&#039;&#039;&#039; and &#039;&#039;&#039;ffff&#039;&#039;&#039; being the &#039;&#039;&#039;idProduct&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Install the {{pkg|nut}} package:{{Cmd|# apk add nut}}&lt;br /&gt;
&lt;br /&gt;
== Configuration == &lt;br /&gt;
&lt;br /&gt;
All of the configuration files delivered with the package will be in the {{Path|/etc/nut}} subdirectory. &lt;br /&gt;
&lt;br /&gt;
The following commands rename three original configuration files. {{Cmd|&amp;lt;nowiki&amp;gt;# mv /etc/nut/nut.conf /etc/nut/nut.bak&lt;br /&gt;
# mv /etc/nut/ups.conf /etc/nut/ups.bak&lt;br /&gt;
# mv /etc/nut/upsd.conf /etc/nut/upsd.bak&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Proceed to create the three files with only the configuration parameters needed for our example USB-attached APC Smart-UPS. &lt;br /&gt;
&lt;br /&gt;
To instruct NUT to make the UPS status available on the network, create the {{Path|/etc/nut/nut.conf}} file with content as follows: {{Cat|/etc/nut/nut.conf|&amp;lt;nowiki&amp;gt;MODE=netserver&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
 &lt;br /&gt;
For remote clients, content as follows: {{Cat|/etc/nut/nut.conf|&amp;lt;nowiki&amp;gt;MODE=netclient&amp;lt;/nowiki&amp;gt;}&lt;br /&gt;
&lt;br /&gt;
The content of {{Path|/etc/nut/ups.conf}} defines the name (in square brackets), the driver used to communicate with the UPS, and the port. For USB-attached UPSs, it&#039;s almost always going to be a driver of &#039;&#039;usbhid-ups&#039;&#039; and a port of &#039;&#039;auto&#039;&#039;. Make and model should not make any difference here provided that it is a USB-attached UPS. Create the file {{Path|/etc/nut/ups.conf}} with content as follows: {{Cat|/etc/nut/ups.conf|&amp;lt;nowiki&amp;gt;[SmartUPS_1000]&lt;br /&gt;
    driver = usbhid-ups&lt;br /&gt;
    port = auto&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
 &lt;br /&gt;
To tell NUT to make the UPS info available on all network interfaces instead of the default i.e localhost only, which is not very useful, create the {{Path|/etc/nut/upsd.conf}} file with content as follows: {{Cat|/etc/nut/upsd.conf|&amp;lt;nowiki&amp;gt;LISTEN 0.0.0.0 3493&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Replace 0.0.0.0 with the network address of a specific interface if none of the interfaces are appropriate for your situation.}}&lt;br /&gt;
&lt;br /&gt;
Setup all accounts includes an administrator server account with other administration privileges includes to send fsd (forced shutdown) command to all clients with limited account. Create the {{Path|/etc/nut/upsd.users}} file to store all users (Each user are define in square brackets) include a primary/administrator user and secondary/client user to monitor and receive status from the server: {{Cat|/etc/nut/upsd.users|&amp;lt;nowiki&amp;gt;[admin]&lt;br /&gt;
    password = kjsdahfglkjhlas456&lt;br /&gt;
    actions = fsd&lt;br /&gt;
    upsmon primary&lt;br /&gt;
[monuser]&lt;br /&gt;
    password = oiqwegth43&lt;br /&gt;
    upsmon secondary&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
Read [https://networkupstools.org/docs/man/upsd.users.html UPSD.USERS(5)] for powerful settings to alter connected ups.&lt;br /&gt;
&lt;br /&gt;
The file {{Path|/etc/nut/upsmon.conf}} provide logging, send notifications and store selected users to send or receive commands to ups server. Setup this file on the server MONITOR field with the matched user and ups as follows: {{Cat|/etc/nut/upsd.conf|&amp;lt;nowiki&amp;gt;MONITOR SmartUPS_1000@localhost 1 admin kjsdahfglkjhlas456 primary&lt;br /&gt;
&lt;br /&gt;
NOTIFYMSG ONLINE    &amp;quot;UPS %s on line power&amp;quot;&lt;br /&gt;
NOTIFYMSG ONBATT    &amp;quot;UPS %s on battery&amp;quot;&lt;br /&gt;
NOTIFYMSG LOWBATT   &amp;quot;UPS %s battery is low&amp;quot;&lt;br /&gt;
NOTIFYMSG FSD       &amp;quot;UPS %s: forced shutdown in progress&amp;quot;&lt;br /&gt;
NOTIFYMSG COMMOK    &amp;quot;Communications with UPS %s established&amp;quot;&lt;br /&gt;
NOTIFYMSG COMMBAD   &amp;quot;Communications with UPS %s lost&amp;quot;&lt;br /&gt;
NOTIFYMSG SHUTDOWN  &amp;quot;Auto logout and shutdown proceeding&amp;quot;&lt;br /&gt;
NOTIFYMSG REPLBATT  &amp;quot;UPS %s battery needs to be replaced&amp;quot;&lt;br /&gt;
NOTIFYMSG NOCOMM    &amp;quot;UPS %s is unavailable&amp;quot;&lt;br /&gt;
NOTIFYMSG NOPARENT  &amp;quot;upsmon parent process died - shutdown impossible&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTIFYFLAG ONLINE   SYSLOG&lt;br /&gt;
NOTIFYFLAG ONBATT   SYSLOG&lt;br /&gt;
NOTIFYFLAG LOWBATT  SYSLOG&lt;br /&gt;
NOTIFYFLAG FSD      SYSLOG&lt;br /&gt;
NOTIFYFLAG COMMOK   SYSLOG&lt;br /&gt;
NOTIFYFLAG COMMBAD  SYSLOG&lt;br /&gt;
NOTIFYFLAG SHUTDOWN SYSLOG&lt;br /&gt;
NOTIFYFLAG REPLBATT SYSLOG&lt;br /&gt;
NOTIFYFLAG NOCOMM   SYSLOG&lt;br /&gt;
NOTIFYFLAG NOPARENT SYSLOG&lt;br /&gt;
&lt;br /&gt;
RBWARNTIME 21600&lt;br /&gt;
POWERDOWNFLAG /run/killpower&lt;br /&gt;
RUN_AS_USER nut&lt;br /&gt;
SHUTDOWNCMD &amp;quot;/sbin/poweroff&amp;quot;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Client&#039;s upsmon.conf file contains the following: {{Cat|/etc/nut/upsd.conf|&amp;lt;nowiki&amp;gt;MONITOR SmartUPS_1000@(enter the server ip address or hostname) 1 monuser oiqwegth43 secondary&lt;br /&gt;
...&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Read [https://networkupstools.org/docs/man/upsmon.conf.html UPSMON.CONF(5)] to further understand additional features.&lt;br /&gt;
&lt;br /&gt;
=== Configure udev rules ===&lt;br /&gt;
&lt;br /&gt;
To avoid [[#Insufficient permissions on everything|permission errors]], configure &#039;&#039;&#039;udev&#039;&#039;&#039; for giving NUT access to the USB-attached Smart-UPS 1000. Create the file {{Path|/etc/udev/rules.d/62-nut-usbups.rules}} as follows:{{Cat|/etc/udev/rules.d/62-nut-usbups.rules|&amp;lt;nowiki&amp;gt;SUBSYSTEM==&amp;quot;usb&amp;quot;, ATTR{idVendor}==&amp;quot;051d&amp;quot;, ATTR{idProduct}==&amp;quot;0002&amp;quot;, GROUP=&amp;quot;nut&amp;quot;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
The &#039;&#039;idVendor&#039;&#039; and &#039;&#039;idProduct&#039;&#039; in the first part – i.e &#039;&#039;ATTR{idVendor}==&amp;quot;051d&amp;quot;, ATTR{idProduct}==&amp;quot;0002&amp;quot;&#039;&#039; – are unique to your UPS. They were found earlier in the [[#Determine UPS USB parameters| Determining UPS USB parameters]] section. The rest of the line tells &#039;&#039;&#039;udev&#039;&#039;&#039; what permissions and group ownership to use, and these should be the same regardless of the UPS make and model.&lt;br /&gt;
&lt;br /&gt;
Use the {{ic|udevadm}} command to tell &#039;&#039;&#039;udev&#039;&#039;&#039; to read in and apply the changes:&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;# udevadm control --reload &lt;br /&gt;
# udevadm trigger&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Make sure that the {{ic|udev-trigger}} service is added to a runlevel for the udev rule to automatically apply at boot: {{ic|# rc-update add udev-trigger}}.}}&lt;br /&gt;
{{Note|There is also a file {{Path|/lib/udev/rules.d/62-nut-usbups.rules}} that has information for all of the UPS models that NUT knows about. You may be able to simply copy this rather than constructing your own rules.}}&lt;br /&gt;
&lt;br /&gt;
== Service configuration ==&lt;br /&gt;
&lt;br /&gt;
The service is called {{ic|nut-upsd}} and can be managed using the standard start|stop|restart commands using standard [[OpenRC]] commands.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Remember to [[#Configure udev rules|configure &#039;&#039;&#039;udev&#039;&#039;&#039; rules]] and to [[#Testing the configuration|test the configuration]] before proceeding further.}} &lt;br /&gt;
&lt;br /&gt;
Proceed to start the service as follows: {{Cmd|# rc-service nut-upsd start&lt;br /&gt;
  * /run/nut: creating directory&lt;br /&gt;
  * /run/nut: correcting owner&lt;br /&gt;
 Using subdriver: APC HID 0.100&lt;br /&gt;
  * Starting UPS Server ...}}&lt;br /&gt;
&lt;br /&gt;
Notice that the directory {{Path|/run/nut}} is created automatically the first time.&lt;br /&gt;
&lt;br /&gt;
[[#Verifying running state|Verify the running state]] before proceeding to configure the automatic startup of the {{ic|nut-upsd}}. If everything looks good, go ahead and set the service to auto-start when the system is booted:{{Cmd|# rc-update add nut-upsd&lt;br /&gt;
  * service nut-upsd added to runlevel default}}&lt;br /&gt;
&lt;br /&gt;
Another service {{ic|nut-upsmon}} is needed to read and perform logging monitoring and send force shutdown command to all setup hosts. Follow the instructions about {{ic|nut-upsd}} to enable and start {{ic|nut-upsmon}}&lt;br /&gt;
&lt;br /&gt;
== Live Shutdown Test ==&lt;br /&gt;
&lt;br /&gt;
Input this command {{ic|upsmon -c fsd}} on the server with primary upsmon user to shutdown all hosts includes the server. If any issues need to be Troubleshooting, read [https://networkupstools.org/docs/man/upsmon.conf.html UPSMON.CONF(5)].&lt;br /&gt;
&lt;br /&gt;
== Using NUT ==&lt;br /&gt;
&lt;br /&gt;
Now, the {{ic|upsc}} command can be run against the name added in {{Path|/etc/nut/ups.conf}} to gather all status information about your UPS. Based on the example used on this wiki page:{{Cmd|$ upsc SmartUPS_1000}}&lt;br /&gt;
One can also gather specific status information by passing them as an argument: {{Cmd|$ upsc SmartUPS_1000 battery.charge}} This is useful to monitor specific values and/or to initiate actions (e.g. from a script) when specific thresholds are reached.&lt;br /&gt;
&lt;br /&gt;
The [[#See also|See also]] section has documentation links about how to configure NUT to do useful things, such as sending an email, initiating a graceful shutdown when the main power is lost, and how to use Home Assistant to keep tabs on your UPS. &lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
=== Testing the configuration ===&lt;br /&gt;
&lt;br /&gt;
Unplug the UPS USB cable from the host, wait a moment, and then reinsert it. Check &#039;&#039;&#039;dmesg&#039;&#039;&#039; again to make sure that it was detected and that the &#039;&#039;idVendor&#039;&#039; and &#039;&#039;idProduct&#039;&#039; are correct.&lt;br /&gt;
&lt;br /&gt;
Check the permissions on the files in the {{Path|/dev/bus/usb}} subdirectories. One of these represents your UPS. If the &#039;&#039;&#039;udev&#039;&#039;&#039; rules work correctly, the file should be the one with a group owner of &#039;&#039;nut&#039;&#039; and permissions of 0664. An example is shown below.{{Cmd|# ls -l /dev/bus/usb/001/003&lt;br /&gt;
 crw-rw-r-- 1 root nut 189, 2 Oct 10 00:53 /dev/bus/usb/001/003}}&lt;br /&gt;
&lt;br /&gt;
Your directory and file names may be different, but at least one of the files should have the group ownership and permissions as shown in the example.&lt;br /&gt;
&lt;br /&gt;
The output from {{ic|dmesg}} should tip you off as to which directory and file it is. Look at the line below from {{ic|dmesg}} and compare the &#039;&#039;usb 1-3&#039;&#039; to the directory entry of the {{Path|/dev/bus/usb/001/003}}file. {{Cat|/dev/bus/usb/001/003|usb 1-3: Manufacturer: American Power Conversion}}&lt;br /&gt;
&lt;br /&gt;
=== Verifying running state ===&lt;br /&gt;
&lt;br /&gt;
A couple of quick commands will ensure that the NUT service is actually running as expected. These are shown in the example below.&lt;br /&gt;
&lt;br /&gt;
 alpine:/# rc-service nut-upsd status&lt;br /&gt;
 * status: started&lt;br /&gt;
 alpine:/# netstat -tln | grep 3493&lt;br /&gt;
 tcp        0      0 0.0.0.0:3493            0.0.0.0:*               LISTEN&lt;br /&gt;
&lt;br /&gt;
This shows the service running and making the UPS status available on all network interfaces (0.0.0.0) over the default TCP port for NUT (3493).&lt;br /&gt;
&lt;br /&gt;
=== Insufficient permissions on everything ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 libusb1: Could not open any HID devices: insufficient permissions on everything&lt;br /&gt;
 No matching HID UPS found&lt;br /&gt;
 upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it&lt;br /&gt;
 Driver failed to start (exit status=1)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The error message above is due to the USB device having the wrong ownership and permissions. [[#Configure udev rules|Configure &#039;&#039;&#039;udev&#039;&#039;&#039; rules]] and restart the [[#Service configuration|service]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://networkupstools.org/ NUT home page] &lt;br /&gt;
* [https://networkupstools.org/stable-hcl.html list of NUT compatible models]&lt;br /&gt;
* [https://www.home-assistant.io/integrations/nut/ NUT integration for Home Assistant]&lt;br /&gt;
* [[Apcupsd]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;br /&gt;
[[Category:System Administration]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Ingrate one</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setup_Hardware_Clock_(RTC)_Module_on_a_Raspberry_Pi&amp;diff=29264</id>
		<title>Setup Hardware Clock (RTC) Module on a Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setup_Hardware_Clock_(RTC)_Module_on_a_Raspberry_Pi&amp;diff=29264"/>
		<updated>2025-03-12T15:36:01Z</updated>

		<summary type="html">&lt;p&gt;Ingrate one: adding how to for another chipset and add testing hardware bind section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Hardware Prerequisites=&lt;br /&gt;
&lt;br /&gt;
Read the documentation on Installing coin battery and mounting it on the correct GPIO pins  for your version of Raspberry Pi board.&lt;br /&gt;
&lt;br /&gt;
Example of Raspberry Pi RTC Modules with documentation:&lt;br /&gt;
* [https://wiki.dfrobot.com/Raspberry_Pi_RTC_Module_SKU__DFR0386#target_0 DFROBOT - Raspberry Pi RTC Module SKU DFR0386]&lt;br /&gt;
* [https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/wiring-the-rtc Adafruit RTC Modules]&lt;br /&gt;
* [http://www.piface.org.uk/assets/piface_clock/PiFaceClockguide.pdf PiFace Real Time Clock]&lt;br /&gt;
&lt;br /&gt;
= Install Software =&lt;br /&gt;
Add the modules from the kernel. The documentation should give you required modules paired with chipset mcp7941x, ds1307 or etc.&lt;br /&gt;
&lt;br /&gt;
== /etc/modules|/etc/modules-load.d/i2c.conf ==&lt;br /&gt;
Add these modules so they&#039;re loaded on boot. You can modprobe each one individually if you don&#039;t want to reboot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mcp7941x&#039;&#039;&#039;&lt;br /&gt;
{{Cat|/etc/modules|i2c_dev&lt;br /&gt;
i2c_bcm2708&lt;br /&gt;
i2c:mcp7941x&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ds1307&#039;&#039;&#039;&lt;br /&gt;
{{Cat|/etc/modules-load.d/i2c.conf|i2c_dev&lt;br /&gt;
i2c_bcm2708&lt;br /&gt;
rtc-ds1307&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== /media/mmcblk0p1/config.txt ==&lt;br /&gt;
You will need to mount this as read-write in diskless mode&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount -o remount,rw /media/mmcblk0p1}}&lt;br /&gt;
&lt;br /&gt;
Add these two parameters to the bottom&lt;br /&gt;
&lt;br /&gt;
{{Cat|/media/mmcblk0p1/config.txt|dtparam{{=}}i2c1{{=}}on&lt;br /&gt;
dtparam{{=}}i2c_arm{{=}}on&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount -o remount,ro /media/mmcblk0p1}}&lt;br /&gt;
&lt;br /&gt;
Then you will need to reboot.&lt;br /&gt;
&lt;br /&gt;
== Binding the hardware clock device ==&lt;br /&gt;
&lt;br /&gt;
Read the documentation for the mounted RTC module to get an I2C address for hardware binding.&lt;br /&gt;
You will want to make sure the device is created when hwclock starts, if it isn&#039;t already created. To the bottom of {{Path|/etc/conf.d/hwclock}} add this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mcp7941x&#039;&#039;&#039;&lt;br /&gt;
{{Cat|/etc/conf.d/hwclock|...&lt;br /&gt;
start_pre() {&lt;br /&gt;
    if [ -d &amp;quot;/sys/class/i2c-adapter/i2c-1/i2c-dev/i2c-1&amp;quot; ]; then&lt;br /&gt;
        einfo &amp;quot;Creating RTC device&amp;quot;;&lt;br /&gt;
        echo mcp7941x 0x6f &amp;gt; /sys/class/i2c-adapter/i2c-1/new_device&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For the time being this is necessary but in the future when [https://github.com/raspberrypi/linux/issues/1032 issue 1032] you should be able to just add&lt;br /&gt;
&lt;br /&gt;
{{Cat|/media/mmcblk0p1/config.txt|...&lt;br /&gt;
dtparam{{=}}i2c-rtc,mcp7941x&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ds1307&#039;&#039;&#039;&lt;br /&gt;
{{Cat|/etc/conf.d/hwclock|...&lt;br /&gt;
start_pre() {&lt;br /&gt;
    einfo &amp;quot;Creating RTC device&amp;quot;;&lt;br /&gt;
    echo ds1307 0x68 &amp;gt; /sys/bus/i2c/devices/i2c-1/new_device&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In diskless mode save to {{Path|/media/mmcblk0p1/config.txt}}.&lt;br /&gt;
&lt;br /&gt;
In system disk mode save to {{Path|/boot/usercfg.txt}}.&lt;br /&gt;
 &lt;br /&gt;
=== Testing hardware bind ===&lt;br /&gt;
Before test hardware bind, reboot or run line echo … from {{Path|/etc/conf.d/hwclock}} example&lt;br /&gt;
{{cmd|echo ds1307 0x68 &amp;gt; /sys/bus/i2c/devices/i2c-1/new_device }}&lt;br /&gt;
&lt;br /&gt;
Display hardware clock&lt;br /&gt;
{{cmd|hwclock }}&lt;br /&gt;
&lt;br /&gt;
Output should display time&lt;br /&gt;
&amp;lt;pre&amp;gt; hwclock: Wed Mar 12 17:41:09 2025  0.000000 seconds &amp;lt;/pre&amp;gt;&lt;br /&gt;
Or error similar below&lt;br /&gt;
&amp;lt;pre&amp;gt; hwclock: ioctl 0x80247009 failed: Invalid argument &amp;lt;/pre&amp;gt;&lt;br /&gt;
meaning hardware bind is successful.&lt;br /&gt;
&lt;br /&gt;
Write system time to RTC module&lt;br /&gt;
{{cmd|hwclock -w }}&lt;br /&gt;
Run hwclock again to check the time.&lt;br /&gt;
&lt;br /&gt;
== Starting hwclock on boot ==&lt;br /&gt;
The hwclock service needs to be started for the hardware clock device to actually do anything. Check if hwclock has been started by running this command:&lt;br /&gt;
&lt;br /&gt;
{{cmd|rc-status {{!}} grep hwclock }}&lt;br /&gt;
&lt;br /&gt;
If it outputs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; hwclock                                                           [  started  ]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hwclock has already started. Otherwise start it manually and add it to the default init.d runlevel, so that it starts at boot time:&lt;br /&gt;
&lt;br /&gt;
{{cmd|rc-service hwclock start}}&lt;br /&gt;
{{cmd|rc-update add hwclock default}}&lt;br /&gt;
&lt;br /&gt;
If you are running Alpine Linux in the diskless mode (non-persistent root filesystem), save the configuration by:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu commit -d}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:System Administration]]&lt;br /&gt;
[[Category:Raspberry]]&lt;/div&gt;</summary>
		<author><name>Ingrate one</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Saving_time_with_Hardware_Clock&amp;diff=29263</id>
		<title>Saving time with Hardware Clock</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Saving_time_with_Hardware_Clock&amp;diff=29263"/>
		<updated>2025-03-12T12:51:10Z</updated>

		<summary type="html">&lt;p&gt;Ingrate one: Ingrate one moved page Saving time with Hardware Clock to Setup Hardware Clock (RTC) Module on a Raspberry Pi: The title should reflect the purpose of this page for adding an RTC module on a Raspberry Pi.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Setup Hardware Clock (RTC) Module on a Raspberry Pi]]&lt;/div&gt;</summary>
		<author><name>Ingrate one</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setup_Hardware_Clock_(RTC)_Module_on_a_Raspberry_Pi&amp;diff=29262</id>
		<title>Setup Hardware Clock (RTC) Module on a Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setup_Hardware_Clock_(RTC)_Module_on_a_Raspberry_Pi&amp;diff=29262"/>
		<updated>2025-03-12T12:51:10Z</updated>

		<summary type="html">&lt;p&gt;Ingrate one: Ingrate one moved page Saving time with Hardware Clock to Setup Hardware Clock (RTC) Module on a Raspberry Pi: The title should reflect the purpose of this page for adding an RTC module on a Raspberry Pi.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Install Hardware =&lt;br /&gt;
&lt;br /&gt;
I used a [http://www.piface.org.uk/products/piface_clock PiFace Real Time Clock]. After installing the CR1220 battery and correctly mounting on the board, [http://www.piface.org.uk/assets/piface_clock/PiFaceClockguide.pdf see manual] for that.&lt;br /&gt;
&lt;br /&gt;
= Install Software =&lt;br /&gt;
Add the modules from the kernel&lt;br /&gt;
&lt;br /&gt;
== /etc/modules ==&lt;br /&gt;
Add these modules so they&#039;re loaded on boot. You can modprobe each one individually if you don&#039;t want to reboot.&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/modules|i2c_dev&lt;br /&gt;
i2c_bcm2708&lt;br /&gt;
i2c:mcp7941x&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== /media/mmcblk0p1/config.txt ==&lt;br /&gt;
You will need to mount this as read-write&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount -o remount,rw /media/mmcblk0p1}}&lt;br /&gt;
&lt;br /&gt;
Add these two parameters to the bottom&lt;br /&gt;
&lt;br /&gt;
{{Cat|/media/mmcblk0p1/config.txt|dtparam{{=}}i2c1{{=}}on&lt;br /&gt;
dtparam{{=}}i2c_arm{{=}}on&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount -o remount,ro /media/mmcblk0p1}}&lt;br /&gt;
&lt;br /&gt;
Then you will need to reboot.&lt;br /&gt;
&lt;br /&gt;
== Binding the hardware clock device ==&lt;br /&gt;
&lt;br /&gt;
You will want to make sure the device is created when hwclock starts, if it isn&#039;t already created. To the bottom of {{Path|/etc/conf.d/hwclock}} add this:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/conf.d/hwclock|...&lt;br /&gt;
start_pre() {&lt;br /&gt;
    if [ -d &amp;quot;/sys/class/i2c-adapter/i2c-1/i2c-dev/i2c-1&amp;quot; ]; then&lt;br /&gt;
        einfo &amp;quot;Creating RTC device&amp;quot;;&lt;br /&gt;
        echo mcp7941x 0x6f &amp;gt; /sys/class/i2c-adapter/i2c-1/new_device&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For the time being this is necessary but in the future when [https://github.com/raspberrypi/linux/issues/1032 issue 1032] you should be able to just add&lt;br /&gt;
&lt;br /&gt;
{{Cat|/media/mmcblk0p1/config.txt|...&lt;br /&gt;
dtparam{{=}}i2c-rtc,mcp7941x&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
to {{Path|/media/mmcblk0p1/config.txt}}&lt;br /&gt;
&lt;br /&gt;
== Starting hwclock on boot ==&lt;br /&gt;
The hwclock service needs to be started for the hardware clock device to actually do anything. Check if hwclock has been started by running this command:&lt;br /&gt;
&lt;br /&gt;
{{cmd|rc-status {{!}} grep hwclock}}&lt;br /&gt;
&lt;br /&gt;
If it outputs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; hwclock                                                           [  started  ]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hwclock has already started. Otherwise start it manually and add it to the default init.d runlevel, so that it starts at boot time:&lt;br /&gt;
&lt;br /&gt;
{{cmd|rc-service hwclock start}}&lt;br /&gt;
{{cmd|rc-update add hwclock default}}&lt;br /&gt;
&lt;br /&gt;
If you are running Alpine Linux in the diskless mode (non-persistent root filesystem), save the configuration by:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu commit -d}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:System Administration]]&lt;br /&gt;
[[Category:Raspberry]]&lt;/div&gt;</summary>
		<author><name>Ingrate one</name></author>
	</entry>
</feed>