You are not logged in.

#1 2012-08-27 13:06:45

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

[systemd] No shutdown/reboot/suspend anymore from XBMC

Migrated my HTPC to systemd last night. So far so good, lirc still works, I found some Fedora xbmc service script that launches XBMC neatly. It looks good.

XBMC runs as my own user. However, whereas before I could suspend/shutdown/reboot just fine (through upower), that now does not work anymore. I have enabled (and started) the upower service:

$ systemctl list-units|grep -i upower
cpupower.service          loaded active exited        Apply cpupower configuration
upower.service            loaded active running       Daemon for power management

However, even with the upower service enabled all XBMC shows in the shutdown menu is a timer option and hibernate/suspend. The two last options definitely don't work. I have hit that button enough to know. Before, there were also restart/shutdown options visible. Those are gone. So all that's left is pushing the button on my HTPC to make it shut down.

XBMC service file:

[Unit]
Description = Starts instance of XBMC using xinit
After = syslog.target

[Service]
User = $user
Group = users

Type = simple
ExecStart = /usr/bin/xinit /usr/bin/xbmc-standalone -- :0

[Install]
WantedBy = multi-user.target

Any pointers?

Edit: NFS problem solved by enabling rpc-idmapd.service.

Last edited by .:B:. (2012-08-27 15:10:43)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#2 2012-08-27 14:05:49

Teho
Member
Registered: 2010-01-30
Posts: 200

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

Arch is still using the outdated upower 0.17 package. The latest version is 0.18 and it adds proper support for systemd:

New Features:
- Use systemd if possible for suspend and hibernate (Matthias Clasen)

I have it installed and those work on XBMC just fine.

Offline

#3 2012-08-27 15:05:52

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

Thanks, I'll give that a shot.

Edit: no dice with 0.9.18. Do you use a service file for XBMC? If not, how do you launch it?


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2012-08-27 15:22:06

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

I found some Fedora xbmc service script that launches XBMC neatly.

