系统 Debian 延伸。我为 kodi-standalone 创建了一个自己的目标。
cat kodi.target
[Unit]
Description=standalone-kodi
Wants=kodi.service
After=basic.target rescue.service rescue.target
Conflicts=rescue.target rescue.service
AllowIsolate=yes
和 kodi.service。
cat kodi.service
[Unit]
Description=Starts instance of Kodi using xinit
Requires=basic.target
After=systemd-user-sessions.service sound.target
Conflicts=rescue.service rescue.target
After=basic.target rescue.service rescue.target
[Service]
User=kodi
Group=kodi
PAMName=login
TTYPath=/dev/tty1
ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt7
Restart=on-abort
StandardInput=tty
[Install]
WantedBy=kodi.target
两者都位于 /etc/systemd/system 中。但我错过了在 kodi-standalone 中重新启动或关闭 GUI 中的可能性。用户 kodi 已创建。 Kodi 靴子我可以使用它。
ls -al kodi.target.wants/
insgesamt 8
drwxr-xr-x 2 root root 4096 Okt 3 21:52 .
drwxr-xr-x 15 root root 4096 Okt 3 21:29 ..
lrwxrwxrwx 1 root root 32 Okt 3 21:52 dbus.service -> /lib/systemd/system/dbus.service
lrwxrwxrwx 1 root root 32 Okt 3 21:29 kodi.service -> /etc/systemd/system/kodi.service
我的错误在哪里?
Kodi 使用 kerneloption 自己的条目从 grub2 启动systemd.unit=kodi.target
答案1
找到了。
我/etc/polkit-1/localauthority/50-local.d/custom-actions.pkla
用以下内容创建
[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.consolekit.system.*;org.freedesktop.udisks2.*;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
现在用户kodi可以重新启动并断电待机并使用udisks2。