You are not logged in.

#1 2007-10-26 21:55:02

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

weird slim/who/finger problem [SOLVED]

If I run the who command in a X session, it reports no users. This presents a problem since I have scripts (ati-powermode.sh) that need to know the logged-in user and they do not work because who doesn't return anything.I am running the slim login manager from inittab's runlevel 5. Everything else works while in a session and other tools like ps show my user name and processes. I have a feeling this might be some odd interaction between slim and login shells.

Here is my inittab:

id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p

c1:2345:respawn:/sbin/agetty 38400 vc/1 linux
c2:2345:respawn:/sbin/agetty 38400 vc/2 linux
c3:2345:respawn:/sbin/agetty 38400 vc/3 linux
c4:2345:respawn:/sbin/agetty 38400 vc/4 linux
#c5:2345:respawn:/sbin/agetty 38400 vc/5 linux
#c6:2345:respawn:/sbin/agetty 38400 vc/6 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

x:5:respawn:/usr/bin/slim >& /dev/null

and my slim.conf is the following:

# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
default_path        ./:/bin:/usr/bin:/usr/local/bin:/usr/bin
default_xserver     /usr/bin/X
xserver_arguments   -nolisten tcp vt07

# Commands for halt, login, etc.
halt_cmd    /sbin/shutdown -h now
reboot_cmd  /sbin/shutdown -r now
console_cmd /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; e$
suspend_cmd /usr/sbin/pm-suspend

# Full path to the xauth binary
xauth_path  /usr/bin/xauth

# Xauth file for server
authfile    /var/run/slim.auth

# Activate numlock when slim starts. Valid values: on|off
# numlock     on

# Hide the mouse cursor (note: does not work with some WMs).
# Valid values: true|false
# hidecursor          false

# This command is executed after a succesful login.
# you can place the %session and %theme variables
# to handle launching of specific commands in .xinitrc
# depending of chosen session and slim theme
#
# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
# login_cmd           exec /bin/sh - ~/.xinitrc %session
login_cmd   exec /bin/bash -login ~/.xinitrc %session

# Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
# sessionstart_cmd      sh /etc/X11/xinit/xinitrc
# sessionstop_cmd       some command

# Start in daemon mode. Valid values: yes | no
# Note that this can overridden by the command line
# option "-d"
# daemon        yes

# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions ion3,ratpoison,wmii,awesome,xmonad

# Executed when pressing F11 (requires imagemagick)
screenshot_cmd      import -window root /slim.png

# welcome message. Available variables: %host, %domain
welcome_msg         Welcome to %host

# shutdown / reboot messages
shutdown_msg       The system is halting...
reboot_msg         The system is rebooting...

# default user, leave blank or remove this line
# for avoid pre-loading the username.
#default_user        simone

# current theme, use comma separated list to specify a set to
# randomly choose from
current_theme       default,flat,archlinux,subway,lake,parallel-dimensions,wave

# Lock file
lockfile            /var/lock/slim.lock

# Log file
logfile             /var/log/slim.log

The output from who -a follows. Note that it shows user jay (me) logged into console vc/1, but not into my X session.

jay@yemaya:~$ who -a
                        Oct 26 13:06              1556 id=rc    term=0 exit=0
           system boot  Oct 26 13:06
           run-level 5  Oct 26 13:06                   last=S
                        Oct 26 13:06              6726 id=rm    term=0 exit=0
                        Oct 26 14:36             13885 id=c1
LOGIN      vc/2         Oct 26 13:06              7033 id=c2
LOGIN      vc/3         Oct 26 13:06              7034 id=c3
LOGIN      vc/4         Oct 26 13:06              7035 id=c4
                        Oct 26 13:06              7036 id=x
jay      - vc/1         Oct 26 14:47 00:04       13885

The finger command is also affected by the same problem. Any suggestions on how to fix this would be greatly appreciated.

Update I set up KDM to run via the rc.conf DAEMONS line and in that case who properly showed my username and current display. I then set up slim to start from rc.conf DAEMONS, but I still had the same problem. This leads me to believe that there is something wrong either with my config or with slim.

Here's my plea to you other slim users out there: please check if the "who" commands shows users logged into an X session and let me know. This will at least tell me if it is a config problem or a slim problem. Seeing someone's working config (if it exists) would be nice too (though my configs are almost exactly the defaults that should work.)

Thanks and regards.

Last edited by jbromley (2007-11-19 04:33:01)

Offline

#2 2007-11-04 19:40:47

ironbug
Member
Registered: 2007-11-04
Posts: 19

Re: weird slim/who/finger problem [SOLVED]

damn, i found your plea while trying to figure out the same problem.
this is funny, because i don't remember this being a problem when i started to use slim...
ill try to see what i can dig up, but lemme know if you find a solution

Offline

#3 2007-11-04 20:37:17

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: weird slim/who/finger problem [SOLVED]

I also do not recall having this problem before. I've been away from Arch for some months. When I came back, there were, of course a load of updates. It was then that I noticed things weren't working correctly since my ATI graphics adapter wouldn't go into power-saving mode.

Anyway, I have looked everywhere and have found nothing. I checked slim's mailing lists, but they're very sparse and only a couple months old. Google hasn't really been helpful since I really have no idea about the source of the problem. It could be slim, it could be X authorization or PAM. I imagine it has something to do with slim using the root account for X authorization and then not switching users once someone logs in, but I don't really know XOrg startup well enough to know where I might look for the place to fix this.

Hell, I haven't even been able to get anyone to confirm that who and finger work for them when logging in through slim. Maybe all slim users are suffering from this problem and don't even know it. It was really lucky that I noticed (my battery life went way down.)

I'll keep looking and I'll post something if I learn anything.


Regards and good luck.

Offline

#4 2007-11-05 21:02:55

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: weird slim/who/finger problem [SOLVED]

I have the same problem. I started sshd and wanted to see if my friend was logged in with who and I was very confused because it showed my friend over ssh, root who was logged in in a virtual console (STRG+ALT+F1) but nothing else. And I was in fluxbox as a normal user, had a dozen terminals open and everything.

I don't know if it has to do something with slim though.

It doesn't make a difference from where I run the who-command. I only see users logged in at a virtual terminal directly or over ssh. (looks the same like for bromley)
I don't see myself, logged in in slim and starting fluxbox out of that and I don't even see myself after I opened another X server at :1.0 and opened fluxbox there (without slim involved directly, though it is running on the system).

To me it looks like some x-server issue.

I installed Arch fresh like 2 weeks ago and I didn't do many changes, so nearly everything should be at the normal state. Well, I installed the nvidia drivers, but I didn't change any settings in xorg.conf not concerning the graphics itself.
I don't remember having this problem before. Only slim and Arch are new for me and there is a slight chance that I was using fluxbox without noticing this thing (which I doubt). So I guess it has to do with some X-setting that other distributions set and Arch doesn't.

Offline

#5 2007-11-06 05:27:56

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: weird slim/who/finger problem [SOLVED]

Well, at least it's good to know I'm not alone or imagining it. JonnyJD - you could be right that it has something to do with X, however, when I set up this machine to log in with KDM instead of slim it worked fine. This is what led me to believe it had something to do with slim.

You are correct that it could still be an XOrg problem. Part of the problem is I don't even really know where to start looking. I've tried looking up stuff about slim and verifying that basic login stuff is fine (it seems to be OK). It could be a deeper-seated XOrg but I haven't seen anything about XOrg/who problems.

I will keep on looking and post anything I find, though I must admit at this point I'm pretty discouraged. Since I usually the only user on this machines I hacked the scripts that use who so that they at least worked for me. Perhaps it will magically start working again after the next update.

Regards.

Offline

#6 2007-11-06 09:16:34

KimTjik
Member
From: Sweden
Registered: 2007-08-22
Posts: 715

Re: weird slim/who/finger problem [SOLVED]

I've nothing running that obviously depends on it, at the moment, but since something must be wrong I can confirm that on my system it's the same. "who -u" gives nothing at all, so I'm obviously lost. Of course other outputs like from "top" shows both root and users.

Does it have anything to do with "slim"? I don't know by I'm using slim and "Xfce". And as I wrote in another thread - a thread without a conclusion - "slim" or "X" has something weird going on: in some intervals from "X" loading to "slim" taking over, or when logging off, I can distinguish messages about a PID being used by two programs.

I've not figured out what's going on, so I just add this to the thread.

Offline

#7 2007-11-06 15:45:56

dunc
Member
From: Glasgow, UK
Registered: 2007-06-18
Posts: 559

Re: weird slim/who/finger problem [SOLVED]

Just for the record, I use GDM usually but have been trying out SLiM recently and can confirm that "who" doesn't work when I log in with SLiM, but does when I revert to GDM.


0 Ok, 0:1

Offline

#8 2007-11-06 16:09:56

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: weird slim/who/finger problem [SOLVED]

Okay, I made a telinit 3, which killed slim. Then I killed the X-window server that slim used and was still active.
Now I started another X as root and started fluxbox in :0.0 (in X).

So nothing concerning slim is really open anymore, but: I still dont't see any userlogins with who (other than the ones at the virtual terminals vt1-vt6, if applicable)

So this is not a bug in slim, but maybe something every bigger login manager does and slim doesn't.

Offline

#9 2007-11-06 18:44:55

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: weird slim/who/finger problem [SOLVED]

JonnyJD wrote:

Okay, I made a telinit 3, which killed slim. Then I killed the X-window server that slim used and was still active.
Now I started another X as root and started fluxbox in :0.0 (in X).

Are you sure that slim was really dead and didn't respawn itself? I've got another lesser problem where when I do telinit 3 slim gets killed but then just respawns. In fact, I don't believe I can permanently kill slim, even with an telinit 3 and kill -9 of the corresponding X and slim processes. I'll have to repeat your experiment here. Perhaps this other lesser problem holds some clue for the who problem.

Offline

#10 2007-11-06 21:02:20

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: weird slim/who/finger problem [SOLVED]

Just a friendly reminder to submit a bug report if you haven't already done so... it will ensure a dev sees the problem.


thayer williams ~ cinderwick.ca

Offline

#11 2007-11-06 21:28:45

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: weird slim/who/finger problem [SOLVED]

I am very sure that slim was done. It didn't start it as a daemon, I only let it respawn on runlevel 5 (in inittab). After I went in 3 and closed it, It didn't respawn. I looked at the display and I looked at ps -ef | grep slim and waited ;-)

Anyways, seems like I was right: slim is simply not doing something.

Now I have i my slim.conf:

# Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
sessionstart_cmd        /usr/bin/sessreg -a -l $DISPLAY %user
sessionstop_cmd         /usr/bin/sessreg -d -l $DISPLAY %user

With who I have now:

jonnyjd  :0.0         2007-11-06 22:00

The :0.0 made with -l $DISPLAY and seemed common. You can do anything you like I guess. -a stands for "add" and -d for "delete". Usually you have a -w and -u option also, but in Arch the wtmp and utmp are in the standard location, so we don't need them.

The session*_cmd entries in slim.conf were inserted for exactly this purpose somewhere in the year 2005, referring to the bug-database of slim (http://developer.berlios.de/bugs/?group_id=2663)


Okay, so I learned something new today smile

EDIT:
If you don't have xdm installed, than you shouldn't need the "-x" part. This is basically only needed when you have more than one x-display controlled by a login manager, which slim can't do anyways. So it would be a nice and clean: /usr/bin/sessreg -a -l $DISPLAY %user (edited the above .conf)

Last edited by JonnyJD (2007-11-06 21:39:13)

Offline

#12 2007-11-07 00:13:39

KimTjik
Member
From: Sweden
Registered: 2007-08-22
Posts: 715

Re: weird slim/who/finger problem [SOLVED]

Thanks a lot JonnyJD! As I said, I don't use any applications at the moment that seem to depend on this, but hey it's a lot better to know the workaround before it could become necessary to find out.

It was SLiM which was running in two instances, that's why I saw those complaints about two programs running with the same PID. It turned out that I WAS CAUSING the problem. I must have missed something because SLiM was started both as a Daemon and in "inittab". My bad, but at least I found out my mistake.

Offline

#13 2007-11-08 21:12:33

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: weird slim/who/finger problem [SOLVED]

Thanks, JonnyJD, the sessreg addition to slim.conf does the trick. The who and finger commands now work properly, showing users logged into X sessions. It seems a bit odd that those lines wouldn't be enabled by default. The only reason to not do so would be that there are distros that will run sessreg for you when starting X with slim. Anyway, good eye, JonnyJD, I did a cursory search through the slim bugs but I didn't see anything.

Regards.

Offline

#14 2007-11-08 22:48:00

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: weird slim/who/finger problem [SOLVED]

@peret:  This usually means they have no "login" shells open.  I highly doubt it's a bug in Xorg, it's probably a bug with kdm/gdm that they don't ever use a login shell to spawn X, or at least a login environment to spawn X in.

Offline

Board footer

Powered by FluxBB