I guess that is your problem. There will be no proper user session created for your user if you launch XBMC from a service file (see also https://wiki.archlinux.org/index.php/Sy … rvice_file ).

For now, you have to use ck-launch-session from .xinitrc (or a display manager that supports CK). When polkit 107 hits the repos, you can (finally) get rid of consolekit.

Offline

#5 2012-08-27 16:50:47

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

Okay, thanks.

Edit: built and installed polkit 107. The options are back in the menu, and shutdown and reboot work. Will have to look into suspend/hibernate.

Last edited by .:B:. (2012-08-27 17:43:12)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2012-08-28 11:02:37

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

I was too quick: shutdown will just kill XBMC, nothing more. I tried using ck-launch-session in the service file, but to no avail. Guess it's back to the old .xinitrc way for now...


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2012-08-28 16:34:26

Elfo
Member
Registered: 2010-10-19
Posts: 25

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

Offline

#8 2012-08-28 20:47:57

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

Thanks Elfo, I'll have a look at those. Further inspection showed that the polkit service was actually failing. I just bumped the release from 105 and 107, built from ABS and installed 107. Turns out polkit needs its own user now (polkitd) and needs access to the root:root owned rules dirs as well. Fixed that one, but not getting any further.

Edit: there's a user-session-units package in the AUR (with deps) so I built and installed those. It works (XBMC autolaunches), and it seems like it's communicating with D-Bus, but no luck there (no suspend, no shutdown etc. and shutdown/reboot buttons are still gone):

23:12:09 T:140643986409344   DEBUG: DBus: Creating message to org.freedesktop.ConsoleKit on /org/freedesktop/ConsoleKit/Manager with interface org.freedesktop.ConsoleKit.Manager and method CanStop
23:12:09 T:140643986409344   DEBUG: DBus: Creating message to org.freedesktop.UPower on /org/freedesktop/UPower with interface org.freedesktop.UPower and method EnumerateDevices
23:12:10 T:140643986409344    INFO: Selected UPower and ConsoleKit as PowerSyscall
23:12:10 T:140643986409344   DEBUG: DBus: Creating message to org.freedesktop.ConsoleKit on /org/freedesktop/ConsoleKit/Manager with interface org.freedesktop.ConsoleKit.Manager and method CanStop
23:12:10 T:140643986409344   DEBUG: DBus: Creating message to org.freedesktop.ConsoleKit on /org/freedesktop/ConsoleKit/Manager with interface org.freedesktop.ConsoleKit.Manager and method CanRestart
23:12:10 T:140643986409344   DEBUG: DBus: Creating message to org.freedesktop.UPower on /org/freedesktop/UPower with interface org.freedesktop.DBus.Properties and method Get
23:12:10 T:140643986409344   DEBUG: Previous line repeats 1 times.
23:12:10 T:140643986409344   DEBUG: DBus: Creating message to org.freedesktop.UPower on /org/freedesktop/UPower with interface org.freedesktop.UPower and method EnumerateDevices

Edit: now it's not even starting anymore at boot, apparently it's waiting for some stuff to finish and bails out. God what an ordeal this is.

Last edited by .:B:. (2012-08-28 21:44:41)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#9 2012-09-03 13:09:57

dejavu
Member
Registered: 2008-05-26
Posts: 103

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

Hey,
probably someone find it useful:

xbmc.service

[Unit]
Description=xbmc
Requires=openbox.service
Wants=lircd.service tvheadend.service
After=openbox.service lircd.service tvheadend.service

[Service]
User=paul
Environment=DISPLAY=:0.0
#ExecStartPre=/usr/bin/amixer set Master 100
#ExecStartPre=/usr/bin/xrandr -s 1920x1080
ExecStart=/usr/bin/xbmc -fs --standalone
#Restart=always

[Install]
WantedBy=multi-user.target

openbox.service

[Unit]
Description=openbox

[Service]
User=paul
ExecStart=/usr/bin/xinit /usr/bin/openbox-session

[Install]
WantedBy=multi-user.target

tvheadend.service

[Unit]
Description=tvheadend
After=network.target

[Service]
EnvironmentFile=/etc/conf.d/tvheadend
PIDFile=/run/tvheadend.pid
ExecStart=/usr/bin/tvheadend $TVHEADEND_ARGS

[Install]
WantedBy=multi-user.target

- Commented lines are only for my special purpose
- Variable User has to be replaced
- File lircd.service can be found in the wiki

Offline

#10 2012-09-17 11:08:34

unikum
Member
From: Russia
Registered: 2010-09-04
Posts: 151
Website

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

I use following way:
- /etc/systemd/system/autologin.service

[Unit]
Description=Direct login to X
Documentation=man:mingetty(8)
After=systemd-user-sessions.service
Before=getty.target

[Service]
Restart=always
ExecStart=/sbin/mingetty --autologin xbmc tty7 linux
RestartSec=0

[Install]
WantedBy=graphical.target

- ~/.bash_profile

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

export BROWSER=chromium
export DE=xbmc
export SDL_VIDEO_FULLSCREEN_HEAD=0

export XDG_CACHE_HOME=/dev/shm/$USER/.cache
[[ ! -f $XDG_CACHE_HOME ]] && mkdir -p -m 0700 $XDG_CACHE_HOME

[[ $(tty) = "/dev/tty7" ]] && exec xinit ~/.xinitrc -- /usr/bin/X -nolisten tcp vt08 &>/dev/null
$ groups
disk network video audio optical storage power users

Also you can use slim with autologin.

Last edited by unikum (2012-09-17 12:55:35)

Offline

#11 2012-10-09 11:50:52

onny
Member
From: Europe
Registered: 2010-08-07
Posts: 46
Website

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

Did anyone successfully used automount with xbmc and systemd? Using "ck-launch-session xbmc" in .xinitrc won't work (after adding user to storage group and using autologin like this https://wiki.archlinux.org/index.php/Sy … vice_file)

Offline

#12 2012-10-09 14:22:08

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

onny wrote:

Did anyone successfully used automount with xbmc and systemd? Using "ck-launch-session xbmc" in .xinitrc won't work (after adding user to storage group and using autologin like this https://wiki.archlinux.org/index.php/Sy … vice_file)

1. This thread is about shutting down Arch via upower. Please do not hijack threads.
2. Don't use consolekit, use udisk.

Offline

#13 2013-09-23 20:26:06

debijan
Member
Registered: 2010-09-14
Posts: 37

Re: [systemd] No shutdown/reboot/suspend anymore from XBMC

I know the thread is already dead, but I fixed this like described here, maybe helps someone out:
https://wiki.archlinux.org/index.php/XB … nd_suspend

Offline

Board footer

Powered by FluxBB