Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was just playing around when I noticed that "who" and "users" command, which are supposed to show currently logged in accounts, return nothing. (No errors, just nothing). At the least, I should expect my current username
How do I fix this? I believe these are part of coreutils package.
First I'd find out what gets invoked when you run those commands.
Code:
$ which who
$ which users
Are they launched from something like a Busybox binary? Are they symbolic links, and if so; what do those links point too? From each of those commands you should be able to get help by doing something like:
Code:
$ who --help
$ users --help
And see what gets reported there. Either the binaries are broken, some link is pointing to nothing, or some other thing.
So it turns out I didn't have /var/run/utmp file. I had /var/log/{btmp,lastlog,wtmp}, as written at the bottom of Chapter 6.6 (I am using 7.8-Systemd: http://www.linuxfromscratch.org/lfs/...eatefiles.html). As soon as I created the file and rebooted, the who and users command worked as expected.
It says at the bottom of the chapter:
Code:
Note
The /run/utmp file records the users that are currently logged in. This file is created dynamically in the boot scripts.
But in Systemd versions, there are no "boot scripts", so it doesn't get created? or am I missing something?
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154
Rep:
Yeah was a bit confusing, sorry don't know and don't want to know about systemd, but maybe systemd does need this file, not at my machine at the mo but I will check tomorrow to see if its on my machine, I'll be back.
So I have the same thing. Then I checked whether /var/run was symlinked to /run. It turns out it is not. Should /var/run not be a symlink to /run ? I must have messed up somewhere but can't pinpoint which chapter this corresponds to.
I install BLFS stuff using a script that makes a pseudo-package using tar. The script then installs (untar) into the system. If the install script tries to create a directory in /var/run, then it might destroy the symlink to /run (something like this happens with /usr/lib64, which should be a symlink to /usr/lib). I see in my /var/run directory cups-related stuff, so I'll have to check if that is the problem.
So would it be safe to copy the stuff that is currently in /var/run to /run, then relink /var/run to /run & reboot?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.