You are not logged in.

#1 2014-07-28 15:53:46

pgiback
Member
Registered: 2014-07-28
Posts: 9

"xrdb: Can't open display" error

After the text from the bootup process I get error:

 xrdb: Can't open display '' 

img=error message.   
After this startx and autologin works fine. 
I can ignore this message, but still want to solve this, how can I do this?

moderator edit (ewaller) converted image tags to over sized image to a url link in accorance with our policy.

Last edited by pgiback (2014-07-28 17:03:22)

Offline

#2 2014-07-28 16:10:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: "xrdb: Can't open display" error

Where does this message come from? ~/.bashrc? If so, post it.

Offline

#3 2014-07-28 16:13:29

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

karol wrote:

Where does this message come from? ~/.bashrc? If so, post it.

How to get such information? I tried to source ".bashrc" and ".xinitrc". Also "xrdb .Xresources", but got no output with error.

Last edited by pgiback (2014-07-28 16:13:41)

Offline

#4 2014-07-28 17:16:54

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: "xrdb: Can't open display" error

What exactly did you do, which commands did you run? I think you should grep for 'xrdb'.

Offline

#5 2014-07-28 17:22:34

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

karol wrote:

What exactly did you do, which commands did you run? I think you should grep for 'xrdb'.

I only use it in .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

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
xbindkeys
exec dwm

Last edited by pgiback (2014-07-28 17:43:03)

Offline

#6 2014-07-28 17:38:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: "xrdb: Can't open display" error

What WM are you running? Is this the whole ~/.xinitrc?

Offline

#7 2014-07-28 17:43:50

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

karol wrote:

What WM are you running? Is this the whole ~/.xinitrc?

I edited my previous post. Missed one line with:

exec dwm

I am using only dwm (no de).

Offline

#8 2014-07-28 17:44:21

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

Re: "xrdb: Can't open display" error

It looks like the xrdb command is either in your ~/.bashrc or ~/.bash_profile (or another file sourced from those).  Could you also post these files, after you clarify the xinitrc oddity. (edit: cross posted with the above correction)

Last edited by Trilby (2014-07-28 17:45:07)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2014-07-28 17:55:28

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

Trilby wrote:

Could you also post these files

My .bashrc

#
# ~/.bashrc
#

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

alias ls='ls --color=auto'
alias grep='grep --color=auto'
PS1='[\[\e[1;34m\]\W\[\e[m\]] \[\e[1;32m\]\$\[\e[m\] '
alias l='ls -lt'
alias la='ls -lta'
alias redwm='cd ~/hp/tools/dwm && updpkgsums && makepkg -efi --noconfirm &&  killall dwm'
# Moving -- My personal
bind '"\eOd": backward-word'
bind '"\eOc": forward-word'

My .bash_profile

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
# TERM='rxvt-unicode-256color

Last edited by pgiback (2014-07-28 17:57:18)

Offline

#10 2014-07-28 18:03:40

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

Re: "xrdb: Can't open display" error

Odd.  Everything seems fine there.  Unless there are better suggestions, I'd next start narrowing down where this could be coming from.  To do this, you could (temporarily) replace "exec startx" with "exec xinit" to simply that side a little.  Also, you can try logging in to other ttys to see if you get the same xrdb error before manually typing "exec startx" (as it will not run automatically) - this way you can see if this is a shell/login process calling xrdb, or if it is startx.  In fact, I'd start with this second step.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2014-07-28 18:13:17

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

I connected as root, from the tty tried to "xrdb /home/user/.Xresources" and got same "xrdb: Can't open display" message. 

My .Xresources:

! Removes gap around terminal -- this one is a must!!!
xterm*internalBorder: 6

xterm*loginShell: true

xterm*saveLines: 2000

! Revome boarder
xterm*borderWidth: 0

! Double click to select a word
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48

! Clipboard -- thus one is a must
xterm*VT100.translations: #override <Btn1Up>: select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0)

! Font
xterm*faceName: Vera Mono
xterm*faceSize: 10

! Can remove these - dont know what changes
xterm*vt100*geometry: 80x60
xterm*termName: xterm-color
xterm*eightBitInput: false

! DOS-box colours...
xterm*background: rgb:08/0c/11
xterm*foreground: rgb:b9/84/00
xterm*color0:     rgb:00/00/00
xterm*color1:     rgb:d3/62/65
xterm*color2:     rgb:ae/ce/91
xterm*color3:     rgb:e7/e1/8c
xterm*color4:     rgb:7a/7a/b0
xterm*color5:     rgb:96/3c/59
xterm*color6:     rgb:41/81/79
xterm*color7:     rgb:20/24/28
xterm*color8:     rgb:66/66/66
xterm*color9:     rgb:ef/81/71
xterm*color10:    rgb:e5/f7/79
xterm*color11:    rgb:ff/f7/99
xterm*color12:    rgb:41/86/be
xterm*color13:    rgb:ef/9e/be
xterm*color14:    rgb:20/24/28
xterm*color15:    rgb:ff/ff/ff

! replaze bold
xterm*boldMode: false
xterm*colorBDMode: true
xterm*colorBD: rgb:82/a4/d3
! Do not underscore text, underlined text is white.
xterm*colorULMode: true
xterm*colorUL: rgb:e4/e4/e4

Edit: I am adding my dwm config.h as I started to get these errors same day as I tried to modify my config.h

/* appearance */
static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#444444";
static const char normbgcolor[]     = "#222222";
static const char normfgcolor[]     = "#bbbbbb";
static const char selbordercolor[]  = "#111111";
static const char selbgcolor[]      = "#005577";
static const char selfgcolor[]      = "#eeeeee";
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const Bool showbar           = True;     /* False means no bar */
static const Bool topbar            = True;     /* False means bottom bar */

/* tagging */
static const char *tags[] = { "term", "vim", "work", "web", "misc"};

static const Rule rules[] = {
        /* class      instance    title       tags mask     isfloating   monitor */
    { "Firefox",  NULL,       NULL,       1 << 3,       True,        -1 },
};

/* layout(s) */
static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster      = 1;    /* number of clients in master area */
static const Bool resizehints = True; /* True means respect size hints in tiled resizals */

static const Layout layouts[] = {
        /* symbol     arrange function */
        { "[]=",      tile },    /* first entry is default */
        { "><>",      NULL },    /* no layout function means floating behavior */
        { "[M]",      monocle },
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
        { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
        { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
        { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
        { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *terminal[]  = { "xterm", NULL };
static const char *browser[] = { "firefox-nightly", NULL};
static const char *vim[] = { "xterm", "-title", "vim", "-e", "vim", NULL };
static const char *news[] = { "xterm", "-title", "newsbeuter", "-e", "newsbeuter", NULL };
static const char *music[] = { "xterm", "-title", "mocp", "-e", "mocp", NULL };

static Key keys[] = {
        /* modifier                     key        function        argument */
        { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
        { MODKEY,                       XK_space,  spawn,          {.v = terminal } },
    { MODKEY,                       XK_a,      spawn,          {.v = browser } },
    { MODKEY,                       XK_q,      spawn,          {.v = vim  } },
    { MODKEY,                       XK_s,      spawn,          {.v = news  } },
    { MODKEY,                       XK_x,      spawn,          {.v = music  } },
        { MODKEY,                       XK_b,      togglebar,      {0} },
        { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
        { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
        { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
        { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
        { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
        { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
        { MODKEY,                       XK_Return, zoom,           {0} },
        { MODKEY,                       XK_Tab,    view,           {0} },
        { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
        { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
        { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
        { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
        { MODKEY|ShiftMask,                       XK_space,  setlayout,      {0} },
        { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
        { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
        { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
        { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
        { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
        { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
        TAGKEYS(                        XK_1,                      0)
        TAGKEYS(                        XK_2,                      1)
        TAGKEYS(                        XK_3,                      2)
        TAGKEYS(                        XK_4,                      3)
        TAGKEYS(                        XK_5,                      4)
        { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
};

/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
        /* click                event mask      button          function        argument */
        { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
        { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
        { ClkWinTitle,          0,              Button2,        zoom,           {0} },
        { ClkStatusText,        0,              Button2,        spawn,          {.v = terminal } },
        { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
        { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
        { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
        { ClkTagBar,            0,              Button1,        view,           {0} },
        { ClkTagBar,            0,              Button3,        toggleview,     {0} },
        { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
        { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};

Last edited by pgiback (2014-07-28 18:16:39)

Offline

#12 2014-07-28 18:36:58

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: "xrdb: Can't open display" error

Start X as a user and run xrdb from X - any errors?
You have to have X running or you get an error.

Offline

#13 2014-07-28 18:53:49

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

karol wrote:

Start X as a user and run xrdb from X - any errors?

Thank you for help, we are getting close to this.

If I remove "exec dwm" line from .bashrc and try to run startx as user I get following error:

...
Loading extension GLX
xinit: connection to X server lost

waiting for X server to shut down (EE) Server terminated successfully (0). Closing log file.

All output:

X.Org X Server 1.15.2
Release Date: 2014-06-27
X Protocol Version 11, Revision 0

Build Operating System: Linux 3.15.1-1-ARCH x86_64 

Current Operating System: Linux hp 3.15.5-2-ARCH #1 SMP PREEMPT Fri Jul 11 07:56:02 CEST 2014 x86_64
Kernel command line: initrd=\initramfs-linux.img root=/dev/sda2 rw
Build Date: 27 June 2014  07:32:26PM
 
Current version of pixman: 0.32.6
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Jul 28 21:47:45 2014
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension DRI3
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension XFree86-VidModeExtension
Initializing built-in extension XFree86-DGA
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension GLX
xinit: connection to X server lost

waiting for X server to shut down (EE) Server terminated successfully (0). Closing log file.

However, If I run it as root I can start startx normally.

Offline

#14 2014-07-28 18:58:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: "xrdb: Can't open display" error

Please pay attention to details: you didn't remove 'exec dwm' from your ~/.bashrc, but from ~/.xinitrc.
What are you trying to do? You need to run some WM, keep it / put it back.

root doesn't use the ~/.xinitrc you created for your user, that's why you can run as root.

Last edited by karol (2014-07-28 18:59:56)

Offline

#15 2014-07-28 19:27:49

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

My temporal solution is to remove (from bash_profile)

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

I don't get any error messages now, but have to startx manually (no errors when running it from command line).

Last edited by pgiback (2014-07-28 19:30:37)

Offline

#16 2014-07-28 19:40:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: "xrdb: Can't open display" error

What's the output of

type startx
type -p startx
sudo find /etc -type f -exec grep -iwsI xrdb {} +;

Do you still get that error if you comment out

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

in your ~/.xinitrc?

Offline

#17 2014-07-28 19:48:05

pgiback
Member
Registered: 2014-07-28
Posts: 9

Re: "xrdb: Can't open display" error

Here is the output:

[~] $ type startx
startx is /usr/bin/startx
[~] $ type -p startx
/usr/bin/startx
[~] $ sudo find /etc -type f -exec grep -iwsI xrdb {} +;
/etc/X11/xinit/xinitrc:    xrdb -merge $sysresources
/etc/X11/xinit/xinitrc:    xrdb -merge "$userresources"
/etc/texmf/xdvi/XDvi:!!! $ xrdb -merge $HOME/.Xdefaults

I still get errors with commend line in .xinitrc.

Offline

Board footer

Powered by FluxBB