Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)
How to make XBMC shutdown Linux?
Have you bothered reading the thread? Sorry. I was patient at first and helpful because this was an interesting problem that there isn't a lot of help for. But it's getting @#(* circular.

I've posted my upstart script AND posted a link to it again at least once. There are other upstart scripts posted and linked too.
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
vikjon0 Wrote:2) Testing. OK, the purpose of the sudoer file is to make it possible to use sudo for one or many commands without password question. You need to test this in terminal. Forget about xbmc until it is working in terminal.
=> 100% agreeing. Now I managed to make it work having some of my typos pointed out Big Grin

3) Precision.
Ok, computers tends to be bit stupid. If you edit something like the sudoer you have to do it EXACLY right. Do not enter crap that looks a bit like somthing your friend told you about. What do you expect? Copy/paste someone?
=>
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt, /sbin/poweroff, /sbin/pm-suspend # XBMC
xbmc ALL=(ALL) NOPASSWD:SHUTDOWN_CMDS, MOUNT_CMDS # XBMC

THIS allowed me to get a sudo shutdown now to work without any pwd request from tty.

Next is to get the shutdown/poweroff from XBMC :]
Reply
Haven't ventured on the Upstart side of things yet but anyone got better luck since those last 2 days of update ?
Reply
I give upSmile

once again im going back to the desktop version of Ubuntu.
Reply
Its annoying me to much so i had to try again.

This is what i did on 10.10 server:

sudo apt-get install python-software-properties –y
sudo apt-get update
sudo apt-get upgrade –y
sudo add-apt-repository ppa:ubuntu-audio-dev/ppa
sudo apt-get update
sudo apt-get install linux-alsa-driver-modules-$(uname -r)
sudo apt-get install binutils gcc –y
sudo wget http://us.download.nvidia.com/XFree86/Li....09.07.run
sudo sh ./NVIDIA-Linux-x86-275.09.07.run
sudo apt-get install pm-utils policykit-1 upower –y
sudo add-apt-repository ppa:ricotz/unstable
sudo apt-get update
sudo apt-get install alsa –y
sudo nano /etc/modprobe.d/sound.conf
options snd-hda-intel probe_mask=0x101
sudo reboot
sudo alsamixer
sudo alsactl store 0
sudo nano .asoundrc

pcm.!default {
type plug
slave {
pcm "hdmi"
}
}
sudo reboot
sudo add-apt-repository ppa:mario-sitz/ppa
sudo apt-get update
sudo apt-get install xbmc xinit x11-xserver-utils xbmc-standalone –y

I added the script that BurningSky posted on this forum:

# xbmc-standalone
description "Autostart XBMC"

start on (filesystem and stopped udevtrigger)
stop on runlevel [06]

task
console output
emits starting-x

script
su xbmc -c "startx /etc/X11/Xsession /usr/bin/xbmc-standalone"
end script


When i restart i get the terminal login. When i login and manually do:
su xbmc -c "startx /etc/X11/Xsession /usr/bin/xbmc-standalone" XBMC starts after entering my password ( it shouldn't i assume ?) It also works if i manually do su xbmc -c "xinit xbmc" or just xinit xbmc(-standalone )

What am i missing to make it autostart?
I also added xbmc ALL=(ALL) in the sudoers file

Thank you in advance and sorry for asking the same question like 100 others

Best regards,

Henkske
Reply
Ive got suspend/resume(from power button)/reboot/shutdown working from the xbmc gui on a x64 of Natty. The problem seems to be that when a window manager isnt launched without the use of a desktop manager policy-kit sees it as a non local session and doesnt allow certain features like rebooting or mounting usb drives. I do things a little different though, as I use fluxbox as a WM and have it launch xbmc on startup as I find it makes like easier when using emulators, but Im guessing you can substitute the fluxbox command with the xbmc command in the ~/.xinitrc script.

Firstly I used the great XBMCbuntu guide (with some bits from this guide) to do a base install of xbmc, although I only added the svn ppa and used that to install the dependencies needed to build xbmc from source. I did install the xbmc-live package but have since removed this as I boot into fluxbox. The final deviation from this guide was using monkeyman's /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla instead of the version in the guide (Im not sure if this makes a difference as its the only version I tried with).

Next I enabled auto-login with the help of this MythTV wiki article. The Upstart section is the one to follow for natty. I used tty2 as I only have two tty's available.

I used this ArchLinux wiki article to start X automatically on boot with the second ~/.bash_profile listed. This ArchLinux wiki article shows how to use the ~/.xinitrc script to launch the WM. Take note of the policy kit enrty as I think this is where the inability to reboot/etc stems from.

Here are my config files:

Code:
cat /etc/init/tty2.conf
# tty2 - getty
#
# This service maintains a getty on tty2 from the point the system is
# started until it is shut down again.

start on runlevel [23]
stop on runlevel [!23]

respawn
exec /sbin/mingetty --autologin=xbmc tty2

Code:
cat ~/.bash_profile
if [[ ! $DISPLAY && ! -e /tmp/.X11-unix/X0 ]] && (( EUID )); then
  exec startx
fi

Code:
cat ~/.xinitrc
exec ck-launch-session startfluxbox

Code:
cat .fluxbox/startup
#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# Change your keymap:
xmodmap "/home/xbmc/.Xmodmap"

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &
/usr/lib/xbmc/xbmc.bin &


# And last but not least we start fluxbox.
# Because it is the last app you have to run it with ''exec'' before it.

exec fluxbox
# or if you want to keep a log:
# exec fluxbox -log "/home/xbmc/.fluxbox/log"

Next is to get the remote working as it should with natty!
Reply
i had also an issue with natty and shutdown
i created the following pkla file

[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes


See also http://cobradevil.org/index.php?title=XB...Zotac-id31

it is very basic and more a reminder for myself

With kind regards

William
Reply
  • 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)

Logout Mark Read Team Forum Stats Members Help
How to make XBMC shutdown Linux?0
This forum uses Lukasz Tkacz MyBB addons.