You are not logged in.

#1 2013-03-20 04:58:40

sudoku
Member
Registered: 2012-10-31
Posts: 95

[SOLVED] xfce-session-logout does not work as expected

Hi archers,

I am having issues logging out correctly through xfce4-session-logout.

Logout sometimes lands me in LXDM (as expected) but some other times at a GUI-less terminal where I need to restart lxdm manually.
Reboot consistently fails to reboot and either lands me in LXDM or asks me for authentication in order to proceed.

Same if I use the command line, i.e. $ xfce4-session-logout --reboot

Does anyone know what might be causing these problems and how to start troubleshooting?

Thank you!

...and yes I am in the "power" group.

Last edited by sudoku (2013-03-22 04:58:53)

Offline

#2 2013-03-20 10:59:33

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [SOLVED] xfce-session-logout does not work as expected

I use SLiM (instead of LXDM) with XFCE and do not have problems such as you are having.  If you decide to try SLiM and have trouble with it, I can post my configuration files for using SLiM.

Offline

#3 2013-03-20 11:26:18

myrlin
Member
Registered: 2010-06-11
Posts: 297

Re: [SOLVED] xfce-session-logout does not work as expected

I'm having the same problem (using openbox/lxdm)

It only started a week or so ago, so it looks like an update issue. Unfortunately,  I cannot be more precise since it only happens under certain circumstances, and I only recently discovered the problem by chance.

The failure occurs when I log-out from one session, log-in again, then try to log-out from the second session. It makes no difference whether I use the same user, or a different one.  The problem then is persistent until a full reboot is carried out.

EDIT: I have just tried replacing lxdm with slim, and get the same problem.

EDIT2: Problem now confirmed on second computer (EeePC)

Last edited by myrlin (2013-03-20 15:06:38)

Offline

#4 2013-03-20 18:29:11

sudoku
Member
Registered: 2012-10-31
Posts: 95

Re: [SOLVED] xfce-session-logout does not work as expected

For me, the logout issue is single-user only. One user logs out well, the other crashes LXDM sometimes.

As a partial workaround I am using a custom launcher instead of the XFCE Logoff menu. Logout still gives me headaches, but at least Reboot and Shutdown now work as expected:

Logoff: xfce4-session-logout -l
Reboot: systemctl reboot
Shutdown: systemctl halt

Further insight would be welcome.

EDIT:

the Logoff issue has been solved by adding the following lines to /etc/lxdm/PostLogout:

if [ ! -z "$(pgrep lxdm)" ]
  then
	lxdm -d
fi

Last edited by sudoku (2013-03-20 21:22:04)

Offline

#5 2013-03-21 09:11:29

sudoku
Member
Registered: 2012-10-31
Posts: 95

Re: [SOLVED] xfce-session-logout does not work as expected

Actually not even the "systemctl reboot" and "systemctl halt" buttons work.

This computer has a multi user configuration, but when one user logs out, it still appears as if it were logged in

[user1@sudoku systemd]$ loginctl
   SESSION        UID USER             SEAT            
         2       1001 user2           seat0           

1 sessions listed.

Therefore halting and rebooting result in an error message:

[user1@sudoku systemd]$ systemctl reboot
User user2 is logged in on tty1.
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl reboot -i'.

Is there anything I can do to have LXDM fully log out users?

Last edited by sudoku (2013-03-21 09:11:40)

Offline

#6 2013-03-21 16:44:34

myrlin
Member
Registered: 2010-06-11
Posts: 297

Re: [SOLVED] xfce-session-logout does not work as expected

The "PostLogout" solution does not work for me.

In any case, I do not think this is an LXDM issue, since Slim is behaving in exactly the same way on my machines. Perhaps a permission/authorisation problem somewhere?

Offline

#7 2013-03-21 18:46:30

Eishorn
Member
From: somewhere
Registered: 2011-04-18
Posts: 36

Re: [SOLVED] xfce-session-logout does not work as expected

Seems to me that this could be the same or a similar problem I've had for about a week after updating to systemd198-1:
https://bbs.archlinux.org/viewtopic.php?id=159752

A quick and horrible looking workaround for me was to kill any user session in /etc/lxdm/PostLogout and then restart lxdm...

#!/bin/sh
#

# Kills all your processes when you log out.
killall --user $USER -TERM

# Sets the desktop background to solid grey.
xsetroot -solid "#323232"

# Kills PulseAudio
pax11publish -r

# Workaround to lxdm not deleting session since systemd 198-1
loginctl terminate-user user1 user2
systemctl restart lxdm

