You are not logged in.

#1 2013-01-06 23:18:32

geekmiki
Member
Registered: 2011-10-10
Posts: 74

[SOLVED].bash_profile not starting X

Hi,

I've tried to get rid of Slim and starting X at login, by following the dedicated wiki page.

As suggested I've added:

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

to .bash_profile

I know that .bash_profile is processed, because while testing I added some echo just to be sure the file was read.
The problem is that I don't manage to get X started after login. After login, if run startx, X launches correctly and processes .xinitrc (but on VT2 and not VT1 where the login occurs)

Any clue on what might be missing?

FYI here's my .bash_profile:

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

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

Thank you in advance for your help!

Last edited by geekmiki (2013-01-07 00:51:49)

Offline

#2 2013-01-06 23:45:16

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

Re: [SOLVED].bash_profile not starting X

When you log in to tty1 (and startx doesn't run) what do `echo $DISPLAY` and `echo $XDG_VTNR` return?

Also, have you put it *before* the bashrc sourcing line?  If not, something in your bashrc could be interfering.

Last edited by Trilby (2013-01-06 23:47:00)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2013-01-07 00:10:31

geekmiki
Member
Registered: 2011-10-10
Posts: 74

Re: [SOLVED].bash_profile not starting X

Hi;

First, thanks for your help.

echo $DISPLAY and echo $XDG_VTNR do not return anything.

If it can help, here's my .bashrc:

# ~/.bashrc
#

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

alias ls='ls --color=auto'
alias pacsyu='sudo pacman-color -Syu'
alias terminal='xfce4-terminal'
PS1='[\u@\h \W]\$ '

complete -cf sudo

archey

export EDITOR="vim"

Offline

#4 2013-01-07 00:29:04

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

Re: [SOLVED].bash_profile not starting X

There's your problem.  Your little snippet of code is saying that if $DISPLAY returns nothing (-z $DISPLAY)and $XDG_VTNR returns 1 ($XDG_VNTR -eq 1), then startx.  But you are getting nothing for both.

Last edited by WonderWoofy (2013-01-07 00:30:10)

Offline

#5 2013-01-07 00:39:38

geekmiki
Member
Registered: 2011-10-10
Posts: 74

Re: [SOLVED].bash_profile not starting X

Any clue on how I can solve that?

Thank you in advance!

Offline

#6 2013-01-07 00:40:00

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

Re: [SOLVED].bash_profile not starting X

You could use $(tty) instead, but if XDG_VTNR is not set, something else is wrong.  I don't remember exactly which process sets that variable, but I think it was pam-related.

Are you up to date, and have you merged all pacnew files?

EDIT: systemd-logind sets the variable, is that running?  Are you using systemd?

Last edited by Trilby (2013-01-07 00:45:33)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2013-01-07 00:51:30

geekmiki
Member
Registered: 2011-10-10
Posts: 74

Re: [SOLVED].bash_profile not starting X

Thanks for putting me in the right direction... smile

There was indeed a problem with /etc/pam.d/login and the systemd module there.

Everything's fixed now!

Offline

#8 2013-01-07 01:04:49

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

Re: [SOLVED].bash_profile not starting X

Glad it helped .... but what was the problem, and how did you fix it?  These forums are most useful when solutions are posted so others in the same situation can search and find results.

Last edited by Trilby (2013-01-07 01:05:42)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2013-01-07 09:44:29

geekmiki
Member
Registered: 2011-10-10
Posts: 74

Re: [SOLVED].bash_profile not starting X

It wasn't a generic problem, therefore I didn't consider it necessary to share the changes I made to the file.

Basically, I had been changing the content of /etc/pam.d/login earlier and I mistyped someting in the line:
-session      optional        pam_systemd.so

So by correcting my mistake, everything was working as expected again.

Offline

Board footer

Powered by FluxBB