Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am attempting to build a FreeBSD + XBMC based media box. Everything is all working fine except for one point.

I need to boot XBMC as an RCNG startup script, which is all fine, except:

If the command to start X and XBMC is run in the foreground all works fine. If it is pushed to the background (with &) it starts to work then is kicked out (I think) by getty starting.

Is there some way of stopping getty from killing X, or am I barking up completely the wrong tree?


rcng script:

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: xbmc
# REQUIRE: sshd
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable xbmc:
#
# xbmc_enable="YES"
#
# You will also need to fill in the xbmc_flags="" variable to suit your configuration.
#

xbmc_enable=${xbmc_enable:-"NO"}
xbmc_flags=${xbmc_flags:-""}

. /etc/rc.subr

name=xbmc
rcvar=`set_rcvar`
#required_files="/usr/local/etc/xbmc.conf"

xbmc_start() {
        PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
        HOME=/root
        /usr/local/bin/xinit /usr/local/bin/xbmc       # adding & makes it all fail
}

start_cmd=xbmc_start

#command=/usr/local/bin/xbmcboot

load_rc_config $name
run_rc_command "$1"

One more note - when it does kick it out the screen is screwed. It shows me the first bit of the X.Org startup messages and that's all. No login, no control over it, no ability to start X again even remotely.


I have now turned off ttyv2 and upwards in the /etc/ttys - it has stopped the screen from locking up when it kicks out Xorg (gives me a normal getty prompt), but it still kicks it out. So it's deffinately getty / init related.


Ok, I am 100% convinced it's to do with getty starting up. If I put the commands to start the x session in a script with a sleep 5 in it so the X session doesn't actually start until after getty has started running it all works fine.

While I can live with this for now, it would be nice to understand why it behaves like this and maybe get it to start up more friendly.

share|improve this question

1 Answer 1

  • I think you are missing a REQUIRE line, so that it is started at the right point. I would try something like
 # REQUIRE: LOGIN syscons
  • In your /etc/ttys did you configure something like xdm/gdm/kdm ? You might even try to start your program from /etc/ttys
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.