Portál AbcLinuxu, 16. července 2025 08:14
apt install -y --no-install-recommends flatpak xorg lightdm i965-va-driver upower policykit-1 pulseaudio dbus-user-session dbus-x11 accountsservice systemd-container adduser --disabled-password --shell /bin/bash --gecos "User" kodi flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install -y flathub tv.kodi.Kodi mkdir -p /etc/lightdm/lightdm.conf.d/ printf "[SeatDefaults]\nautologin-user=kodi\n" > /etc/lightdm/lightdm.conf.d/1-autologin.conf mkdir -p /home/kodi/.config/systemd/user/ cat << FOO >> /home/kodi/.config/systemd/user/xsession.target [Unit] Description=Xsession running BindsTo=graphical-session.target After=lightdm.service FOO cat << FOO >> /home/kodi/.config/systemd/user/kodi.service [Unit] Description=Flatpak Kodi PartOf=graphical-session.target [Service] Type=simple ExecStart=/usr/bin/flatpak run tv.kodi.Kodi Restart=always [Install] WantedBy=xsession.target FOO cat << FOO >> /home/kodi/.config/systemd/user/xset.service [Unit] Description=Turn off Xorg Blanking PartOf=graphical-session.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/xset s off -dpms ExecStop=/usr/bin/xset s on +dpms [Install] WantedBy=xsession.target FOO machinectl shell kodi@.host /bin/bash -c "/bin/systemctl --user daemon-reload" machinectl shell kodi@.host /bin/bash -c "/bin/systemctl --user enable kodi" machinectl shell kodi@.host /bin/bash -c "/bin/systemctl --user enable xset" printf "/bin/systemctl --user import-environment PATH\nsystemctl --user --no-block start xsession.target" > /home/kodi/.xsessionBohuzel se mi to takto uplne nedari, uplne neznam systemd a netusim, jak udelat target, aby nedoslo k deadlocku a vse fungovalo a bylo navazono na ostatni servicy. Vim, ze muzu pustit vsechno v .xsession(to mi funguje ok), problem ale nastava u restartu, kdy KODI neni handlovano systemd a po dvou minutach dostane sigkill. Nechci, aby mi vznikali nekonzistence v databazi, tak to chci cele handlovat systemd. Muze nekdo poradit, protoze uplne nevim, jestli to takhle muze fungovat. Diky
problem ale nastava u restartu, kdy KODI neni handlovano systemd a po dvou minutach dostane sigkill.Viz loginctl:
enable-linger [USER…], disable-linger [USER…] Enable/disable user lingering for one or more users. If enabled for a specific user, a user manager is spawned for the user at boot and kept around after logouts. This allows users who are not logged in to run long-running services. Takes one or more user names or numeric UIDs as argument. If no argument is specified, enables/disables lingering for the user of the session of the caller.… Ale pokud Lightdm session vyrobí, tak by s tímto neměl být problém. – Lightdm spustí X sezení a v něm se spustí Kodi. Druhá možnost je spustit X server samostatně, předat XAuth sušenku a startovat Kodi jako službu také samostatně. X.org jde prý spouštět i pomocí socket activation, tak by to mohlo být celkem elegantní řešení.
Warning: systemd services are not sessions, they run outside of logind. Do not use lingering to enable automatic login as it will break the session.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.