You are not logged in.

#1 2017-03-05 03:42:39

jvmcarneiro
Member
Registered: 2017-03-04
Posts: 12

[SOLVED] How to fix persistently broken session

Suddenly many odd behaviors started showing up in my X session using Xmonad and no DM.
One of them is the inability to start Dunst daemon (xinit doesn't manage to start it and there is no other notification daemon running):

$ killall dunst
dunst: no process found
$ dunst
Name Lost. Is Another notification daemon running?

Another is this error when trying to call shutdown commands:

$ reboot
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to talk to init daemon.

They don't seem like common or even related issues, but they started happening at the same time and unfortunately I don't know what I was up to at the time or even if it was just a pacman -Syu that caused them.

In my investigations I came across this General Troubleshooting section and by running the command I noticed my session was not activated.

$ loginctl show-session $XDG_SESSION_ID
EnableWallMessages=no
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
IdleHint=yes
IdleSinceHint=1488666920810012
IdleSinceHintMonotonic=668265934
DelayInhibited=sleep
InhibitDelayMaxUSec=5s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
RemoveIPC=yes
RuntimeDirectorySize=209190912
InhibitorsMax=8192
NCurrentInhibitors=1
SessionsMax=8192
NCurrentSessions=1
UserTasksMax=10813

Which can be confirmed by:

$ loginctl user-status
jcarneiro (1000)
	   Since: Sat 2017-03-04 19:26:51 -03; 2h 5min ago
	   State: closing
	Sessions: *c1
	  Linger: no
	    Unit: user-1000.slice

What can I do about it? The suggestions in the General Troubleshooting page were of no help (I didn't install any of the graphical polkit authentication agents due to not using a DE).

Last edited by jvmcarneiro (2017-03-06 00:56:46)

Offline

#2 2017-03-05 04:01:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] How to fix persistently broken session

You don't have an active session. How do you start X? (Please paste the relevant files; eg., .profile and xinitrc).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-03-05 04:56:41

jvmcarneiro
Member
Registered: 2017-03-04
Posts: 12

Re: [SOLVED] How to fix persistently broken session

I start it by doing a startx in virtual console.

.xinitrc:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

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

setxkbmap -layout us -variant altgr-intl -option nodeadkeys
xset +fp /usr/share/fonts/local &

feh --bg-scale ~/Pictures/export.png

dunst &

exec xmonad

.bash_profile:

#
# ~/.bash_profile
#

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

.bashrc:

#
# ~/.bashrc
#

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

# Path
export PATH="~/.vim/plugged/vimpager:~/bin:~/.gem/ruby/2.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"

# Other Global Variables
export PAGER="vimpager"
export MANPAGER="${PAGER}"

# Aliases
alias less="${PAGER}"
alias zless="${PAGER}"
alias ls="ls --color=auto"

# Other Configs
PS1="[\u@\h \W]\$ "

# Enable BASE16 color schemes to shell
BASE16_SHELL=$HOME/.config/base16-shell/
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"

# Add .Xresources colors to console
# if [ "$TERM" = "linux" ]; then
# 	_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'
# 	for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do
# 		echo -en "$i"
# 	done
# 	clear
# fi

.xserverrc:

#!/bin/sh
exec /usr/bin/Xorg -nolisten tcp "$@" vt$XDG_VTNR

I don't have a .profile, just /etc/profile which I never touched:

# /etc/profile

#Set our umask
umask 022

# Set our default path
PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Source global bash config
if test "$PS1" && test "$BASH" && test -z ${POSIXLY_CORRECT+x} && test -r /etc/bash.bashrc; then
	. /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

Offline

#4 2017-03-05 05:03:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] How to fix persistently broken session

That all looks OK. What are the permissions on .xserverrc?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2017-03-05 06:00:38

jvmcarneiro
Member
Registered: 2017-03-04
Posts: 12

Re: [SOLVED] How to fix persistently broken session

Here:

-rw-r--r--  1 jcarneiro jcarneiro     60 Feb  3 17:18 .xserverrc

Same for all other dotfiles in home.

Offline

#6 2017-03-05 06:15:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] How to fix persistently broken session

Can you try this?

Add these lines to your .bash_profile:

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

Rename or move your .serverrc and then logout and login again (make sure you are on TTY1). Then check your session.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2017-03-05 16:04:43

jvmcarneiro
Member
Registered: 2017-03-04
Posts: 12

Re: [SOLVED] How to fix persistently broken session

X starts right after login and killing it returns me to login screen, but session still doesn't activate:

$ loginctl user-status
jcarneiro (1000)
	   Since: Sun 2017-03-05 09:40:11 -03; 9min ago
	   State: closing
	Sessions: *c3
	  Linger: no
	    Unit: user-1000.slice

No changes in show-session either:

$ loginctl show-session $XDG_SESSION_ID
EnableWallMessages=no
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
IdleHint=no
IdleSinceHint=1488718097750012
IdleSinceHintMonotonic=817205747
DelayInhibited=sleep
InhibitDelayMaxUSec=5s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
RemoveIPC=yes
RuntimeDirectorySize=209190912
InhibitorsMax=8192
NCurrentInhibitors=1
SessionsMax=8192
NCurrentSessions=1
UserTasksMax=10813

One of the recent additions I've made was to configure Chrony and set up a NetworkManager dispatcher script for it. I believe the problems started more recently than that, but could there be a relation?

Offline

#8 2017-03-05 16:22:23

loqs
Member
Registered: 2014-03-06
Posts: 17,434

Re: [SOLVED] How to fix persistently broken session

So before you run startx the session is broken?
If so please create a new user login to a tty with that user and check if that users session is also broken.

Offline

#9 2017-03-05 16:54:29

seth
Member
Registered: 2012-09-03
Posts: 51,652

Re: [SOLVED] How to fix persistently broken session

if the new user is affected as well:

hostnamectl
df -h
ls -l /run/systemd/sessions

Online

#10 2017-03-05 18:51:32

jvmcarneiro
Member
Registered: 2017-03-04
Posts: 12

Re: [SOLVED] How to fix persistently broken session

Yeah, session is broken even before startx. However, when using a new user, or even logging in with my user on another tty, the session activates. The problem is only with my user login in tty1.

Here's some more output:

$ loginctl user-status
jcarneiro (1000)
	   Since: Sun 2017-03-05 12:32:18 -03; 1min 55s ago
	   State: closing
	Sessions: *c1
	  Linger: no
	    Unit: user-1000.slice
		  ├─session-c1.scope
		  │ ├─252 login -- jcarneiro
		  │ ├─417 -bash
		  │ ├─586 /bin/sh /usr/bin/startx
		  │ ├─608 xinit /home/jcarneiro/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -auth /tmp/serverauth.kIDNE3SAVP
		  │ ├─609 /usr/lib/xorg-server/Xorg -nolisten tcp :0 vt1 -auth /tmp/serverauth.kIDNE3SAVP
		  │ ├─610 xf86-video-intel-backlight-helper intel_backlight
		  │ ├─614 /home/jcarneiro/.xmonad/xmonad-x86_64-linux
		  │ ├─628 urxvt -name scratchpad
		  │ ├─629 bash
		  │ ├─662 urxvt
		  │ ├─663 bash
		  │ ├─686 loginctl user-status
		  │ └─687 sh -c ~/.vim/plugged/vimpager/vimpager
		  └─user@1000.service
		    └─init.scope
		      ├─342 /usr/lib/systemd/systemd --user
		      └─344 (sd-pam)

Mar 05 12:32:18 net-arch systemd[342]: Starting Timed resync...
Mar 05 12:32:18 net-arch systemd[342]: Reached target Default.
Mar 05 12:32:25 net-arch profile-sync-daemon[351]: chromium sync successful
Mar 05 12:32:25 net-arch profile-sync-daemon[351]: mv: cannot move '/home/jcarneiro/.surf/' to a subdirectory of itself, '/home/jcarneiro/.surf/-backup'
Mar 05 12:32:25 net-arch profile-sync-daemon[351]: ln: failed to create symbolic link '/home/jcarneiro/.surf/null': File exists
Mar 05 12:32:43 net-arch login[252]: pam_systemd(login:session): Failed to create session: Connection timed out
Mar 05 12:32:45 net-arch login[252]: LOGIN ON tty1 BY jcarneiro
Mar 05 12:33:09 net-arch profile-sync-daemon[351]: surf resync successful
Mar 05 12:33:11 net-arch systemd[342]: Started Timed resync.
Mar 05 12:33:11 net-arch systemd[342]: Startup finished in 53.151s.
$ hostnamectl
   Static hostname: net-arch
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 70f615ba2b2c41d3b5d9f3330dbd7b5d
           Boot ID: e42602bb3e4346ae8c1f21c2eb554ccb
  Operating System: Arch Linux
            Kernel: Linux 4.9.13-1-lts
      Architecture: x86-64
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             988M     0  988M   0% /dev
run             998M  616K  997M   1% /run
/dev/sda1       226G  9.8G  205G   5% /
tmpfs           998M  2.4M  996M   1% /dev/shm
tmpfs           998M     0  998M   0% /sys/fs/cgroup
tmpfs           998M  8.0K  998M   1% /tmp
tmpfs           200M  101M   99M  51% /run/user/1000
$ ls -l /run/systemd/sessions
total 4
-rw-r--r-- 1 root root 251 Mar  5 12:33 c1

The profile-sync-daemon stuff is for managing browser profiles in tmpfs to go easy on disk writes when running the system from a flash drive (which I'm not doing right now).

Offline

#11 2017-03-05 20:04:51

seth
Member
Registered: 2012-09-03
Posts: 51,652

Re: [SOLVED] How to fix persistently broken session

df and hostname are dead end, but why is

Mar 05 12:32:43 net-arch login[252]: pam_systemd(login:session): Failed to create session: Connection timed out

This https://www.bountysource.com/issues/320 … ut-on-boot suggests a "bad" user service could trigger

Otherwise, what's

echo $DBUS_SESSION_BUS_ADDRESS

In doubt also dump "ps fax" and "stat /run/dbus/system_bus_socket"

Online

#12 2017-03-05 23:16:38

jvmcarneiro
Member
Registered: 2017-03-04
Posts: 12

Re: [SOLVED] How to fix persistently broken session

Spot on!
The surf sync issue with Profile-sync-daemon was causing the login to timeout. All it took was to remove surf from BROWSERS in psd.conf and voila! Session activates without trouble, with notifications and power options working as intended:

$ loginctl user-status
jcarneiro (1000)
	   Since: Sun 2017-03-05 14:25:46 -03; 8min ago
	   State: active
	Sessions: *c1
	  Linger: no
	    Unit: user-1000.slice
		  ├─session-c1.scope
		  │ ├─256 login -- jcarneiro
		  │ ├─401 -bash
		  │ ├─569 /bin/sh /usr/bin/startx
		  │ ├─591 xinit /home/jcarneiro/.xinitrc -- /etc/X11/xinit/xs
		  │ ├─592 /usr/lib/xorg-server/Xorg -nolisten tcp :0 vt1 -aut
		  │ ├─593 xf86-video-intel-backlight-helper intel_backlight
		  │ ├─596 /home/jcarneiro/.xmonad/xmonad-x86_64-linux
		  │ ├─608 dunst
		  │ ├─612 urxvt -name scratchpad
		  │ ├─613 bash
		  │ ├─684 urxvt
		  │ ├─685 bash
		  │ ├─715 loginctl user-status
		  │ └─716 sh -c ~/.vim/plugged/vimpager/vimpager
		  └─user@1000.service
		    ├─dbus.service
		    │ └─603 /usr/bin/dbus-daemon --session --address=systemd:
		    └─init.scope
		      ├─351 /usr/lib/systemd/systemd --user
		      └─353 (sd-pam)

Mar 05 14:25:46 net-arch systemd[351]: Starting Profile-sync-daemon...
Mar 05 14:25:47 net-arch systemd[351]: Started Profile-sync-daemon.
Mar 05 14:25:47 net-arch systemd[351]: Starting Timed resync...
Mar 05 14:25:47 net-arch systemd[351]: Reached target Default.
Mar 05 14:25:53 net-arch profile-sync-daemon[359]: chromium sync successful
Mar 05 14:25:57 net-arch systemd[351]: Started Timed resync.
Mar 05 14:25:57 net-arch systemd[351]: Startup finished in 11.046s.
Mar 05 14:25:57 net-arch login[256]: LOGIN ON tty1 BY jcarneiro
Mar 05 14:27:03 net-arch systemd[351]: Started D-Bus User Message Bus.
Mar 05 14:27:03 net-arch dbus-daemon[603]: Successfully activated service 'or

I had this setup for a long time, probably a recent update in surf messed things up.

Removing it from the list was a temporary solution, I wanted to take a look on how to fix it and document it here. Can I edit this comment after the thread is closed? I'll mark it as solved.

Offline

Board footer

Powered by FluxBB