You are not logged in.

#1 2012-05-07 20:45:30

postino87
Member
Registered: 2012-05-07
Posts: 13

[SOLVED] LXDE Reboot/Shutdown only shown after logout

Hi all guys.

I've recently switched from KDE desktop to LXDE, but i'm having some problems with these DE.

The first one I'd like to fix is the Reboot/Shutdown issue.
When i click on the logout button in the menu, the popup window only show these option: suspend, hibernate and logout.

So i'm not able to shutdown and reboot.

After searching and reading many thread around the web, i've tried to logout and then do a startx from command line.
After the lxde restart in the popup window i can see the option for shutdown and reboot, and they works properly.

So why they appear only after a X restart ??

Here's my .xinitrc:

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

exec ck-launch-session dbus-launch startlxde

And here's the groups of my user:
[lorenzo@archlxde ~]$ groups
lp wheel network audio storage power users


Even if there's a lot of thread about this, i still can't find a solution that works for me.

Any suggestion ??

Thanks a lot anyway.

Last edited by postino87 (2012-05-08 12:29:57)

Offline

#2 2012-05-07 20:47:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

How do you start lxde initially?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2012-05-07 20:52:59

postino87
Member
Registered: 2012-05-07
Posts: 13

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

It start automatically from .xinitrc i think.

If can help, this is my inittab:

#
# /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/agetty -8 -s 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux

# Serial Virtual Console for KVM and others VMs
#s0:2345:respawn:/sbin/agetty -8 -s 9600 ttyS0 linux

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

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

# Example lines for starting a login manager
#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
x:45:once:/bin/su lorenzo -l -c "/bin/bash --login -c startx >/dev/null 2>&1"

xt:5:wait:/usr/bin/chvt 7
# End of file

Offline

#4 2012-05-07 21:02:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

Odd.  Yes, it should start the same way both times.  I was wondering whether a display manager was in the mix, but it seems not.

One potential difference is that on the initial boot, startx is run from a login shell, but not necessarily an "interactive" shell which does read rc files a bit differently AFAIK.

It's a long shot, but it'd be a simple test to edit that inittab line as follows

x:5:once:/bin/su lorenzo -l -c "/bin/bash --login -i -c startx >/dev/null 2>&1"

If that doesn't work, then I'm currently stumped.  If it does work, you can look into ~/.bashrc or other files read by an interactive session to see what the relevant difference could be.

Edit ... NM the previous edit.

Last edited by Trilby (2012-05-07 21:13:20)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2012-05-07 21:11:49

postino87
Member
Registered: 2012-05-07
Posts: 13

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

Just tried out your suggestion but unfortunately nothing seems to be changed.

Always same problem here

Offline

#6 2012-05-07 21:17:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

Well ... I'm stumped.

One other info-gathering step I can think of would be to boot to rl 3.  You can hit "e" at grub and append a "3" to the kernel line, then "b" to boot to that entry.

Once in run level 3, loging on tty1 and then run startx at the command prompt.  If you are able to reboot or shutdown from the menu in that session, then we'll know there is some difference in the starting of x that is relevant.  If not, we'll know that there must be something that happens during the first X session that makes the 2nd one work.

If anyone else has ideas, they'd probably be better than mine, but this is at least one way of narrowing the problem down step by step.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2012-05-07 21:38:16

postino87
Member
Registered: 2012-05-07
Posts: 13

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

starting in run level 3 in the tty1 did the trick !
Thanks a lot Trilby

So, now i've to understand what's the difference between the inittab method and the startx from normal shell.

I'll try to find out something around the web.
Meanwhile, if you have any other ideas about this, will be great wink

Thanks for the moment

Offline

#8 2012-05-07 22:08:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

I'm not sure where to look next, but you may just settle with booting to rl 3 and using an auto login.  Check out the wiki pages on auto login to a vt, and starting x at boot.

The basics can be seen in these excerpts from my inittab and ~/.bashrc

# inittab replace USERNAME with your user name.
c1:2345:respawn:/sbin/agetty -a USERNAME -8 -s 38400 tty1 linux
# bashrc
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
  xinit
# or  startx
fi

The result should look and act just like booting to rl 5 the way you had it, but it may sidestep the problem you've encountered.

My curiosity makes me want to know what leads to the problem, but the above suggestion may make it a moot point.

Last edited by Trilby (2012-05-07 22:10:46)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2012-05-07 22:16:36

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

Trilby wrote:

My curiosity makes me want to know what leads to the problem, but the above suggestion may make it a moot point.

It's explained on the wiki page:

Another way of circumventing display managers and booting straight into a preferred window manager or desktop environment involves editing /etc/inittab.

Note: This method will not use /bin/login or register your session, therefore no session will appear in who or w. Your session will also not be authorized as 'local' by ConsoleKit, so you will be unable to shutdown/suspend/reboot or mount drives without using sudo or su.

The xorg-sessreg package might help here, I did a bit of research on that a while back, but I never actually tried it. I'm rather staying far, far away from consolekit smile

Last edited by Gusar (2012-05-07 22:19:27)

Offline

#10 2012-05-07 22:23:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

D'Oh ... my curiosity has been satiated - as has my humility hmm


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2012-05-08 12:25:53

postino87
Member
Registered: 2012-05-07
Posts: 13

Re: [SOLVED] LXDE Reboot/Shutdown only shown after logout

Ok, I've got it.

Following the wiki, i've removed the autostart x line from inittab and added this line:
c1:2345:respawn:/sbin/agetty -a lorenzo -8 -s 38400 tty1 linux
to automatically login in tty1 .

Then i've added the script to automatically start x to bash_profile

#
# ~/.bash_profile
#

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
  exec startx
  # Could use xinit instead of startx
  #exec xinit -- /usr/bin/X -nolisten tcp vt7
fi

[[ -f ~/.bashrc ]] && . ~/.bashrc

Finally it works !!

Thanks a lot guys for your help.
Have a nice day.

Last edited by postino87 (2012-05-08 12:26:10)

Offline

Board footer

Powered by FluxBB