Upower not shutting down/rebooting system
#1
I am launching Xbmc directly from inittab, which went fine until a few days ago the new consolekit (on Arch) messed things up. Turns out consolekit doesn't register autologin sessions from inittab as local ones, so the user isn't granted shutdown/reboot/suspend/... privileges necessary for 'normal' operation.

Apparently, mingetty does play nice with consolekit so I am now using that to launch Xbmc directly upon boot. That seemed to work fine for a bit, however, shutdown or reboot from Xbmc is still not working. Upower is acting a bit bizarre. This is what Xbmc prints when I try to shut down:

Code:
22:12:04 T:3024189312 M:104931328   DEBUG: ExecuteXBMCAction : Translating XBMC.Shutdown()
22:12:04 T:3024189312 M:104931328   DEBUG: ExecuteXBMCAction : To XBMC.Shutdown()
22:12:04 T:3024189312 M:105099264   DEBUG: DBus: Creating message to org.freedesktop.UPower on /org/freedesktop/UPower with interface org.freedesktop.UPower and method AboutToSleep
22:12:04 T:3024189312 M:105091072   DEBUG: DBus: Creating message to org.freedesktop.UPower on /org/freedesktop/UPower with interface org.freedesktop.UPower and method Suspend
22:12:04 T:3024189312 M:105091072   DEBUG: CAnnouncementManager - Announcement: Suspend from xbmc
22:12:04 T:3024189312 M:105078784   DEBUG: ------ Window Deinit (DialogButtonMenu.xml) ------
22:12:04 T:3024189312 M:104894464   DEBUG: CAnnouncementManager - Announcement: Sleep from xbmc

