You are not logged in.
Hi everyone! Any help is very welcome.
By following the information and secondary links on the wiki (https://wiki.archlinux.org/title/Xinit, http://blog.falconindy.com/articles/bac … stemd.html, https://tstarling.com/blog/2016/06/x11- … solation/) I was able to obtain these settings. Since I switched from XFCE to bspwm and from lightdm to ly (and subsequently to lemurs) the trick no longer works. It appears that these commands present in ~/.xinitrc and ~/.xserverrc are now ignored.
Here's my ~/.xinitrc
#!/bin/sh
TERMINAL=xfce4-terminal
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
xinit -- "$@" vt2 &
exec bspwmHere's my ~/.xserverrc
#!/bin/sh
exec /usr/bin/Xorg -nolisten tcp -nolisten local "$@" vt2 -keeptty > ~/.xorg.log 2>&1Any suggestions will be greatly appreciated.
Last edited by pit_p_an-arch_y (2024-06-04 21:55:34)
Offline
Lightdm would certainly not have used your ~/.xserverrc and typically not your ~/.xinitrc either.
> ~/.xorg.log 2>&1does not what you want
xinit -- "$@" vt2 &seems crazy? The first blog you posted has that in some shell script for auto-starting X11 on login.
Abandon all of that. Remove the recursive xinit invocation from your xinitrc, feel free to redirect the Xorg stdout, but that's not the log - rather -keeptty would redirect the session output into the log.
Anyway, the critical term in your post is "lemurs" which apparently doesn't use xinit at all.
https://github.com/coastalwhite/lemurs/ … /xsetup.sh suggests the session is started w/ $HOME/.xsession
https://github.com/coastalwhite/lemurs/ … /x.rs#L150 looks like it reads some xserver_path config, consult the lemurs manpage.
Offline
Thank you so much @set!
I'm so sorry, I'm such a noob, but I'm trying to learn something about xinit and Xorg.
I added this to my ~/.xserverrc
> ~/.xorg.log 2>&1just following this link: https://wiki.archlinux.org/title/Xorg#S … edirection.
Ok, so I have to remove this line from ~/.xinitrc
xinit -- "$@" vt2 &but how can I give "nolisten tcp" and "nolisten local" command to the X server if neither ly nor lemurs uses ~/.xserverrc?
Actually, accessing the graphical environment and bspwm without using any display manager would also be fine for me but, even in this case, how could I tell the X server "nolisten tcp" and "nolisten local"?
Thanks in advance for any help.
Offline
Actually, accessing the graphical environment and bspwm without using any display manager would also be fine for me but, even in this case, how could I tell the X server "nolisten tcp" and "nolisten local"?
https://wiki.archlinux.org/title/Getty# … al_console
https://wiki.archlinux.org/title/Xinit# … X_at_login
And in that case xserverrc and xinitrc will become relevant again, https://wiki.archlinux.org/title/Xinit#Configuration
just following this link: https://wiki.archlinux.org/title/Xorg#S … edirection.
Ok, the name there is somewhat of a misnomer - this logs the session, not the server.
That's not "wrong", just something to be aware of - your "xorg log" (meaning the log of the X11 server) will be in ~/.local/share/xorg/
Offline
Thanks for your patience @seth.
And in that case xserverrc and xinitrc will become relevant again,
But in this case, is this command line in ~/.xinitrc okay or should it be removed anyway?:
xinit -- "$@" vt2 &Furthermore, after following the instructions in the two links you indicated, is it necessary to follow this other link too: Automatic login into Xorg without display manager? Or would it be a redundant action?
Finally, the procedures described here Automatic login to virtual console and here Prompt only the password for a default user in virtual console login are two conflicting actions or, on the contrary, both files are necessary to be able to automatically log in to a virtual console and, at the same time, for a default user, to be able to type only the password without the need to enter the username at each login?
Offline
should it be removed anyway?:
xinitrc is executed by xinit, callign xinit inside will cause a recursion.
https://wiki.archlinux.org/title/System … ay_manager describes an alternative approach to start X11 as system user service.
Therere a bunch of caveats listed in the wiki and idk whether that will properly work.
You can configure agetty to
- ask for user and password
- only ask for the password of a pre-selected user
- automatically log in a pre-selected user w/o any password input request
These are mutually exclusive options and a matter of subjective preference.
It's not uncommon to automatically log into a user and automatically start an X11 session that immediately locks the screen (slock, i3lock, xscreensaver, …) to protect the session.
Offline
Just to note `-nolisten tcp` is the default at least for X as shipped by Arch. You would need to specify the reverse `listen tcp` to allow remote connections.
Offline
Unfortunately it didn't work. I just changed the values from vt2 to vt$XDG_VTNR in the .xserverrc file. Initially logging into tty1 failed so I changed the value to tty 2 in the .zprofile file. At that point the login to tty1 was automatic but X didn't start even with the startx command: when I executed the startx command the terminal gave me an error relating to line 3 of .xserverrc which denied permission. This happens in every tty anyway.
Here's my .xserverrc
#!/bin/sh
exec /usr/bin/Xorg -nolisten tcp -nolisten local "$@" vt$XDG_VTNR -keeptty > ~/.xorg.log 2>&1Here's my .zprofile
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 2 ]; then
exec startx
fiHere's my /etc/systemd/system/getty@tty1.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin arch_peter %I $TERM
Type=simple
Environment=XDG_SESSION_TYPE=x11I don't know what I did wrong.
Offline
startx command the terminal gave me an error relating to line 3 of .xserverrc which denied permission
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855 - post the error verbatim
Offline
I'm so sorry for that.
This is the output of startx when I login without DM:
/home/arch_peter/.xserverrc: line 3: /home/arch_peter/.xorg.log: Permission denied
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server errorAlso this is the output of xinit:
/home/arch_peter/.xserverrc: line 3: /home/arch_peter/.xorg.log: Permission denied
X connect to :0 broken (explicit kill or server shutdown).Offline
stat /home/arch_peter
stat /home/arch_peter/.xorg.logThere's probably such file, but root owned?
Offline
stat /home/arch_peter
File: /home/arch_peter
Dim.: 4096 Blocchi: 8 Blocco di IO: 4096 directory
Device: 259,7 Inode: 33816578 Links: 20
Accesso: (0700/drwx------) Uid: ( 1000/arch_peter) Gid: ( 984/ users)
Accesso : 2024-06-04 15:13:14.598057597 +0200
Modifica : 2024-06-04 15:13:46.086058292 +0200
Cambio : 2024-06-04 15:13:46.086058292 +0200
Creazione: 2023-09-02 01:43:56.801556443 +0200stat /home/arch_peter/.xorg.log
File: /home/arch_peter/.xorg.log
Dim.: 0 Blocchi: 0 Blocco di IO: 4096 file regolare v
Device: 259,7 Inode: 33838632 Links: 1
Accesso: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Accesso : 2024-06-04 00:52:07.510029649 +0200
Modifica : 2024-05-04 04:38:22.404801675 +0200
Cambio : 2024-05-04 04:38:22.404801675 +0200
Creazione: 2024-05-04 04:38:22.404801675 +0200Sorry, how can I get output in english just to post it to the forum?
I am very grateful for your attention.
Offline
"export LC_ALL=C", but I can just about read
Accesso: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)There's probably such file, but root owned?
=> Remove it (and yes, you'll have to sudo that)
Offline
I apologize but I couldn't try until recently.
=> Remove it (and yes, you'll have to sudo that)
Thank you so much!!! It works!
I have just another question, if is not offtopic: if I run htop, I can see this two tasks running now:
/usr/bin/Xorg -nolisten tcp -nolisten local :0 vt1 -keeptty -auth /tmp/serverauth.5FZAYHZ1KU vt1 -keepttyxinit /home/arch_peter/.xinitrc -- /home/arch_peter/.xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.5FZAYHZ1KUThe question is: What does -auth /tmp/serverauth.5FZAYHZ1KU do? And also, Why is -keeptty repeated 2 times in the first line?
In any case, thank you very much!
Offline
https://man.archlinux.org/man/extra/xor … .1.en#auth
The second -keeptty looks like startx acutally adds that unconditionally to the server when running xinit.
Edit: Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Last edited by seth (2024-06-04 20:55:06)
Offline
Ok. Thank you so much!!
For the second -keepty, is it a problem?
Offline
No, you can add the parameter several times - the server isn't going to keep the tty more, but also not less.
But as long as you're using startx (and not just xinit), you can also just remove it from your xserverrc again.
Offline
Ok. Thank you so much again! I really appreciate all your tips!
Offline