[LINUX] How to auto start LIRC with xbmc-standalone?
#1
Hi, im running Ubuntu 9.10 and XBMC. Everything is running perfectly. But i cant autostart LIRC. i have to run

sudo /etc/init.d/lirc start

to start the service, and then go to xbmc-standalone session to be able to use the remote control.

As i Said everything is perfectly. I just cant make LIRC auto start.

Thanks in advance,
Hugs
Reply
#2
Sorry, i realy need help... I´m on it for hours! im getting crazy
Reply
#3
I may be well off base but have you checked your /etc/lirc/hardware.conf
I think the line
Code:
START_LIRCD="true"
may deal with it if you haven't got that set already?
Reply
#4
I may be well off base but have you checked your /etc/lirc/hardware.conf
I think the line
Code:
START_LIRCD="true"
may deal with it if you haven't got that set already?
Reply
#5
its alrealy like this at /etc/lirc/hardware.conf

i even tried boot-up manager app to set lirc on startup. but still do not autostartup.

Hugs an thanks
Reply
#6
does irw output anything when you run it?


D
Reply
#7
While I realize this is not terribly helpful, LIRC starts by default with xbmc-standalone for me, so it's odd that it's not starting by itself in xbmc-standalone.

What you could try is this:

The xbmc-standalone session is (at least in my case) controlled by the xbmc-standalone file stored in /usr/local/bin.

if you open this file via

Code:
sudo nano /usr/local/bin/xbmc-standalone

you should be able to add the startup command there. I use this method to start irxevent on startup (which allows the use of some customized remote commands), so it might work in your case as well.

I believe it would just involve you including

Code:
/etc/init.d/lirc start

