Seems like it is not possible to call org.freedesktop.systemd1
using the dbus interface. I updated snapcraft.yaml
like this-
name: servicer # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: 0.1.2 # just for humans, typically '1.2+git' or '1.3.2'
summary: Simplify Service Management on systemd # 79 char long summary
description: A CLI tool for service management on systemd.
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
plugs:
etc-systemd-system:
interface: system-files
write:
- /etc/systemd/system
dbus-org-freedesktop-systemd1:
interface: dbus
bus: system
name: org.freedesktop.systemd1
apps:
servicer:
command: bin/servicer
plugs: [home, etc-systemd-system, dbus-org-freedesktop-systemd1]
parts:
servicer:
# See 'snapcraft plugins'
plugin: rust
source: .
build-packages: [cargo, rustc]
Calling sudo snap connect servicer:dbus-org-freedesktop-systemd1
gives error
snap "snapd" has no "dbus" interface slots
dbus
access is necessary because the CLI’s use case is to enable and disable services. Is there any workaround or do I need classic mode?