Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cannot startx as my normal user [SOLVED]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Fri Feb 05, 2021 5:09 pm    Post subject: Reply with quote

Since startx is a script, you could run it with
Code:
sh -x /usr/bin/startx 2> /tmp/startx.out.log

to see what startx is doing before it hands off to xinit.

Edit to add: you don't have startx as an alias or script in home/bin (if you have one) do you?

Eta2: what does echo $XDG_VTNR return (console command line)
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Fri Feb 05, 2021 5:39 pm    Post subject: Reply with quote

Quote:
/usr/bin/dbus-launch --sh-syntax --exit-with-session /usr/bin/openbox-session


Shouldn't there be an exec in front of dbus-launch?

From gentoo's wiki
Quote:
startx integration

To have an elogind session created when using startx to start the X server (instead of a display manager), add the following to the user's ~/.xinitrc file:
FILE ~/.xinitrc

exec dbus-launch --exit-with-session <WINDOW_MANAGER>

WINDOW_MANAGER in the above example needs to be replaced by a window manager or a single application.


Edit to add: Try with the exec
Code:
27924 tty1              \_ xinit /home/figueroa/.xinitrc -- /etc/X11/xinit/xserverrc :0 -auth /tmp/serverauth.Qkv4hffe5V
27925 tty1                  \_ /usr/bin/X -nolisten tcp -keeptty :0 -auth /tmp/serverauth.Qkv4hffe5V vt1
27934 tty1                  \_ sh /home/figueroa/.xinitrc
27940 tty1                      \_ /usr/bin/openbox --startup /usr/libexec/openbox-autostart OPENBOX


Notice that after xinit spawns X, then an a shell gets executed on your .xinitrc file.

It should look like this with an exec
Code:
17690 tty1     S+     0:00      \_ xinit /home/don/.xinitrc -- /etc/X11/xinit/xserverrc :0 -auth /tmp/serverauth.fxt8gWx
17691 tty7     Ssl+   4:02          \_ /usr/bin/X -nolisten tcp :0 -auth /tmp/serverauth.fxt8gWx9YL SHELL=/bin/bash mybb
17764 tty1     S      0:01          \_ /usr/bin/openbox --startup sh /home/don/.config/openbox/autostart

_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Fri Feb 05, 2021 6:12 pm    Post subject: Reply with quote

Anon-E-moose wrote:
Shouldn't there be an exec in front of dbus-launch?
As you note, exec is traditional. However, if the shown command is the last line of the file, then exec is an optimization to encourage the shell to replace itself with dbus-launch, instead of waiting for dbus-launch to exit and then having the shell exit with the return code of dbus-launch. I think that, in practice, the presence of absence of exec should not matter.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Fri Feb 05, 2021 6:16 pm    Post subject: Reply with quote

Anon-E-moose wrote:
Since startx is a script, you could run it with
Code:
sh -x /usr/bin/startx 2> /tmp/startx.out.log

to see what startx is doing before it hands off to xinit.

Done. See at link: https://dpaste.com/CNXGEJCVU
There is a lot in there, mostly far too over my head. A few red herrings to chase down sometime.

Anon-E-moose wrote:
Edit to add: you don't have startx as an alias or script in home/bin (if you have one) do you?

I have a script that I am not using for the time being.

Anon-E-moose wrote:
Eta2: what does echo $XDG_VTNR return (console command line)

It returns a 1 on its own line.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Fri Feb 05, 2021 6:21 pm    Post subject: Reply with quote

Anon-E-moose wrote:
Shouldn't there be an exec in front of dbus-launch?

I stopped putting exec in .xinitrc about 10 years ago. Made no difference then, made no difference now. I tried it because I'm game to try anything.

I'm back up with xdm.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Fri Feb 05, 2021 6:41 pm    Post subject: Reply with quote

What does the ps axf -o pid,tty,args output look like on the system where startx works?
You already have the one that doesn't work.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Fri Feb 05, 2021 7:44 pm    Post subject: Reply with quote

Anon-E-moose wrote:
What does the ps axf -o pid,tty,args output look like on the system where startx works?
You already have the one that doesn't work.


Code:

ps axf -o pid,tty,args
...
 3551 tty1     /bin/login --
27519 tty1      \_ -bash
27527 tty1          \_ -bash
27529 tty1              \_ /bin/sh /usr/bin/startx
27549 tty1                  \_ xinit /home/figueroa/.xinitrc -- /etc/X11/xinit/xserverrc :0 -auth /tmp/serverauth.yWAORTGNrC
27550 tty1                      \_ /usr/bin/X -nolisten tcp -keeptty :0 -auth /tmp/serverauth.yWAORTGNrC vt1
27566 tty1                      \_ sh /home/figueroa/.xinitrc
27572 tty1                          \_ /usr/bin/openbox --startup /usr/libexec/openbox-autostart OPENBOX
 3552 tty2     /sbin/agetty 38400 tty2 linux
 3553 tty3     /sbin/agetty 38400 tty3 linux
 3554 tty4     /sbin/agetty 38400 tty4 linux
 3555 tty5     /sbin/agetty 38400 tty5 linux
 3556 tty6     /sbin/agetty 38400 tty6 linux
 4631 ?        /sbin/apcupsd -f /etc/apcupsd/apcupsd.conf -P /run/apcupsd/apcupsd.pid
 7780 ?        /usr/bin/perl -T -w /usr/sbin/spamd --pidfile=/run/spamd.pid --max-children=5 --create-prefs --helper-home-dir --daemonize
 7801 ?         \_ spamd child
 7802 ?         \_ spamd child
27575 tty1     /usr/bin/dbus-launch --sh-syntax --exit-with-session /usr/bin/openbox-session
27576 ?        /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-address 7 --session
27595 tty1     lxpanel
27596 tty1     pcmanfm --desktop
27597 tty1     xscreensaver
27602 tty1     conky -d
27629 ?        /usr/libexec/gvfsd
27742 ?         \_ /usr/libexec/gvfsd-trash --spawner :1.2 /org/gtk/gvfs/exec_spaw/0
27637 ?        /usr/libexec/menu-cache/menu-cached /run/user/1000/menu-cached-:0
27641 ?        /usr/libexec/gvfs-udisks2-volume-monitor
27648 ?        /usr/libexec/udisks2/udisksd
27664 ?        /usr/lib/polkit-1/polkitd --no-debug


I note above, and confirmed from the keyboard that the desktop is running on tty1 and looks fine. Ctrl+Alt+F7 pulls up a black screen with white cursor in upper left hand corner. Ctrl+Alt+F2 through F6 shows me console login.

EDITED: The lines in the output of ps axf -o pid,tty,args were truncated when I originally copied from the terminal. That's fixed now.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Fri Feb 05, 2021 8:33 pm    Post subject: Reply with quote

I see no reason for startx not to work. But something is pointing to both tty1 and tty7 (judging by your description), now why is a real mystery.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 296

PostPosted: Fri Feb 05, 2021 9:04 pm    Post subject: Reply with quote

In your .xinitrc:
Code:
xhost +local :root > /dev/null

Does it mean that only root can connect to the X server?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Fri Feb 05, 2021 9:18 pm    Post subject: Reply with quote

Split from [SOLVED] eselect news - 2021-01-30-display-manager-init

The posts for each issue seemed distinct. Please report any posts that are in the wrong thread.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Fri Feb 05, 2021 9:28 pm    Post subject: Reply with quote

Leonardo.b wrote:
In your .xinitrc:
Code:
xhost +local :root > /dev/null

Does it mean that only root can connect to the X server?

No. .xinitrc are identical on both computers, the one where startx works are usual and my main one where startx does not bring up the desktop as user.

Note also: there is no space between "+local" and ":root" as you show above.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Feb 05, 2021 9:55 pm    Post subject: Reply with quote

I just built a computer with old old mobo, new drives, new PS and new cheap case. I believe I mentioned on some thread that I also had a black screen. A few hours ago, I idly clicked on the black screen with the mouse and it light up with the pcmanfm desktop. ????
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Sat Feb 06, 2021 3:44 am    Post subject: Reply with quote

Tony0945 wrote:
I just built a computer with old old mobo, new drives, new PS and new cheap case. I believe I mentioned on some thread that I also had a black screen. A few hours ago, I idly clicked on the black screen with the mouse and it light up with the pcmanfm desktop. ????

Repeatable? Not here.

EDDIT -- added:
There seem to be a lot of black screens reported in the forums recently. Something is going on. :-/
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Sat Feb 06, 2021 11:47 am    Post subject: Reply with quote

figueroa wrote:
Anon-E-moose wrote:
Since startx is a script, you could run it with
Code:
sh -x /usr/bin/startx 2> /tmp/startx.out.log

to see what startx is doing before it hands off to xinit.

Done. See at link: https://dpaste.com/CNXGEJCVU
There is a lot in there, mostly far too over my head. A few red herrings to chase down sometime.


Code:
/home/figueroa/.config/openbox/menu.xml:29: parser error : Opening and ending tag mismatch: item line 25 and menu
</menu>
       ^
/home/figueroa/.config/openbox/menu.xml:30: parser error : Opening and ending tag mismatch: menu line 7 and openbox_menu
</openbox_menu>
               ^
/home/figueroa/.config/openbox/menu.xml:31: parser error : EndTag: '</' not found


I'd fix this and then see if it works.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sat Feb 06, 2021 4:01 pm    Post subject: Reply with quote

I looked at those lines in my openbox file and they are all in the applications menu.

1. Have you checked your filesystem integrity and your drive health?

