[SOLVED] problem after 'up' -> xsession: cannot write to /tmp

superwow

First off, VSIDIANS, sorry to post here after such a long period of silence, and then pop in as a lurker with a problem.

Initially I installed VSIDO on an internal flash volume partitioned to 8 gb (and several other partitions for various stuffs). I tend to run a fairly minimal system and have not installed too much, just scientific & data analytics software, and a slew of NCURSES lovelies, and have had flawless operations since my last post several months ago. Honestly, so few pains I have begun to get lazy! So, kudos VO, mainly a painfree (and junkfree) system.

But last weekend I installed a handfull of strategies games like chess, go, mahjong, etc. I reckon they were sizeable because a day or so later, I updated with 'up', worked a bit, shutdown, and rebooted later. On boot, I get to the screen which asks for my username and pw, enter it, and then get to an error message, approximately: 'xsession: cannot write to /tmp; xsession will not start' or somesuch. This means I cannot actually log in and am stuck on the login screen. Attempts to re-login always take me to the xsession cannot write message then back to the login screen. When I live boot from my VSIDO usbdrive, the install partition is nearly full. I am not sure if the culprits are the games, or the millions of updates I have had recently, or just my not frequently running 'apt-get clean,' or a cosmic thread or something.

I want to just log into the console/terminal, without the xsession or any graphical interface & clean house; but when I select 'e' or 'tab' from the x option in the lxde log in screen, the console options do not have apt, rm, or other bash shop cleaning utilities as far as I can tell. So, how can I log into a full console, but no xsession? I am sure there is a way to do this, but I just don't know how. Any pointers?

statmonkey

#1
If you are just trying to get to a shell use ctl+alt+F1

I would suspect that the startup script for lightdm is borked.  I believe it is in the /usr folder and you should be able to get to it once you get to the shell. 

Added:

I believe the issue is probably the file lightdm.conf unfortunately I hacked mine all up and set it so that it now points into my home folder (because I kept seeing this type of issue) and not sure where the original is.  I will look and post back.

statmonkey

#2
By the way lightdm was recently "updated" and there was a new "conf" file included by the maintainer.  I am guessing that your issue is not a coincidence. :)

Sorry for the double post.

Try this:

Get to your login screen and hit:

ctl+alt+F1 together
Login

Once you get there run startx and see what you get.  I am guessing it will tell you something about lightdm if not post it here.  If so

nano /etc/lightdm/lightdm.conf

look for lines that like:
display-setup-script=somewhere/outthere/default.sh
session-setup-script=probably/thesamefile/default.sh

close it and check that file I am guessing that this is your issue.

superwow

Awesome! Thanks for the advice! Now I know how to get to the terminal sans x.

But when I run startx at CLI (ie - typing that command, 'startx', on terminal), no joy. "startx: command not found"

Aside from that, a handy cat of /etc/lightdm/lightdm.conf shows that nearly the entire file is commented out, and there is no startup or display setup script associated with those lines you mentioned, which are also commented out.

Guess I have to deal with startx first though. Or do you mean xinit?

PackRat

#4
startx is part of xinit.

Install xinit with apt and you will have startx

When your logged into the console, also check the permissions of /tmp  and that it still exists. It's been a long time, but I had an error similar to -

'xsession: cannot write to /tmp;

and it was because somehow the permissions got messed up. Never found an explanation for it, just some bug.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

statmonkey

Yes, I expected that.

Beaten to the punch!  Thanks PackRat!

As PackRat says that will give you startx but I still think you will not be able to get into the system on a standard reboot.  Once you have startx installed do a reboot and if lightdm doesn't work as normal do as follows.

Once you have a shell

That file lightdm.conf should be mostly commented out.  So not to worry. There are some lines that aren't commented out.  They should be about line 83 and are in the section labelled [SeatDefaults]
These are:

   user-session=fluxbox #in my case this is openbox but sure you are using flux
   session-wrapper=/etc/X11/Xsession
   display-setup-script=/path/foldername/default.sh #your path will be unique
   session-setup-script=/path/foldername/default.sh #probably same as above

So open up the /etc/lightdm/lightdm.conf file and find these lines.
if you post what you have in the file along with the contents of that default.sh file and paste it in here we can sort it out.  That is where the problem is I am sure.  Lightdm is calling something that either goes nowhere or is failing at that point.  I am pretty confident about this but it has been a while since I played with Lightdm.

You also might want to have a look at http://www.mattfischer.com/blog/?p=343 as it will give you an idea of what is going on here.

superwow

Much thanks to both @statmonkey and @packrat. And, this is fun!

So logging into bash via the alt+control+fn+f1 looks just like the terminal, just on the whole screen. All bash apps are there. Sudo apt-get install xinit does what it does. Then going into my completely commented out lightdm.conf (commented except for the headings, which are bracketed), I changed

  #user-session=default
  #session-wrapper=lightdm-session
  #display-setup-script=
  #session-setup-script=