I do seem to be able to reboot thoughn but shutting down seems to confuse upower. Clicking the suspend button seems to work normally (except that I haven't set up suspend, so...):

Code:
22:20:25 T:3024435072 M:126164992   DEBUG: ExecuteXBMCAction : Translating XBMC.Suspend()
22:20:25 T:3024435072 M:126164992   DEBUG: ExecuteXBMCAction : To XBMC.Suspend()
22:20:25 T:3024435072 M:126164992   DEBUG: DBus: Creating message to org.freedesktop.UPower on /org/freedesktop/UPower with interface org.freedesktop.UPower and method AboutToSleep
22:20:25 T:3024435072 M:126164992   DEBUG: DBus: Creating message to org.freedesktop.UPower on /org/freedesktop/UPower with interface org.freedesktop.UPower and method Suspend
22:20:25 T:3024435072 M:126103552   DEBUG: CAnnouncementManager - Announcement: Suspend from xbmc
22:20:25 T:3024435072 M:126103552   DEBUG: ------ Window Deinit (DialogButtonMenu.xml) ------
22:20:25 T:3024435072 M:126103552   DEBUG: CAnnouncementManager - Announcement: Sleep from xbmc

Running Xbmc 10.0 here (tagged SVN checkout).
* MikroTik RB5009UG+S+IN :: ZyXEL GS1900-8HP v1 :: EAP615-Wall v1 :: Netgear GS108T v3 running OpenWrt 23.05
* LibreELEC 11:  HTPC Gigabyte Brix GB-BXA8-5545 with CEC adapter, Sony XR-64A84K :: Desktop AMD Ryzen 7 5800X / Sapphire Nitro+ Radeon 6700XT  / 27" Dell U2717D QHD
* Debian Bookworm x86_64: Celeron G1610, NFS/MariaDB/ZFS server
* Blog
Reply
#2
Firstof, read my signature about what you are supposed to include in a bugreport, no darn truncated debuglogs, we know what we are looking for, not you Smile

Also all and every bit of information about the system, how you installed upower etc. We have tested it and it works, it is most likely something you have done wrong when installing UPower.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#3
My apologies. I'll give you the darn full log then Wink

Upower has been installed through pacman, official package provided by Arch. Installation is up to date, 2.6.32 LTS kernel. i686 architecture. As I said, it worked fine before. Given there's no user interaction during upower installation (no config files, except dbus stuff that a regular user is not supposed to touch), I am not really sure what I could have done wrong there Smile.

Hardware specs: 1st Gen AppleTV (Pentium M CPU, 256 MB RAM, GeForce 7300 Go GPU, Broadcom CrystalHD miniPCI-E).

Skin is Cirrus, if that matters.

Xbmc is launched like this:

Code:
#
# /etc/inittab
#

#  Runlevels:
#    0    Halt
#    1(S)    Single-user
#    2    Not used
#    3    Multi-user
#    4    Not used
#    5    X11
#    6    Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
#id:3:initdefault:
# Boot to X11
id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
c1:2345:respawn:/sbin/mingetty --autologin stijn tty1 linux
#c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux

# Hypervisor Virtual Console for Xen and KVM
#h0:2345:respawn:/sbin/agetty -8 38400 hvc0 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Example lines for starting a login manager
#x:5:respawn:/bin/su stijn -l -c "/bin/bash --login -c startx >/dev/null 2>&1"
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1

# End of file

~/.xinitrc
Code:
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/lib/X11/xinit/.Xresources
sysmodmap=/usr/lib/X11/xinit/.Xmodmap

# Merge in defaults and keymaps
[ -f $sysresources ] && xrdb -merge $sysresources
[ -f $sysmodmap ] && xrdb -merge $sysmodmap
[ -f $userresources ] && xrdb -merge $userresources
[ -f $usermodmap ] && xrdb -merge $usermodmap

# Use dbus-launch if installed.
if test x"${DBUS_SESSION_BUS_ADDRESS}" = x""; then
    dbuslaunch=$(which dbus-launch)
    if test x"${dbuslaunch}" != x"" -a x"${dbuslaunch}" != x"no"; then
        eval $(${dbuslaunch} --sh-syntax --exit-with-session)
    fi
fi

# Launch Xbmc without further redo!
exec ck-launch-session /usr/bin/xbmc --standalone --nolirc &> /dev/null
#exec ck-launch-session /usr/bin/openbox-session

# Lower the clock of the GPU
( sleep 5 && sudo nvidia-settings -a GPUOverclockingState=1 ) &
( sleep 5 && sudo nvidia-settings -a GPU2DClockFreqs=200,800 ) &

~/.bash_profile
Code:
. $HOME/.bashrc

# Start X if we're in runlevel 5
if [[ -z $DISPLAY && $(tty) == /dev/tty1 && `who -r | cut -c20` = 5 ]]; then
        startx
fi

Consolekit registers the session(s) as local:
Code:
$ ck-list-sessions
Session1:
    unix-user = '1000'
    realname = ''
    seat = 'Seat1'
    session-type = ''
    active = FALSE
    x11-display = ''
    x11-display-device = ''
    display-device = '/dev/tty1'
    remote-host-name = ''
    is-local = TRUE
    on-since = '2011-02-04T21:47:00.364197Z'
    login-session-id = '1'
    idle-since-hint = '2011-02-04T21:47:31.004356Z'
Session2:
    unix-user = '1000'
    realname = ''
    seat = 'Seat1'
    session-type = ''
    active = TRUE
    x11-display = ':0'
    x11-display-device = '/dev/tty2'
    display-device = '/dev/tty1'
    remote-host-name = ''
    is-local = TRUE
    on-since = '2011-02-04T21:47:12.126275Z'
    login-session-id = '1'

Thanks for looking Smile.
* MikroTik RB5009UG+S+IN :: ZyXEL GS1900-8HP v1 :: EAP615-Wall v1 :: Netgear GS108T v3 running OpenWrt 23.05
* LibreELEC 11:  HTPC Gigabyte Brix GB-BXA8-5545 with CEC adapter, Sony XR-64A84K :: Desktop AMD Ryzen 7 5800X / Sapphire Nitro+ Radeon 6700XT  / 27" Dell U2717D QHD
* Debian Bookworm x86_64: Celeron G1610, NFS/MariaDB/ZFS server
* Blog
Reply
#4
hehe, nice Smile Seems to work in that debug log though? All you are doing is suspend there?
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#5
No, I'm actually doing shutdown... That's the ifffy part (lines 480-488 of the log).
* MikroTik RB5009UG+S+IN :: ZyXEL GS1900-8HP v1 :: EAP615-Wall v1 :: Netgear GS108T v3 running OpenWrt 23.05
* LibreELEC 11:  HTPC Gigabyte Brix GB-BXA8-5545 with CEC adapter, Sony XR-64A84K :: Desktop AMD Ryzen 7 5800X / Sapphire Nitro+ Radeon 6700XT  / 27" Dell U2717D QHD
* Debian Bookworm x86_64: Celeron G1610, NFS/MariaDB/ZFS server
* Blog
Reply
#6
XBMC.Shutdown is an abstract thing, it triggers whatever it is linked to. Settings system and you can choose which default shutdown method is.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#7
For future reference:
Going to System -> settings -> system -> power saving and making sure 'Shutdown' is selected as default shutdown mode does the trick.

Apparently, Xbmc does a check at startup to check system capabilities, and will set powerdown by default (if possible), and fall back to suspend if you don't have shutdown permissions (which the consolekit upgrade messed up - I don't think I had suspend privileges either, but it set the fallback option either way).

Thanks topfs2 Smile
* MikroTik RB5009UG+S+IN :: ZyXEL GS1900-8HP v1 :: EAP615-Wall v1 :: Netgear GS108T v3 running OpenWrt 23.05
* LibreELEC 11:  HTPC Gigabyte Brix GB-BXA8-5545 with CEC adapter, Sony XR-64A84K :: Desktop AMD Ryzen 7 5800X / Sapphire Nitro+ Radeon 6700XT  / 27" Dell U2717D QHD
* Debian Bookworm x86_64: Celeron G1610, NFS/MariaDB/ZFS server
* Blog
Reply
#8
.:B:. Wrote:For future reference:
Going to System -> settings -> system -> power saving and making sure 'Shutdown' is selected as default shutdown mode does the trick.

Apparently, Xbmc does a check at startup to check system capabilities, and will set powerdown by default (if possible), and fall back to suspend if you don't have shutdown permissions (which the consolekit upgrade messed up - I don't think I had suspend privileges either, but it set the fallback option either way).

Thanks topfs2 Smile

have the same probleme here on my Arch System...
Have you solved it by downgrading consolekit?
Or what was the problem?
Reply
#9
r4pid Wrote:have the same probleme here on my Arch System...
Have you solved it by downgrading consolekit?
Or what was the problem?

After my recent update on arch, I couldn't shutdown, restart or suspend from XBMC. The problem for me was consolekit as well. The quick fix was to downgrade consolekit. The correct fix in my case was to autologin properly so it registers with consolekit. I used the mingetty autologin described in this thread to fix it...

https://bbs.archlinux.org/viewtopic.php?pid=887106

Hope this helps
Reply
#10
I changed to autologin with mingetty, but I still can't choose 'shutdown' in xbmc settings Sad
Reply
#11
Do I understand correctly that when you select the exit menu (options: Exit, Shutdown, Suspend, Reboot), selecting Shutdown translates to whatever is set to the default XBMC shutdown option in System -> Power?

If so, how can I achieve that selecting the Shutdown option from the menu results in shutting down my PC, while pressing the Power button on the remote results in suspending it?
Reply
#12
r4pid Wrote:I changed to autologin with mingetty, but I still can't choose 'shutdown' in xbmc settings Sad

I need some more information about your issue to help you. Did downgrading consolekit fix it? How do you start XBMC? Is it from within your arch linux system or is it a standalone xbmc? When did this issue start happening for you?
Reply
#13
hyness Wrote:I need some more information about your issue to help you. Did downgrading consolekit fix it? How do you start XBMC? Is it from within your arch linux system or is it a standalone xbmc? When did this issue start happening for you?

Downgrading consolekit helps...but thats no final solution Wink
I start XBMC with mingetty autologin and .xinitrc:

/etc/inittab
Code:
c2:2345:respawn:/sbin/mingetty --autologin r4pid tty1 linux

.xinitrc
Code:
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
exec ck-launch-session /usr/bin/xbmc --standalone &> /dev/null

.bash_profile
Code:
if [[ -z $DISPLAY && $(tty) = /dev/tty1 && `who -r | cut -c20` = 5 ]];
then
startx
fi

I have installed XBMC before a few weeks, so the issue was always there...
Reply
#14
Ok, that information helps, and I'm pretty sure we are on the right track. There are only two differences between our configs.

1. My mingetty starts on c1 instead of c2.
2. I start xbmc as follows
exec ck-launch-session /usr/bin/xbmc-standalone

I suspect that the dbus stuff is your problem, but I'm really a novice at this stuff. I can tell you that this fixed my issue that you are experiencing. If neither of these things help, I would recommend going over to the arch linux forums or for more instant help the archlinux irc channel on freenet.
Reply
#15
brulsmurf Wrote:If so, how can I achieve that selecting the Shutdown option from the menu results in shutting down my PC, while pressing the Power button on the remote results in suspending it?

I solved this (I think) by replacing "XBMC.ShutDown()" with "XBMC.Suspend()" in the remote.xml keymap file.
Reply

Logout Mark Read Team Forum Stats Members Help
Upower not shutting down/rebooting system0