EDIT: tried around a bit - i can ommit the loginctl command here and just restart lxdm

Last edited by Eishorn (2013-03-21 18:56:37)

Offline

#8 2013-03-21 23:42:06

sudoku
Member
Registered: 2012-10-31
Posts: 95

Re: [SOLVED] xfce-session-logout does not work as expected

Thanks Eishorn,
I knew about the

killall --user $USER -TERM

hack but I didn't try the

loginctl terminate-user user1 user2

.
I will try and see now if it works, then update this post.

Myrlin,

misbehaviour during the logout was one of the reasons that convinced me to abandon Slim for LXDM. Slim does not support PostLogout scripts, so no corrective hacks are possible with it.

Offline

#9 2013-03-22 04:50:48

sudoku
Member
Registered: 2012-10-31
Posts: 95

Re: [SOLVED] xfce-session-logout does not work as expected

Ok, the final solution involves both the PostLogout hack and creating a custom menu.

in /etc/lxdm/PostLogout

# this makes sure lxdm is restarted if it crashes
if [ ! -z "$(pgrep lxdm)" ]
  then
	systemctl restart lxdm
fi

# this forces users to logout 
loginctl terminate-user user1 user2

Then a custom menu with:

Logoff: xfce4-session-logout --logout
Restart: systemctl reboot -i #won't work without -i as systemctl thinks users are still logged in
Restart: systemctl halt -i #won't work without -i as systemctl thinks users are still logged in

Marking as closed. Hope it helps someone.

Last edited by sudoku (2013-03-22 05:02:19)

Offline

#10 2013-03-22 06:51:42

ConfuseACat
Member
Registered: 2013-03-21
Posts: 18

Re: [SOLVED] xfce-session-logout does not work as expected

This was really helpful for me. LXDM on my system was crashing and I had no idea why.Can someone please add a link or walkthrough of this into the LXDM part of Arch Linux wiki?This is really important to know.

Last edited by ConfuseACat (2013-03-22 07:01:52)

Offline

#11 2013-03-22 06:54:32

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] xfce-session-logout does not work as expected

What do you mean "the LXDM part of Arch Linux"?  You mean the wiki?  You know that is community made, right?

Offline

#12 2013-03-22 14:54:41

myrlin
Member
Registered: 2010-06-11
Posts: 297

Re: [SOLVED] xfce-session-logout does not work as expected

Many thanks, Eishorn. Your fix worked perfectly for me (with Openbox).

Sudoku:

sudoku wrote:

misbehaviour during the logout was one of the reasons that convinced me to abandon Slim for LXDM. Slim does not support PostLogout scripts, so no corrective hacks are possible with it.

That's why I ditched it too! smile

Offline

#13 2013-03-25 17:05:10

darthpenguin
Member
Registered: 2011-09-16
Posts: 113

Re: [SOLVED] xfce-session-logout does not work as expected

Is there any fix for this issue with xfce/slim ?

Offline

#14 2013-03-25 18:05:31

sudoku
Member
Registered: 2012-10-31
Posts: 95

Re: [SOLVED] xfce-session-logout does not work as expected

Not that I know of. I ended up ditching Slim.

Offline

#15 2013-03-25 20:45:45

djraymondnm
Member
From: Socorro, NM, USA
Registered: 2011-12-28
Posts: 59
Website

Re: [SOLVED] xfce-session-logout does not work as expected

Eishorn's workaround also worked for me on lxdm.  I tried downgrading to systemd197-4 from 198-1 but this did
not solve the remaining problem with slim.  If one tries killing slim after it hangs on the second logout, switching
back to vc7 shows a raw X11 screen/cursor, suggesting that slim is having trouble killing the X11 server.  I haven't
figured out how to proceed beyond this point.  Any ideas?

Offline

#16 2013-03-26 06:18:02

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [SOLVED] xfce-session-logout does not work as expected

I am not having any problem logging out using SLiM and XFCE.  Here are some of my configuration files and things to check.  {aka the shotgun approach}

~ /.bashrc

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

~/.xinitrc

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

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

if [ -f $HOME/.Xmodmap ]; then
    /usr/bin/xmodmap $HOME/.Xmodmap
fi

# exec gnome-session
# exec startkde
exec startxfce4
# ...or the Window Manager of your choice
# exec ck-launch-session dbus-launch startxfce4

No /etc/initab file
No /etc/rc.conf
No /etc/rc.local

Hooks line from /etc/mkinitcpio.conf

