Finally got battery monitoring working reliably. This was a hell of a lot harder than it should have been.
This commit is contained in:
@@ -1,32 +1,27 @@
|
||||
[Unit]
|
||||
Description=Battery Monitor for Stormux Gaming Image
|
||||
Documentation=man:battery_monitor.py(1)
|
||||
After=multi-user.target
|
||||
After=multi-user.target sound.target
|
||||
ConditionPathExists=/sys/class/power_supply
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/battery_monitor.py
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
User=root
|
||||
Group=root
|
||||
RestartSec=30
|
||||
User=stormux
|
||||
Group=stormux
|
||||
|
||||
# Security settings
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=strict
|
||||
ProtectHome=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectControlGroups=yes
|
||||
ReadWritePaths=/var/log
|
||||
ReadOnlyPaths=/sys/class/power_supply
|
||||
# Allow access to system resources
|
||||
SupplementaryGroups=audio video
|
||||
|
||||
# Allow access to speech and audio
|
||||
SupplementaryGroups=audio
|
||||
|
||||
# Environment
|
||||
# Environment for audio and speech
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
Environment=XDG_RUNTIME_DIR=/run/user/1000
|
||||
Environment=PULSE_RUNTIME_PATH=/run/user/1000/pulse
|
||||
|
||||
# Allow sudo for shutdown without password
|
||||
# This requires sudoers configuration
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user