2. Editting xml is hard IMP. I would:
a. save the file to another name
b. emerge obmenu-generator
b. run obmenu-generator to generate a new menu as well.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Sun Feb 07, 2021 4:19 am    Post subject: Reply with quote

I fixed the menu.xml errors.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Sun Apr 04, 2021 3:45 am    Post subject: Reply with quote

I'm HAPPY to report that upon testing this evening, startx works again. It pulls up my desktop (OpenBox) on tty1. tty7 and higher just give me a blank screen with a cursor flashing in the upper left-hand corner.

What did I do to get startx to work again? Nothing really. I'm fully up-to-date, amd64, with the new stable 5.4.109 kernel. Actually, I did update to the new display-manager-init which caused me to temporarily upgrade to ~ for the following:
Code:
=sys-apps/sysvinit-2.98-r1 ~amd64
=x11-apps/xinit-1.4.1-r1 ~amd64
=x11-base/xorg-server-1.20.10-r3 ~amd64
=gui-libs/display-manager-init-1.0-r3 ~amd64


I THINK startx used to send the desktop to tty7, but it stays on tty1 now on both machines I have here. I won't complain. I can live with this.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Sun Apr 04, 2021 2:03 pm    Post subject: Reply with quote

Really good discussion here about the-cause-of-it-all from 2015 here:
https://groups.google.com/g/linux.debian.user/c/dHogA4Mxiv8

and snippy bug report here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801487

Short version, systemd broke startx. For us openrc users, elogind did the breaking. I believe I will mark this solved. That doesn't mean "fixed," but "understood." It's water under the bridge.[/code]
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sun Apr 04, 2021 3:15 pm    Post subject: Reply with quote

Is there an actual Xorg-legacy package from Debian?
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Sun Apr 04, 2021 3:49 pm    Post subject: Reply with quote

Startx always tried vt7 first, then 8, etc (this was in the suid X days)
When systemd barreled into the room, then it was necessary to use --vt[1=6] as the suid was depreciated, and the fearmongering about running as root ratcheted up (concurrently with systemd gaining speed :wink: ).

There was an initiative to use a small binary drm manager (which is the only thing needing root permissions) to set/drop drm master.

Then the kernel people looked at the code for set/drop drm master and decided they didn't need to set root only on it (~linux 5.8 ).
And as far as I know they haven't changed the code back, for kernels earlier than 5.8 (or whenever the change was introduced) they can always patch the kernel, it's one line.

I run startx on vt7 (well, when I run X, I've been playing with wayland lately) to do this I have a few simple things set, I'm in input, tty and video group.
And I have a udev rule that changes tty7/8 from 600 to 660 (tty group can access). That's all there is too it.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Sun Apr 04, 2021 3:51 pm    Post subject: Reply with quote

I cannot speak to what Debian ships, but I suspect from context that the Debian legacy package is what Gentoo users get when building Xorg with USE=suid.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Sun Apr 04, 2021 6:44 pm    Post subject: Reply with quote

Hu wrote:
I cannot speak to what Debian ships, but I suspect from context that the Debian legacy package is what Gentoo users get when building Xorg with USE=suid.


Quote:
Package: xserver-xorg-legacy

setuid root Xorg server wrapper

This package provides a wrapper for the Xorg X server, which is necessary for legacy drivers and non-Linux kernels.
...
File list of package xserver-xorg-legacy in stretch of architecture amd64

/usr/lib/xorg/Xorg.wrap
/usr/share/doc/xserver-xorg-legacy/changelog.Debian.gz
/usr/share/doc/xserver-xorg-legacy/changelog.gz
/usr/share/doc/xserver-xorg-legacy/copyright
/usr/share/man/man1/Xorg.wrap.1.gz
/usr/share/man/man5/Xwrapper.config.5.gz

_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1530
Location: South America

PostPosted: Sun Apr 04, 2021 7:05 pm    Post subject: Reply with quote

Anon-E-moose wrote:
Quote:
File list of package xserver-xorg-legacy in stretch of architecture amd64

/usr/lib/xorg/Xorg.wrap
/usr/share/doc/xserver-xorg-legacy/changelog.Debian.gz
/usr/share/doc/xserver-xorg-legacy/changelog.gz
/usr/share/doc/xserver-xorg-legacy/copyright
/usr/share/man/man1/Xorg.wrap.1.gz
/usr/share/man/man5/Xwrapper.config.5.gz

I see. That's what users get on Gentoo with USE="elogind suid" or USE="systemd suid", I believe.

Nonprivileged Xorg is supposed to take the same tty as the shell one uses to run startx. It doesn't have privileges for anything else, and that's the reason why Gentoo's /etc/X11/xinit/xserverrc adds -keeptty "vt$XDG_VTNR" to the Xorg invocation if XDG_VTNR is defined and not empty. XDG_VTNR is set by elogind or systemd-logind via PAM.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum