LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 10-21-2022, 04:17 PM   #1
KarnRedsun
LQ Newbie
 
Registered: Oct 2022
Location: Bangkok, Thailand
Distribution: Rocky Linux
Posts: 3

Rep: Reputation: 0
Can't startx as normal user. I don't know what I did wrong.


I tried Linux from scratch for the first time and I do everything according to the instruction provide by the website. Thenn I tried to get to the desktop.

I installed all packages in chapter 24 in BLFS 11.2 book and also most of their recommended dependencies when in chroot, and other than texlive, I downloaded all package tarballs in /sources/BLFS and installed from that, they're all configure, make, and test with root user as it's impossible for normal user to generate any of those command in that folder due to permision denied. After that, I restart and tried to startx with normal user. It looks like it's working but it's immediately terminated even before entering the desktop without any error. Startx working normally when I use root account or sudo, though. I don't know what's going wrong.

One thing I think of it is I followed the note in instruction from xinit page that's;

chmod u+s $XORG_PREFIX/libexec/Xorg

I don't know whether it is the cause of this and I don't know how to fix it back.

So, how can I fix this issue, or I have doing it wrong in the first place when I compiled everything from /sources folder with root user and I have to do everything all over again?

Last edited by KarnRedsun; 10-21-2022 at 04:19 PM.
 
Old 10-21-2022, 06:24 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
generally you should not untar archives as root as it can lead to odd permissions of extracted files, you would usually then install as root building as root shouldnt be a problem.

if you cant extract into your sources folder as a normal user you can just chown it eg
Code:
sudo chown -R yournormaluser:yournormaluser /path/to/sources/
If you can start X as root then you probably dont have your normal user in the right groups, how are you starting the "desktop"?, which desktop?
 
Old 10-21-2022, 11:19 PM   #3
KarnRedsun
LQ Newbie
 
Registered: Oct 2022
Location: Bangkok, Thailand
Distribution: Rocky Linux
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Keith Hedger View Post
generally you should not untar archives as root as it can lead to odd permissions of extracted files, you would usually then install as root building as root shouldnt be a problem.

if you cant extract into your sources folder as a normal user you can just chown it eg
Code:
sudo chown -R yournormaluser:yournormaluser /path/to/sources/
If you can start X as root then you probably dont have your normal user in the right groups, how are you starting the "desktop"?, which desktop?
By "Desktop" in this case I mean just the default UI for startx, in other words, TWM, I haven't install any desktop environment yet. So startx in this case is a mean to enter the desktop. As I said, when I startx, it seems like it's just about to enter the graphical session but then the X terminated before any windows in desktop session showed up. There's no error output. I checked out Xorg.0.log after it's terminated and compared it with the same log file after I entered X session in root and exited from that, there's no noticeable different at all. Everything look as if there's nothing wrong.

I have my normal user already in wheel, video, and audio groups so I don't think my user is not in the right group except if Linux From Scratch behave in different way than normal distributions. But if this problem is really a permission problem then where else I have to change ownership at this point without having to recompile every X related packages?
 
Old 10-22-2022, 06:27 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
one thing that can cause odd problems is having the wrong perms on /tmp make sure its set to 1777

you may need to add your user to the tty, console and input groups

Last edited by Keith Hedger; 10-22-2022 at 06:39 AM.
 
Old 10-22-2022, 06:43 AM   #5
arch-linq
Member
 
Registered: Sep 2018
Location: Midwest, USA
Distribution: Arch,LFS,BLFS
Posts: 110

Rep: Reputation: Disabled
You didn't follow the blfs directions for building X.

1) Blfs pkgs are not built in a chroot except for a few to get going like bash shell scripts pcre wget openssh. You reboot and ssh in to do the Xorg deps and security pkgs like pam.

2) X requires logind so care must be taken to get it's circular deps right like dbus elogind/systemd. My regular user is in wheel group. No others. reboot after those then do X up to xorg-server, stop. Rebuild elogind/sysd so that logind has those X pkgs like book says. Reboot and finish X then test with startx. X is built as reg user and uses as_root script per book.

3) When doing blfs its best to get the above help BEFORE you start blfs from irc channel #lfs-support on libera to try and avoid the issues you are now having. Always state what init system and book you used here and on irc.

You can try and repair what you did (paste your xorg.0.log as reg user in this thread which you should have know to do. We need evidence not your view of what you did) but thats not fun and it annoys me and other support peeps to fix a build done wrong. So I'd start over and get the guidance i'm suggesting immediately after booting your fresh LFS.

Archetech

Last edited by arch-linq; 10-22-2022 at 06:49 AM.
 
Old 10-22-2022, 07:07 AM   #6
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
other than switching to the 'real' system to check boot up and x is working and a few odd packages i build a complete desktop in chroot itmakes no diference and can be easier to correct minor problems
 
Old 10-22-2022, 08:13 AM   #7
KarnRedsun
LQ Newbie
 
Registered: Oct 2022
Location: Bangkok, Thailand
Distribution: Rocky Linux
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by arch-linq View Post
You didn't follow the blfs directions for building X.

1) Blfs pkgs are not built in a chroot except for a few to get going like bash shell scripts pcre wget openssh. You reboot and ssh in to do the Xorg deps and security pkgs like pam.

2) X requires logind so care must be taken to get it's circular deps right like dbus elogind/systemd. My regular user is in wheel group. No others. reboot after those then do X up to xorg-server, stop. Rebuild elogind/sysd so that logind has those X pkgs like book says. Reboot and finish X then test with startx. X is built as reg user and uses as_root script per book.

3) When doin blfs its best to get the above help BEFORE you start blfs from irc channel #lfs-support on libera to try and avoid the issues you are now having. Always state what int system and book you used here and on irc.

You can try and repair what you did (paste your xorg.0.log as reg user in this thread which you should have know to do. We need evidence not your view of what you did) but thats not fun and it annoys me and other support peeps to fix a build done wrong. So I'd start over and get the guidance i'm suggesting immediately after booting your fresh LFS.

Archetech
Thank you, I appreciated your advice. However, let me clear up something first.

1) On how BLFS packages should not be build in chroot but have to build on actual system, if that's the case then there's no way I can fix but start over again because the entire process is already gone wrong since the first few hours of this whole ordeal. I have to start over. I know those packages should not build in chroot but when I rebuild many of those package dependencies over and over again I'm very tired of typing commands every single character and check that it wrote in exact same way as what stated in the instruction and it's already used up more than 3 days and I almost didn't get any sleep so I can't brute force it anymore and resorted to go back to chroot to ease up the stress on my arms and eyes and hoped that nothing gone wrong. I didn't SSH the machine because I did tried that with other PC with other distribution before and it can't connect and I still don't know whether it's because I didn't get that machine IP address right or it because I connected the network wrong as both PC at the time are just connected via LAN to the same modem router and there's no further configuration (I let them auto configure network). I don't know in the first place whether both machine are physically possible to SSH into each other when they both are connect to network in that simple way.

2) I already recompiled elogind and dbus multiple time to ensure that they are both working right with each other after I installed their other recommend dependencies and before installing the Xorg Server. From what you have said that means at least in your case rebuilding elogind and dbus again with normal user after X installed and rebuild X again with normal user solved the problem in your case. (elogind and dbus are listed as Xorg-server dependencies in the instruction but not the other way around so I think I don't have to recompile them again after xorg-server install) For now, I think I should try this first but still, the issue in 1) is likely the source of this problem for me as well.

3)Thank you, I will remember that. But, where's "irc channel #lfs-support on libera" that you've said? Do you means this forum here? Or that's the official support of the Linux from scratch project? Or it is not a place or website at all but the OS I tried to install itself?

4) I recorded the content of both Xorg.0.log with video but from what you have stated it seems this is beyond the point to post those now.

So, I will considered this issue solved for now as I already got some guidelines here. I will tried those again when I have more free time in later date.

Thank you for all advices and I apologize for posting this question.

Quote:
Originally Posted by Keith Hedger View Post
other than switching to the 'real' system to check boot up and x is working and a few odd packages i build a complete desktop in chroot itmakes no diference and can be easier to correct minor problems
If that the case then that's mean how I build and install X packages in chroot is not really wrong in itself?

Last edited by KarnRedsun; 10-22-2022 at 08:18 AM.
 
Old 10-22-2022, 12:05 PM   #8
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
building in chroot is fine but some packages need to be configured in the real system , mysql for instance.
it is a good idea to boot to the real system to check all is ok, i usually do it after the initial sysytem is built after xorg and then after the desktop is installed.
 
Old 10-22-2022, 12:11 PM   #9
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
x can also refuse to start for a normal user if there are wrong permisions on the users home folder, do chown on it see man page f9r details
 
Old 10-22-2022, 02:01 PM   #10
arch-linq
Member
 
Registered: Sep 2018
Location: Midwest, USA
Distribution: Arch,LFS,BLFS
Posts: 110

Rep: Reputation: Disabled
Keith is experienced LFS builder like myself. We can get away with taking shortcuts chroot building etc that a new builder can't. I've seen what noobs do and they do what you did. You treated the build like a race to get things running like a kid with a new toy. That's a common mistake along with hand typing vs cp/paste configs. I mention Libera but you get all frazzled instead of just googling how to set up an irc client with libera. When you decided to do blfs you entered a much bigger challenge than LFS. Dependency order, environment variables properly set and not missing critical deps are very important. Slow down dont give up chat while you build on irc and have fun with it. Read the whys of things written and how the pkgs fit together to produce a machine with lots of moving parts. Or...go in circles of frustration. Blfs is not for linux novices either. Compiling vs using a distro pkg manager like apt/pacman are two very different skill levels on Linux.

Last edited by arch-linq; 10-22-2022 at 02:04 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What I know, looking for what I don't know I don't know Dontpanic Linux - Newbie 18 07-23-2019 07:37 PM
is it possible that normal user should not able to remove crontab which was set by superuser for this normal user? gjoshi Linux - Newbie 1 04-02-2019 12:30 AM
How to Know a particular user is a Normal User or Remote(NIS) User in Redhat Linux? madhu.luck67@gmail.com Red Hat 4 05-14-2017 06:32 PM
[SOLVED] I'm trying to right a least common multiplke program, don't know what i did wrong(c++ rwalek668 Programming 6 01-08-2011 06:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 09:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration