LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Ho do I get xfce to run at boot (http://www.linuxquestions.org/questions/linux-from-scratch-13/ho-do-i-get-xfce-to-run-at-boot-4175439605/)

EDDY1 12-01-2012 12:52 PM

Ho do I get xfce to run at boot
 
I installed Xorg, X11 & am able to use startx to get to x
I have installed xfce4, xfwm & also can get to xfec-session.

Now I would like to have xfce4 start on boot.
I have however gotten xfce to start on boot on a prior archlinux install, but cannot get it to start on boot in my lfs install.

I've compared inittab on my Debian install to lfs nothing different between the 2.
I cannot find any documentation other than archlinux & gentoo documentation which refers to making entries to xinitrc to start desktop at boot but I think the config files are different.

After posting I see that gdm has a blfs bootscript going to chek it out.

Keith Hedger 12-01-2012 02:01 PM

Add:
id:5:initdefault:

somwhere at the front of inittab

And:

x:5:respawn:/usr/bin/slim >& /dev/null

Somwhere at the end and change "/usr/bin/slim" to whatever login manager you are using or you can probably use "startx" or "startxfce4"

EDDY1 12-01-2012 02:41 PM

Thank you that worked
x:5:respawn:startxfce4 >& /dev/null

Keith Hedger 12-03-2012 10:55 AM

If you don't want to run a login manager you can try what I do for my rescue partition:

Use
Code:

id:3:initdefault:
in inittab as the default runlevel.

Copy this:
Code:

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
        exec startx
fi

into ~./profile

Put this ( if you use xfce4, change as needed ):
Code:

exec dbus-launch --exit-with-session xfce4-session
as the last line of ~/.xinitrc.

Then if you login on tty1 as normal ( login/password ) your X session will be started or you can login on another tty to start a shell session.

This is a good way of starting an X session without having to install a login manager, ( I use this to login to my rescue/backup/restore partition ).

EDDY1 12-03-2012 02:53 PM

I am able to login to xfce, but the only problems I'm experiencing are:
Only root login & login is password-less.
I would like to login to my user account, which isn't in xfce login screen.
Also if I login to root I want to put password.

Keith Hedger 12-03-2012 03:50 PM

In inittab
Code:

id:5:initdefault:
...
...
x:5:respawn:/etc/defaultuser >& /dev/null

Create file /etc/defaultuser containing:
Code:

#!/bin/bash

USERNAME=keithhedger

su $USERNAME -c  startx

Make executable
Code:

sudo chmod +x /etc/defaultuser
Change keithhedger to whatever user you want to auto login.
Reboot - Voila!

EDDY1 12-04-2012 01:42 AM

Thank you. That helped now I can just use su or sudo after login instead of always being in root.

ssanthshtech 05-21-2013 10:54 AM

xinit with my application not geting on boot
 
followed same as above but iam using xinit. want to display window launcher on boot time using xinit with user account and having only one tty (tty1).

if [ -z "$DISPLAY" ] && [ $(tty) = /dev/tty1 ]; then

su -c "xinit ./myapp" <username>

fi

now my app wants to display at boot time without asking password in user account

EDDY1 05-21-2013 12:22 PM

Is this a LFS system?
post #2 & #6 is what got it going

ssanthshtech 05-21-2013 11:40 PM

this my inittab
 
# Begin /etc/inittab

id:3:initdefault:

si::sysinit:/etc/rc.d/init.d/rc sysinit

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/bin/echo "Sorry, can't do that."

#su:S016:once:/sbin/sulogin

#1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
1:2345:respawn:/sbin/agetty -n -l /usr/sbin/autologin tty1 9600
#2:2345:respawn:/sbin/agetty tty2 9600
#3:2345:respawn:/sbin/agetty tty3 9600
#4:2345:respawn:/sbin/agetty tty4 9600
#5:2345:respawn:/sbin/agetty tty5 9600
#6:2345:respawn:/sbin/agetty tty6 9600
#c0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100

# End /etc/inittab


using only one terminal

EDDY1 05-22-2013 02:12 AM

You should have 6 terminals try id:5

ssanthshtech 05-22-2013 02:46 AM

i Commented all other terminals
 
ok i tried like that also

# Begin /etc/inittab

#id:3:initdefault:

id:5:initdefault:

si::sysinit:/etc/rc.d/init.d/rc sysinit

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

#su:S016:once:/sbin/sulogin

#1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
1:2345:respawn:/sbin/agetty -n -l /usr/sbin/autologin tty1 9600
#2:2345:respawn:/sbin/agetty tty2 9600
#3:2345:respawn:/sbin/agetty tty3 9600
#4:2345:respawn:/sbin/agetty tty4 9600
#5:2345:respawn:/sbin/agetty tty5 9600
#6:2345:respawn:/sbin/agetty tty6 9600
#c0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100

x:5:respawn:/etc/defaultuser >& /dev/null

# End /etc/inittab



created a file /etc/defaultuser
#!/bin/bash

USERNAME=user

su $USERNAME -c xinit

sudo chmod +x /etc/defaultuser

i have a autologin.c file

int main()
{
execlp( "login", "login", "-f", "user", 0);
}

compiled using gcc autologin.c -o autologin

and saved it to /usr/sbin/autologin

Now my system booting as user and it cant display xinit at startup(boot).

ssanthshtech 05-24-2013 02:57 AM

Suggest something
 
Any Suggestions wr iam wrong

EDDY1 05-24-2013 10:01 AM

What are you trying to accomplish getting rid of autologin, or have the 6 terminals available.
For 6 terminals uncomment the 1's that you commmented out.
As far as autologin you've put a script in for autologin, not sure if it should be removed or changed, someone here can help you, if that is what you desire.


All times are GMT -5. The time now is 01:25 PM.