Compare commits
2 Commits
debian/0.0
...
41d9b13e71
| Author | SHA1 | Date | |
|---|---|---|---|
| 41d9b13e71 | |||
| 463a61a001 |
@@ -1,4 +1,4 @@
|
||||
<!-- /etc/dbus-1/system.d/revpi-middleware.conf -->
|
||||
<!-- /usr/share/dbus-1/system.d/com.revolutionpi.middleware1.conf -->
|
||||
<busconfig>
|
||||
<!-- Allow full access to root as the bus owner -->
|
||||
<policy user="root">
|
||||
@@ -12,7 +12,7 @@
|
||||
<allow send_destination="com.revolutionpi.middleware1"
|
||||
send_interface="org.freedesktop.DBus.Introspectable"/>
|
||||
<allow send_destination="com.revolutionpi.middleware1"
|
||||
send_interface="com.revolutionpi.middleware1.picontrol"/>
|
||||
send_interface="com.revolutionpi.middleware1.PiControl"/>
|
||||
</policy>
|
||||
|
||||
<!-- Standard-Policy -->
|
||||
|
||||
@@ -324,7 +324,11 @@ def configure_gui(action: ConfigActions):
|
||||
return gui_available
|
||||
|
||||
bus = SystemBus()
|
||||
systemd_manager = bus.get(".systemd1")
|
||||
systemd = bus.get(
|
||||
"org.freedesktop.systemd1",
|
||||
"/org/freedesktop/systemd1",
|
||||
)
|
||||
systemd_manager = systemd["org.freedesktop.systemd1.Manager"]
|
||||
|
||||
if action is ConfigActions.ENABLE:
|
||||
systemd_manager.SetDefaultTarget("graphical.target", True)
|
||||
@@ -384,7 +388,11 @@ def get_rfkill_index(device_class_path: str) -> Optional[int]:
|
||||
|
||||
def simple_systemd(action: ConfigActions, unit: str):
|
||||
bus = SystemBus()
|
||||
systemd_manager = bus.get(".systemd1")
|
||||
systemd = bus.get(
|
||||
"org.freedesktop.systemd1",
|
||||
"/org/freedesktop/systemd1",
|
||||
)
|
||||
systemd_manager = systemd["org.freedesktop.systemd1.Manager"]
|
||||
|
||||
if action is ConfigActions.ENABLE:
|
||||
systemd_manager.UnmaskUnitFiles([unit], False)
|
||||
@@ -398,7 +406,7 @@ def simple_systemd(action: ConfigActions, unit: str):
|
||||
elif action is ConfigActions.STATUS:
|
||||
try:
|
||||
unit_path = systemd_manager.LoadUnit(unit)
|
||||
properties = bus.get(".systemd1", unit_path)
|
||||
properties = bus.get("org.freedesktop.systemd1", unit_path)
|
||||
except Exception:
|
||||
log.warning(f"could not get systemd unit {unit}")
|
||||
return False
|
||||
@@ -408,7 +416,7 @@ def simple_systemd(action: ConfigActions, unit: str):
|
||||
elif action is ConfigActions.AVAILABLE:
|
||||
try:
|
||||
unit_path = systemd_manager.LoadUnit(unit)
|
||||
properties = bus.get(".systemd1", unit_path)
|
||||
properties = bus.get("org.freedesktop.systemd1", unit_path)
|
||||
except Exception:
|
||||
log.warning(f"could not get systemd unit {unit}")
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user