to

  user-session=fluxbox
  session-wrapper=/etc/X11/Xsession
  display-setup-script=/path/onmysystemto/default.sh #my path is in example
  session-setup-script=/path/onmysystemto/default.sh

then did a swift "rm /tmp/*" to get rid of the junk that was in there, and did a "sudo apt-get clean",

and then did "ls -l /" and looks like my /tmp folder has slightly unusual permissions, though they may be correct for Debian. A quick look at some of the Debian groups suggests my permissions are proper (drwxrwxrwt). But websearches are not my friend on this matter since I am getting differing advice on the matter. What should the permissions on /tmp be? And if I need to change them, what is the proper way (I have already had sad runins with chmod and would like advice before I burn down the house).

After I did those things, I did 'sudo shutdown -r now' several times but still no X, and worse, now there is no login screen. I can still get to bash via ctrl+alt+fn+f1 though.

Thanks for the help, and now, back to you.

PackRat

#7
Your /tmp permissions are correct.

I get the feeling that lightdm (the binary itself, not the configuration) is messed up on your system. You can still get to a console with ctrl-alt-F1, correct? If so you can try this to see if you can log into X.

1. Boot up and get to a console.
2. Shut down lightdm -  should be able to do it with


sudo systemctl stop lightdm


3. create a simple ~/.xinitrc using nano (or your favorite cli text editor)


#!/bin/sh
xfce4-terminal &
exec /usr/bin/startfluxbox


save it and exit nano

4. startx

Hopefully you log into fluxbox and have an open xfce4-terminal; if anything else is whacked, you can use the terminal to exit etc ....

Edit -

This isn't literal is it -


display-setup-script=/path/onmysystemto/default.sh #my path is in example
session-setup-script=/path/onmysystemto/default.sh


those lines need to match your system.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

statmonkey

PackRat is correct.  Where the issue is in the actual default.sh that you are pointing to.  Open the default.sh file as described in PackRat's post and check the following.  In mine I have the following and only the following lines active.

This is all in the [SeatDefaults] section

xserver-allow-tcp=false

greeter-session=lightdm-greeter
greeter-hide-users=false


user-session=fluxbox

session-wrapper=/etc/X11/Xsession
display-setup-script=/usr/share/default.sh

session-setup-script=/usr/share/default.sh


Check that these paths are correct and that there is an actual file in the usr/share folder called default.sh

All that file should be is the screen parameters you can open it as root with nano and look at it.  I use Xrandr so mine is a little "unique" lol but anyway you can check it out.  My guess is once you are pointing to the correct files the errors will go away and you will be able to run lightdm and be off and running.

jedi

You might also want to log in with a live USB/CD and make sure you haven't ran out of space.  I would try to clear up some free space.  In you first post you mention it is quite full...
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

superwow

Thanks all for the advice. Here's my update:

1) @packrat, your advice worked. First, yes, I can access bash via ctrl+alt+fn+f1. Using "locate default.sh" I found it; it was in
  /usr/share/doc/acpid/examples/default.sh
and that is what my actual lightdm.conf reflects.

I followed your advice to shutdown lightdm, created a new ~/.xinitrc file, which - I don't even know why - somehow disappeared, and ran startx. That did the trick.

2) @statmonkey, my lightdm.conf file reads almost as yours does. I just left all the commented stuff in it though, but the uncommented stuff is almost the same as what you list.

3) @jedi, I cleaned /tmp with rm /tmp/*. I know, that is probably not the most elegant solution, but, it seemed to do the trick. Course, I shoulda been using 'apt-get clean' more often. With all the massive SID updates of late, and my recent game dl's, I should have known better.

As to why my ~/.xinitrc file disappeared, that is a mystery, but for now, I am typing this via Iceweasel from my normal looking Fluxbox VSIDO. I have yet to shutdown and log back in, but I am guessing it should work.

Thanks to all for the help!

PackRat

#11
X is working, and looks like no issue with your apps.

It remains to be seen if lightdm works for you - /usr/share/doc/acpid/default.sh looks like a text file related to the acpi daemon, did you open it with a test editor?

Edit - I opened it - it's not related to lightdm, it's a script for logging acpi events.

I'm beginning to sense a purge and re-install of lightdm in your future.

here is my /etc/lightdm/lightdm.conf - I haven't edited it at all so it's stock. Looks like everything is commented out, give it a try if you want:

#
# General configuration
#
# start-default-seat = True to always start one seat if none are defined in the configuration
# greeter-user = User to run greeter as
# minimum-display-number = Minimum display number to use for X servers
# minimum-vt = First VT to run displays on
# lock-memory = True to prevent memory from being paged to disk
# user-authority-in-system-dir = True if session authority should be in the system location
# guest-account-script = Script to be run to setup guest account
# log-directory = Directory to log information to
# run-directory = Directory to put running state in
# cache-directory = Directory to cache to
# sessions-directory = Directory to find sessions
# remote-sessions-directory = Directory to find remote sessions
# greeters-directory = Directory to find greeters
#
[LightDM]
#start-default-seat=true
#greeter-user=lightdm
#minimum-display-number=0
#minimum-vt=7
#lock-memory=true
#user-authority-in-system-dir=false
#guest-account-script=guest-account
#log-directory=/var/log/lightdm
#run-directory=/var/run/lightdm
#cache-directory=/var/cache/lightdm
#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions
#remote-sessions-directory=/usr/share/lightdm/remote-sessions
#greeters-directory=/usr/share/lightdm/greeters:/usr/share/xgreeters

#
# Seat defaults
#
# type = Seat type (xlocal, xremote)
# xdg-seat = Seat name to set pam_systemd XDG_SEAT variable and name to pass to X server
# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
# xserver-layout = Layout to pass to X server
# xserver-config = Config file to pass to X server
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
# xserver-share = True if the X server is shared for both greeter and session
# xserver-hostname = Hostname of X server (only for type=xremote)
# xserver-display-number = Display number of X server (only for type=xremote)
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
# xdmcp-port = XDMCP UDP/IP port to communicate on
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option)
# unity-compositor-timeout = Number of seconds to wait for compositor to start
# greeter-session = Session to load for greeter
# greeter-hide-users = True to hide the user list
# greeter-allow-guest = True if the greeter should show a guest login option
# greeter-show-manual-login = True if the greeter should offer a manual login option
# greeter-show-remote-login = True if the greeter should offer a remote login option
# user-session = Session to load for users
# allow-guest = True if guest login is allowed
# guest-session = Session to load for guests (overrides user-session)
# session-wrapper = Wrapper script to run session with
# greeter-wrapper = Wrapper script to run greeter with
# guest-wrapper = Wrapper script to run guest sessions with
# display-setup-script = Script to run when starting a greeter session (runs as root)
# display-stopped-script = Script to run after stopping the display server (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)
# autologin-guest = True to log in as guest by default
# autologin-user = User to log in with by default (overrides autologin-guest)
# autologin-user-timeout = Number of seconds to wait before loading default user
# autologin-session = Session to load for automatic login (overrides user-session)
# autologin-in-background = True if autologin session should not be immediately activated
# exit-on-failure = True if the daemon should exit if this seat fails
#
[SeatDefaults]
#type=xlocal
#xdg-seat=seat0
#xserver-command=X
#xserver-layout=
#xserver-config=
#xserver-allow-tcp=false
#xserver-share=true
#xserver-hostname=
#xserver-display-number=
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
#unity-compositor-command=unity-system-compositor
#unity-compositor-timeout=60
#greeter-session=example-gtk-gnome
#greeter-hide-users=false
#greeter-allow-guest=true
#greeter-show-manual-login=false
#greeter-show-remote-login=true
#user-session=default
#allow-guest=true
#guest-session=
#session-wrapper=lightdm-session
#greeter-wrapper=
#guest-wrapper=
#display-setup-script=
#display-stopped-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=
#autologin-user-timeout=0
#autologin-in-background=false
#autologin-session=UNIMPLEMENTED
#exit-on-failure=false

#
# Seat configuration
#
# Each seat must start with "Seat:".
# Uses settings from [SeatDefaults], any of these can be overriden by setting them in this section.
#
#[Seat:0]

#
# XDMCP Server configuration
#
# enabled = True if XDMCP connections should be allowed
# port = UDP/IP port to listen for connections on
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
#
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn.  Alternatively
# it can be a word and the first 7 characters are used as the key.
#
[XDMCPServer]
#enabled=false
#port=177
#key=

#
# VNC Server configuration
#
# enabled = True if VNC connections should be allowed
# command = Command to run Xvnc server with
# port = TCP/IP port to listen for connections on
# width = Width of display to use
# height = Height of display to use
# depth = Color depth of display to use
#
[VNCServer]
#enabled=false
#command=Xvnc
#port=5900
#width=1024
#height=768
#depth=8


in your home directory use:

ls -la

list all the files, including dotfiles, to see if one is really large and taking up your drive space - .xsession-errors can get very large on a system that isn't working right. Try on /var/log and /var/tmp as well.

What is the output of

df -h

run it in a terminal so we have an idea of your partition scheme.

You can also clean up your system with

sudo apt-get autotemove

# and

sudo apt-get autoclean


good luck
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

superwow

Ok after attempting reboot several times, no xjoy. No /tmp error though. While I can get to bash with ctrl+alt+fn+f1, from there, stop lightdm and then startx, and then get to my standard VSIDO experience, I cannot get a successful boot.

When I opened ligthdm.conf the first time, it was nearly completely commented out.

I will follow your suggestion and apt-get purge lightdm and then reinstall.

superwow

I rebooted, into the shell, ran 'sudo apt-get purge lightdm', then 'sudo apt-get clean', then 'sudo apt-get install lightdm'. Now I am back in my normal VSIDO with a normal boot experience.

By the way, my apps have been updating like crazy over the past week or so, and several of these apps either do not work or are no longer on my machine. I am guessing SID is about to, or just did, a serious update.

Thanks everyone for helping me fix, and learn about, my machine!

PackRat

I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo