0

System Debian stretch. I created for kodi-standalone an own target.

cat kodi.target


[Unit]
Description=standalone-kodi
Wants=kodi.service
After=basic.target rescue.service rescue.target
Conflicts=rescue.target rescue.service 
AllowIsolate=yes

and a 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

Both are in /etc/systemd/system. But I missing the possibility in kodi-standalone to reboot or shutdown the it in the gui. User kodi is createtd. Kodi boots and I can use it.

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 

Where is my mistake?

Kodi starts over grub2 with an own entry with kerneloption systemd.unit=kodi.target

1

Found it.

I create /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla with following content

[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

Now user kodi can reboot and poweroff standby and use udisks2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy