Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

X and Openbox start at Login on Live System

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
nathanid95
Posts: 7
Joined: 2017-02-23 04:38

X and Openbox start at Login on Live System

#1 Post by nathanid95 »

Hey guys,

I'm newish to Debian and I have a live USB device running Jessie 8.7 with persistence that I use on a few different machines. I started with a minimal installation and I installed Xorg and Openbox to have a fallback GUI for web browsing, but I like to mostly stick to the CLI. Since installing these packages, though, I can't seem to exit to the terminal.

When I boot up, there's no splash, and there's no display manager (just a username and password prompt, which is what I want). Once I log in, however, X and Openbox start immediately, and if I try to close them, they just open right back up without letting me enter any commands.

I have no idea why this is happening. I just want to boot to command line, and only start X and openbox with a command. Could anyone help me out?

Thanks much,
Nate

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: X and Openbox start at Login on Live System

#2 Post by Head_on_a_Stick »

Please post the content of ~/.profile & ~/.bash_profile and also ~/.bashrc as well, just in case.

You are using bash, right?

If not, post the relevant shell initialisation files.
deadbang

nathanid95
Posts: 7
Joined: 2017-02-23 04:38

Re: X and Openbox start at Login on Live System

#3 Post by nathanid95 »

I'm using bash, yes.

.profile

Code: Select all

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
.bashrc

Code: Select all

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
	# We have color support; assume it's compliant with Ecma-48
	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
	# a case would tend to support setf rather than setaf.)
	color_prompt=yes
    else
	color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    #alias grep='grep --color=auto'
    #alias fgrep='fgrep --color=auto'
    #alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
There doesn't seem to be a .bash_profile file present in my home folder.

Thanks for your help.

jjgomera
Posts: 9
Joined: 2013-02-05 18:05

Re: X and Openbox start at Login on Live System

#4 Post by jjgomera »

or maybe your system are using ~/.xinitrc, could you post here if exist in your system?

nathanid95
Posts: 7
Joined: 2017-02-23 04:38

Re: X and Openbox start at Login on Live System

#5 Post by nathanid95 »

There doesn't appear to be a .xinitrc file in my home directory either. Just .Xauthority and .xsession_errors

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: X and Openbox start at Login on Live System

#6 Post by Head_on_a_Stick »

How about /etc/profile & /etc/bash.bashrc (I'm not even sure if Debian uses the latter but check anyway)?

This really is weird :?

Can we also see the output of:

Code: Select all

ls -lR /etc/systemd/system
deadbang

nathanid95
Posts: 7
Joined: 2017-02-23 04:38

Re: X and Openbox start at Login on Live System

#7 Post by nathanid95 »

Hey Head_on_a_Stick, thanks for sticking around. Here are the files you requested:

/etc/profile

Code: Select all

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

/etc/bash.bashrc

Code: Select all

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#    ;;
#*)
#    ;;
#esac

# enable bash completion in interactive shells
#if ! shopt -oq posix; then
#  if [ -f /usr/share/bash-completion/bash_completion ]; then
#    . /usr/share/bash-completion/bash_completion
#  elif [ -f /etc/bash_completion ]; then
#    . /etc/bash_completion
#  fi
#fi

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
	function command_not_found_handle {
	        # check because c-n-f could've been removed in the meantime
                if [ -x /usr/lib/command-not-found ]; then
		   /usr/lib/command-not-found -- "$1"
                   return $?
                elif [ -x /usr/share/command-not-found/command-not-found ]; then
		   /usr/share/command-not-found/command-not-found -- "$1"
                   return $?
		else
		   printf "%s: command not found\n" "$1" >&2
		   return 127
		fi
	}
fi

output of ls -lR /etc/systemd/system

Code: Select all

/etc/systemd/system:
total 4
drwxr-xr-x 2 root root   42 Jan 16 23:09 basic.target.wants
drwxr-xr-x 2 root root   40 Jan 16 23:10 bluetooth.target.wants
lrwxrwxrwx 1 root root   37 Jan 16 23:10 dbus-org.bluez.service -> /lib/systemd/system/bluetooth.service
lrwxrwxrwx 1 root root   40 Feb 23 02:25 dbus-org.freedesktop.ModemManager1.service -> /lib/systemd/system/ModemManager.service
lrwxrwxrwx 1 root root   53 Feb 23 02:25 dbus-org.freedesktop.nm-dispatcher.service -> /lib/systemd/system/NetworkManager-dispatcher.service
lrwxrwxrwx 1 root root   37 Feb 23 02:50 default.target -> /lib/systemd/system/multi-user.target
drwxr-xr-x 2 root root   41 Jan 16 23:05 getty.target.wants
drwxr-xr-x 2 root root   43 Jan 16 23:05 halt.target.wants
drwxr-xr-x 2 root root   45 Jan 16 23:10 hibernate.target.wants
drwxr-xr-x 2 root root   45 Jan 16 23:10 hybrid-sleep.target.wants
drwxr-xr-x 2 root root 4096 Feb 23 02:25 multi-user.target.wants
drwxr-xr-x 2 root root   43 Jan 16 23:05 poweroff.target.wants
drwxr-xr-x 2 root root   43 Jan 16 23:05 reboot.target.wants
drwxr-xr-x 2 root root   35 Jan 16 23:10 sockets.target.wants
lrwxrwxrwx 1 root root   31 Jan 16 23:11 sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x 2 root root   45 Jan 16 23:10 suspend.target.wants
lrwxrwxrwx 1 root root   35 Jan 16 23:06 syslog.service -> /lib/systemd/system/rsyslog.service

/etc/systemd/system/basic.target.wants:
total 0
lrwxrwxrwx 1 root root 39 Jan  4  2015 live-config.service -> /lib/systemd/system/live-config.service

/etc/systemd/system/bluetooth.target.wants:
total 0
lrwxrwxrwx 1 root root 37 Jan 16 23:10 bluetooth.service -> /lib/systemd/system/bluetooth.service

/etc/systemd/system/getty.target.wants:
total 0
lrwxrwxrwx 1 root root 34 Jan 16 23:05 getty@tty1.service -> /lib/systemd/system/getty@.service

/etc/systemd/system/halt.target.wants:
total 0
lrwxrwxrwx 1 root root 40 Jan 16 23:05 hwclock-save.service -> /lib/systemd/system/hwclock-save.service

/etc/systemd/system/hibernate.target.wants:
total 0
lrwxrwxrwx 1 root root 42 Jan 16 23:10 anacron-resume.service -> /lib/systemd/system/anacron-resume.service

/etc/systemd/system/hybrid-sleep.target.wants:
total 0
lrwxrwxrwx 1 root root 42 Jan 16 23:10 anacron-resume.service -> /lib/systemd/system/anacron-resume.service

/etc/systemd/system/multi-user.target.wants:
total 0
lrwxrwxrwx 1 root root 35 Jan 16 23:10 anacron.service -> /lib/systemd/system/anacron.service
lrwxrwxrwx 1 root root 31 Jan 16 23:10 atd.service -> /lib/systemd/system/atd.service
lrwxrwxrwx 1 root root 32 Jan 16 23:06 cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx 1 root root 40 Feb 23 02:25 ModemManager.service -> /lib/systemd/system/ModemManager.service
lrwxrwxrwx 1 root root 42 Feb 23 02:25 NetworkManager.service -> /lib/systemd/system/NetworkManager.service
lrwxrwxrwx 1 root root 36 Feb 23 02:25 pppd-dns.service -> /lib/systemd/system/pppd-dns.service
lrwxrwxrwx 1 root root 36 Jan 16 23:05 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 35 Jan 16 23:06 rsyslog.service -> /lib/systemd/system/rsyslog.service
lrwxrwxrwx 1 root root 31 Jan 16 23:11 ssh.service -> /lib/systemd/system/ssh.service

/etc/systemd/system/poweroff.target.wants:
total 0
lrwxrwxrwx 1 root root 40 Jan 16 23:05 hwclock-save.service -> /lib/systemd/system/hwclock-save.service

/etc/systemd/system/reboot.target.wants:
total 0
lrwxrwxrwx 1 root root 40 Jan 16 23:05 hwclock-save.service -> /lib/systemd/system/hwclock-save.service

/etc/systemd/system/sockets.target.wants:
total 0
lrwxrwxrwx 1 root root 32 Jan 16 23:10 uuidd.socket -> /lib/systemd/system/uuidd.socket

/etc/systemd/system/suspend.target.wants:
total 0
lrwxrwxrwx 1 root root 42 Jan 16 23:10 anacron-resume.service -> /lib/systemd/system/anacron-resume.service

Thanks for your help!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: X and Openbox start at Login on Live System

#8 Post by Head_on_a_Stick »

OK, last throw of the dice:

Code: Select all

find ~/.local/share/systemd
deadbang

nathanid95
Posts: 7
Joined: 2017-02-23 04:38

Re: X and Openbox start at Login on Live System

#9 Post by nathanid95 »

That command returns:

find: `/home/mosskin/.local/share/systemd': No such file or directory

I'm glad I'm not the only one stumped by this!

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: X and Openbox start at Login on Live System

#10 Post by Segfault »

But you are using systemd, right? Systemd happens to be an init system ... that handles everything, including login. I do not use it myself, but I wouldn't be surprised if systemd handles your X startup for you, user intervention is not expected ...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: X and Openbox start at Login on Live System

#11 Post by Head_on_a_Stick »

Segfault wrote:but I wouldn't be surprised if systemd handles your X startup for you, user intervention is not expected ...
All systemd unit files that are enabled to be started (both at the system and at the user level) have already been listed by my requested command output and there are no such .services running, AFAICT :?

However, because Debian still uses the "legacy" sysvinit files in /ect/rc.d (or whatever, I'm not really familiar with sysvinit), the picture can become very confused with some programs using sysvint-style scripts that are not listed by `systemctl list-unit-files` but are nevertheless still part of the startup process.

I would therefore submit that this problem is caused by a sysvinit-style script that has been activated and does not show up in my interrogations.

Does anybody know how to list running sysvinit services?

I can't be bothered startpaging obsolete practices :mrgreen:
deadbang

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: X and Openbox start at Login on Live System

#12 Post by Segfault »

IMHO this could only happen if some login manager is involved - and nathanid95 mentioned there is CLI login. As a last resort I'd recommend creating a test user to determine whether this issue is caused by something in the home directory.

BTW, do you know exactly what logind does? Perhaps it starts X if it finds it, does not mean there is a special systemd service that would show up in your interrogation.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: X and Openbox start at Login on Live System

#13 Post by Head_on_a_Stick »

Segfault wrote:I'd recommend creating a test user to determine whether this issue is caused by something in the home directory.
+1, good idea :)
BTW, do you know exactly what logind does?
Yes :mrgreen:

Looks like system calls to me but maybe I missed something...
deadbang

tynman
Posts: 131
Joined: 2016-05-03 19:48
Location: British Columbia, Canada
Been thanked: 1 time

Re: X and Openbox start at Login on Live System

#14 Post by tynman »

The question that pops up in my wee brain after reading this is: how were xorg and openbox actually installed? If installed with, say,

Code: Select all

sudo apt-get --no-install-recommends install xorg openbox
I am fairly confident that neither xorg nor openbox will autostart on bootup. So either (1) they were installed some other way, and/or (2) there is a

Code: Select all

startx
command somewhere in one of the scripts that are autorun during bootup (which seems not to be the case here), or (3) they are being started as services using either systemd unit files or sysvinit initd files (which I think would be unusual but should be doable).

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: X and Openbox start at Login on Live System

#15 Post by debiman »

^ i have to agree with that.

nathanid95, HOW is Xorg starting up automatically?

if you didn't do that yourself (hard to imagine), it must be in the way you created the live persistence.
so again, how did you create this install?

nathanid95
Posts: 7
Joined: 2017-02-23 04:38

Re: X and Openbox start at Login on Live System

#16 Post by nathanid95 »

I created this install following the instructions at http://syn.theti.ca/2013/06/22/tutorial ... ce-on-usb/ except using the Jessie standard live iso (no DE installed by default). Basically dd the image to one partition on the drive, make an ext4 partition for persistence, then change all the isolinux symlinks to syslinux.

I installed xorg and openbox with: apt-get install xorg openbox lxpanel

I can't create a test user at the moment as I'm not able to access the install, but i can tell you that logging in as root doesn't result in X and OB starting on their own.

ruffwoof
Posts: 298
Joined: 2016-08-20 21:00

Re: X and Openbox start at Login on Live System

#17 Post by ruffwoof »

Also have a look at ctrl-alt-Fn ... alternative consoles. They could all be be logged in also.

Security flaw. Lock your screen ... anyone else can come along and just Ctrl-Alt-F3 or whatever and have access. Full access if sudo su is also permitted.

Not just Debian (Stretch) ... its in Devuan RC 1 as well, so not a systemD issue. The indications being that its a bug in live-boot initialisation as the exact same system booted as though fully installed works correctly/as-expected.

Post Reply