mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2025-12-20 02:00:03 +01:00
read-only-mirror of https://gitlab.freedesktop.org/upower/upower
This change adds the feature to read config from conf.d style directories (UPower.conf.d), commonly supported by other tools, as an extension of the main config file. This is useful and convenient in several situations, for example: - distributions can set different values from the defaults shipped upstream without having to modify the main UPower.conf - different packages or config-management tools can change config just by adding, removing or modifying files in that directory The main config file, e.g. '/etc/UPower/UPower.conf', will be processed first, and then files in the UPower.conf.d dir, if existing. The directory to use is derived automatically, e.g. '/etc/UPower/UPower.conf.d/' if the main config file is '/etc/UPower/UPower.conf'. Only files within that directory are considered, and only those with valid config-group 'UPower' and with the filename format: starting with '00-' to '99-', ending in '.conf' and with alphanumeric characters, dash or underscore in between. The candidate files within the given directory are sorted (with g_strcmp0(), so the ordering will be as with strcmp()). The configuration in the files being processed later will override previous config, in particular the main config, but also the one from previous files processed, if the Group and Key coincide. Add also relevant integration test: 'test_conf_d_support' |
||
|---|---|---|
| .ci | ||
| contrib | ||
| data/zsh-completion | ||
| dbus | ||
| doc | ||
| etc | ||
| libupower-glib | ||
| po | ||
| policy | ||
| rules | ||
| src | ||
| tools | ||
| .git-blame-ignore-revs | ||
| .gitconfig | ||
| .gitlab-ci.yml | ||
| .markdownlint.json | ||
| .pre-commit-config.yaml | ||
| AUTHORS | ||
| code-of-conduct.md | ||
| COMMITMENT | ||
| COPYING | ||
| HACKING.md | ||
| meson.build | ||
| meson_options.txt | ||
| NEWS | ||
| README.md | ||
| RELEASE | ||
UPower
Requirements:
glib-2.0 >= 2.66.0
gio-2.0 >= 2.16.1
gudev-1.0 >= 235 (Linux)
libimobiledevice-1.0 >= 0.9.7 (optional)
polkit-gobject-1 >= 124
UPower is an abstraction for enumerating power devices, listening to device events and querying history and statistics. Any application or service on the system can access the org.freedesktop.UPower service via the system message bus.
Debugging
When doing bug reports, the following information can be useful:
grep . /sys/class/power_supply/*/*
This includes the current kernel view of all power supplies in the system. It is always a good idea to include this information.udevadm info -e
This shows the hardware configuration and is relevant when e.g. the type of an external device is misdetected.upower -d
Shows upower's view of the stateupower --monitor-detail
Dumps device information every time that a change happens. This helps with debugging dynamic issues.udevadm monitor
Dumps the udev/kernel reported hardware changes (and addition/removal). This is helpful when debugging dynamic issues, in particular if it is not clear whether the issue is coming from the kernel or upower.
In addition, it can also be useful to run upower in debug mode and post the logs. There are two ways of doing so:
- Run upower daemon manually, you can do so using:
sudo /usr/libexec/upowerd -rd - Modify the systemd service and restart. This is best done by:
-
sudo systemctl edit upower.service -
Adding the two lines:
[Service] Environment=G_MESSAGES_DEBUG=all -
sudo systemctl restart upower.service -
Grab logs using
journalctl -u upower.serviceor similar
-