HOOKS="base udev autodetect modconf block resume filesystems keyboard fsck"

If you make any changes here, you need to rebuild the image file with the following command

# mkinitcpio -p linux

/etc/slim.conf

# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
default_path        /bin:/usr/bin:/usr/local/bin
default_xserver     /usr/bin/X
xserver_arguments -nolisten tcp vt07

# Commands for halt, login, etc.
halt_cmd            /sbin/shutdown -h now
reboot_cmd          /sbin/shutdown -r now
console_cmd         /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
#suspend_cmd        /usr/sbin/suspend

# Full path to the xauth binary
xauth_path         /usr/bin/xauth 

# Xauth file for server
authfile           /var/run/slim.auth


# Activate numlock when slim starts. Valid values: on|off
# numlock             on

# Hide the mouse cursor (note: does not work with some WMs).
# Valid values: true|false
# hidecursor          false

# This command is executed after a succesful login.
# you can place the %session and %theme variables
# to handle launching of specific commands in .xinitrc
# depending of chosen session and slim theme
#
# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
# login_cmd           exec /bin/sh - ~/.xinitrc %session
login_cmd           exec /bin/bash -login ~/.xinitrc %session

# Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
# sessionstart_cmd	some command
# sessionstop_cmd	some command

# Start in daemon mode. Valid values: yes | no
# Note that this can be overriden by the command line
# options "-d" and "-nodaemon"
# daemon	yes

# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions            xfce4,icewm-session,wmaker,blackbox

# Executed when pressing F11 (requires imagemagick)
screenshot_cmd      import -window root /slim.png

# welcome message. Available variables: %host, %domain
welcome_msg         Welcome to %host

# Session message. Prepended to the session name when pressing F1
# session_msg         Session: 

# shutdown / reboot messages
shutdown_msg       The system is halting...
reboot_msg         The system is rebooting...

# default user, leave blank or remove this line
# for avoid pre-loading the username.
#default_user        simone

# Focus the password field on start when default_user is set
# Set to "yes" to enable this feature
#focus_password      no

# Automatically login the default user (without entering
# the password. Set to "yes" to enable this feature
#auto_login          no


# current theme, use comma separated list to specify a set to 
# randomly choose from
current_theme       default

# Lock file
lockfile            /var/lock/slim.lock

# Log file
logfile             /var/log/slim.log

The following 3 commands show my user status.

[dkb@myhost ~]$ loginctl show-session 1
loginctl show-session 1
Id=1
Timestamp=Mon 2013-03-25 23:25:52 MDT
TimestampMonotonic=54430497
DefaultControlGroup=name=systemd:/user/dkb/1
VTNr=7
Display=:0.0
Remote=no
RemoteUser=root
Service=slim
Leader=638
Audit=1
Type=x11
Class=user
Active=yes
State=active
KillProcesses=no
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Name=dkb
[dkb@myhost ~]$ loginctl show-user dkb
UID=1000
GID=100
Name=dkb
Timestamp=Mon 2013-03-25 23:25:52 MDT
TimestampMonotonic=54421783
RuntimePath=/run/user/1000
DefaultControlGroup=name=systemd:/user/dkb
Display=1
State=active
Sessions=1
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
[dkb@myhost ~]$ loginctl list-users
       UID USER            
      1000 dkb             

1 users listed.

EDIT:  One other thing.

[dkb@myhost ~]$ groups
lp wheel games network video optical storage scanner power users

Last edited by David Batson (2013-03-26 06:22:57)

Offline

#17 2013-03-26 19:42:08

sudoku
Member
Registered: 2012-10-31
Posts: 95

Re: [SOLVED] xfce-session-logout does not work as expected

David,

thanks for your input.

Are there other users sharing the computer with you?

I suppose the one of the problems here for me is that users are not cleanly logged out - therefore systemd refuses to reboot/shutdown from the DE.

I work it around by logging out and using lxdm to reboot/shutdown, which is not too bad.

As to lxdm crashing after logout, it is a single-user issue for me at least. One user has it and the other does not so maybe the problem really lies in some configuration.

Offline

#18 2013-03-26 20:23:33

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [SOLVED] xfce-session-logout does not work as expected

No, I do not share my computer.  Only have my user account and root.

Offline

#19 2013-03-26 20:42:47

djraymondnm
Member
From: Socorro, NM, USA
Registered: 2011-12-28
Posts: 59
Website

Re: [SOLVED] xfce-session-logout does not work as expected

darthpenguin wrote:

Is there any fix for this issue with xfce/slim ?

Slim's hanging after two logouts can be fixed by a hack similar to the one
reported above by Eishorn.  Activate the "sessionstop_cmd" line in
/etc/slim.conf as follows:

sessionstop_cmd	(killall --user $USER -TERM; systemctl restart slim)

This works for both icewm and lxde. I haven't tried xfce.

Offline

#20 2013-03-26 21:04:32

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 128

Re: [SOLVED] xfce-session-logout does not work as expected

There's an alternate fix for slim over in this thread: https://bbs.archlinux.org/viewtopic.php?id=159932

The gist of it: put slim into daemon mode by copying /usr/lib/systemd/system/slim.service to /etc/systemd/system and editing the copy so that the [Service] section looks like:

[Service]
Type = forking
PIDFile = /run/lock/slim.lock
ExecStart=/usr/bin/slim

Then edit /etc/slim.conf and uncomment the line:

daemon yes

After this, you need to:

systemctl stop slim.service
systemctl disable slim.service
systemctl daemon-reload
systemctl enable slim.service
systemctl start slim.service

Offline

#21 2013-03-28 23:37:55

darthpenguin
Member
Registered: 2011-09-16
Posts: 113

Re: [SOLVED] xfce-session-logout does not work as expected

djraymondnm wrote:
darthpenguin wrote:

Is there any fix for this issue with xfce/slim ?

Slim's hanging after two logouts can be fixed by a hack similar to the one
reported above by Eishorn.  Activate the "sessionstop_cmd" line in
/etc/slim.conf as follows:

sessionstop_cmd	(killall --user $USER -TERM; systemctl restart slim)

This works for both icewm and lxde. I haven't tried xfce.

This worked! Thx! big_smile

loserMcloser wrote:

There's an alternate fix for slim over in this thread: https://bbs.archlinux.org/viewtopic.php?id=159932

The gist of it: put slim into daemon mode by copying /usr/lib/systemd/system/slim.service to /etc/systemd/system and editing the copy so that the [Service] section looks like:

[Service]
Type = forking
PIDFile = /run/lock/slim.lock
ExecStart=/usr/bin/slim

Then edit /etc/slim.conf and uncomment the line:

daemon yes

After this, you need to:

systemctl stop slim.service
systemctl disable slim.service
systemctl daemon-reload
systemctl enable slim.service
systemctl start slim.service

This did not work sad sorry.

Last edited by darthpenguin (2013-03-28 23:39:45)

Offline

#22 2013-03-29 02:58:49

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 128

Re: [SOLVED] xfce-session-logout does not work as expected

darthpenguin wrote:

...

This did not work sad sorry.

Works over here. Sorry it didn't work for you. sad

killall --user $USER -TERM

is not so great a solution for me, since it would kill processes unrelated to my X session (like if I'm logged in on another VT, or if I've got a detached screen session going, etc.)

I'm hoping a "pacman -Syu" will fix this in the near future and eliminate the need for these hacks, since this bug is pretty annoying, and the "solutions" all have their own downsides.

cheers

Offline

#23 2013-03-29 03:27:05

darthpenguin
Member
Registered: 2011-09-16
Posts: 113

Re: [SOLVED] xfce-session-logout does not work as expected

The solution was a bit more complicated than option given by djraymondnm. It is possible I just did something wrong. I didn't realize that

killall --user $USER -TERM

would affect other VTs but i guess that makes sense. I too hope a fix is implemented soon. This is problem with bleeding-edge distro. We get all the bugs. smile

Offline

#24 2013-03-29 05:17:17

sudoku
Member
Registered: 2012-10-31
Posts: 95

Re: [SOLVED] xfce-session-logout does not work as expected

If you are looking for a less aggressive solution, this line should just kill X-processes and childs:

ps --user $USER | cut -f1,2 -d' ' | egrep "\?$" | cut -d' ' -f1 | xargs kill

Or, just exclude ssh and screen processes

ps --user $USER | egrep -v "ssh|screen" | cut -b11-15 | xargs kill

(from: https://wiki.archlinux.org/index.php/LX … _Behavior)

Last edited by sudoku (2013-03-29 05:36:57)

Offline

#25 2013-03-30 02:34:11

darthpenguin
Member
Registered: 2011-09-16
Posts: 113

Re: [SOLVED] xfce-session-logout does not work as expected

Whoa.... O.o ...... duuuuuuuuude.. cool

I gotz to get better at the command-line. This is awesome. Thanks.

Offline

Board footer

Powered by FluxBB