at the beginning of that file (below the #!/bin/sh line). To test this, just update the xbmc-standalone file, save it, reboot (or maybe just restart gdm) and see if it has lirc has started.

Give it a whirl and let us know if it works. I'm somewhat skeptical that it will since lirc starts by itself for me without this step, so I wonder if it is another underlying problem, but it seems worth a try.
------------------------------------------
Dharma Quick Setup Guide:
XBMC tips on the TechNazgul Blog
------------------------------------------
Reply
#8
hi guys,

myrison was right lirc autostart at xbmcstandalone. But not always, thats the weird part.

The lirc just autoboot sometimes, and its kinda random.
I tested restart the CPU several times and some times it started others not.
i added the code line to
Quote:/usr/bin/xbmcstandalone
and booted. too sad it didnt started

i booted again and nothing,(real tries)
i booted again and nothing,
i booted again and nothing,
booted again and then it started!
i booted again and nothing,
i booted again and nothing,
i booted again and nothing,
i booted again and nothing,
-giveup-


IRW works, but just before i start lircd(if it havent started randomly at that session).

I thought that could be something at bios or some issue at the receiver. but going back to gnome and starting the service and going back to standalone the lirc works normal.

Weird... Should i call ghostbusters?
Reply
#9
I had a similar problem and I found a solution that seems to work and learned a bunch at the same time:

Running
Code:
sudo /etc/init.d/lirc start
tells init (the service that starts all other services) to start lirc.

Your system can operate in one of a few runlevels. Runlevel 1 and S are single user modes. Runlevels 2 through 5 are multi user. Runlevel 0 is shutdown and runlevel 6 is reboot. Each runlevel has a folder containing links to scripts that init should start or stop when the system enters that runlevel. The folders are
Code:
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d

Run
Code:
cd /etc
ls rc*

and you will get something similar to the following
Code:
rc.local

rc0.d:
K19lirc       K20joystick       README                  S15wpa-ifupdown  S30urandom       S35networking  S60umountroot
K19setserial  K30etc-setserial  S10unattended-upgrades  S20sendsigs      S31umountnfs.sh  S40umountfs    S90halt

rc1.d:
K19lirc  K20joystick  K20rsync  README  S30killprocs  S70dns-clean  S70pppd-dns  S90single

rc2.d:
README  S19lirc  S20fancontrol  S20joystick  S50rsync  S70dns-clean  S70pppd-dns  S99grub-common  S99ondemand  S99rc.local

rc3.d:
README  S19lirc  S20fancontrol  S20joystick  S50rsync  S70dns-clean  S70pppd-dns  S99grub-common  S99ondemand  S99rc.local

rc4.d:
README  S19lirc  S20fancontrol  S20joystick  S50rsync  S70dns-clean  S70pppd-dns  S99grub-common  S99ondemand  S99rc.local

rc5.d:
README  S20fancontrol  S20joystick  S50rsync  S70dns-clean  S70pppd-dns  S99grub-common  S99ondemand  S99rc.local

rc6.d:
S19lirc       K20joystick       README                  S15wpa-ifupdown  S30urandom       S35networking  S60umountroot
K19setserial  K30etc-setserial  S10unattended-upgrades  S20sendsigs      S31umountnfs.sh  S40umountfs    S90reboot

rcS.d:
README  S30etc-setserial  S37apparmor  S46setserial  S55urandom  S62lirc  S70screen-cleanup  S70x11-common  S75policykit

Notice I have a bunch of different "S19lirc" files. These are all symlinks to the same location: the startup script for lirc in /etc/init.d. The S means it should start and the number represents the order it starts up in. K means a service should be killed at that runlevel.

I added "S62lirc" in runlevel S (folder rcS.d), so that lirc starts just before X starts up. I picked the number 62 because it was between "S55urandom" and "S70screen-cleanup" and "S70x11-common". Pick a number so that lirc will start 1 or 2 processes before x11-common does.

Code:
cd /etc/rcS.d
sudo ln -s /etc/init.d/lirc S62lirc

All the other symlinks had 777 permissions so I made my new link the same
Code:
sudo chmod 777 S62lirc

Reboot and cross your fingers. LIRC still fails to start for me sometimes, but now it is 1 of 20 times instead of 1 of 2 like before.

I also learned that since Ubuntu 9.10 (I am running 10.04) upstart gets used instead of init to start services, but upstart still starts the links in the /etc/rc.d folders. I think the "proper" way to start lirc would be with an upstart script, but I have yet to figure that out.Huh
Reply
#10
Smile 
I think this is simpler and works all the time.
In terminal mode create a folder in /usr/bin, let's call it xbmc.sh
enter the following:
Code:
sudo gedit /usr/bin/xbmc.sh

while in the editor add the following lines:
Code:
#!/bin/bash
gksudo start service lirc restart
exec xbmc-standalone
exit 0

save the file and exit
then set the xbmc.sh file to execute with the following command:
Code:
sudo chmod +x xbmc.sh

Now we have to edit the sudoers file to allow execution of administrative tasks
without entering a pass word.
enter the vi editor with the following:
Code:
sudo visudo

This editor does not use the mouse so you must naviate with the keyboard.
Change the last line from:
Code:
%admin ALL=(ALL) ALL
to:
Code:
%admin ALL=NOPASSWD: ALL

use control o to save the change and control x to exit
This operation will now allow you to execute administrative tasks without using
a password.

A safer option is to use the NOPASSWD option with just the service lirc restart
command instead of the %admin statement above. To do this create an alias in the sudoers file with the following:
Code:
sudo visudo

then insert this:
Code:
Cmnd_Alias LIRC_CMD = service lirc restart

after the "#Cmnd alias specificaton" line.

and then insert this:
Code:
ALL ALL=(ALL) NOPASSWD: LIRC_CMD

after the "#User privilege specification" line.

Now in terminal mode you can test by entering:
Code:
xbmc.sh

If you are happy with the result place the xbmc.sh command in the autostart program list.
System>Preferences>Startup Applications

Or you can create a desktop icon that launches xbmc.sh from the desktop.
You should now be good to go. Lirc will start and then xbmc will start and you can use your remote.
Reply
#11
I have been running Dharma Beta 3 since it was released and noticed I did not have to start lirc.
Reply
#12
Use the proper way to start the service as mjuchli says.

You need a symlink starting with the letter S, then a 2digit priority which points to /etc/init.d/lircd

This is assuming you've used the ubuntu config files to configure lircd.

I, for one, chose to create a custom config file, and start it with /etc/rc.local instead with one command that I can backup easier between builds compared to the several config files ubuntu normally uses.
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] How to auto start LIRC with xbmc-standalone?0