Skip to contentSkip to conversation

Problem with "su -" and kernels 2.4.3-ac11 and higher

DISCUSSION Manuel McLure 11 participants 17 messages Apr 22, 2001 – Apr 26, 2001

lore
Share & tools
lore
#0 lore raw

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the problem.
The problem is easy to reproduce - go to a console, log in as root, do an "su -" (this will succeed) and then another "su -". The second "su -" should hang - ps shows it started bash and that the bash process is sleeping. You need to "kill -9" the bash to get your prompt back.

Distribution is Red Hat 7.1, running on an Athlon Thunderbird 900MHz on a MSI K7T Turbo R motherboard.

Thanks,

Signature · 3 lines
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]>     | and significant law, no man may kill a cat.
<http://www.mclure.org> |             -- H.P. Lovecraft
#1 lore raw
Quoted 7 lines

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the problem.
The problem is easy to reproduce - go to a console, log in as root, do an "su -" (this will succeed) and then another "su -". The second "su -" should hang - ps shows it started bash and that the bash process is sleeping. You need to "kill -9" the bash to get your prompt back.

No problem here.

P233MMX

# uname -a
Linux kufel 2.4.3-ac12 #2 nie kwi 22 15:32:51 CEST 2001 i586 unknown
# ls -l /lib/libc-*
-rwxr-xr-x   1 root     root      1060168 Nov 19 11:17 /lib/libc-2.1.3.so
# gcc --version
egcs-2.91.66
(kernel with the fix by Niels Kristian Bech Jensen <[email protected]>)
# su --version
su (GNU sh-utils) 2.0

Maybe it is RH7 specyfic ? Or you have some compiler / hardware problem ?

Andrzej

#2 lore raw
In reply to Manuel McLure
Quoted 23 lines · On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
Quoted 4 lines

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the problem.
The problem is easy to reproduce - go to a console, log in as root, do

an

Quoted 3 lines

"su -" (this will succeed) and then another "su -". The second "su -" should hang - ps shows it started bash and that the bash process is sleeping. You need to "kill -9" the bash to get your prompt back.

No problem here.

P233MMX

# uname -a
Linux kufel 2.4.3-ac12 #2 nie kwi 22 15:32:51 CEST 2001 i586 unknown
# ls -l /lib/libc-*
-rwxr-xr-x   1 root     root      1060168 Nov 19 11:17 /lib/libc-2.1.3.so
# gcc --version
egcs-2.91.66
(kernel with the fix by Niels Kristian Bech Jensen <[email protected]>)
Quoted 6 lines
# su --version
su (GNU sh-utils) 2.0

Maybe it is RH7 specyfic ? Or you have some compiler / hardware problem ?

Andrzej

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.
I'm on RH71 - this may be specific to this release. It's also kernel-dependent, I can reboot with ac5 and the problem does not happen. The kernel is compiled with the same compiler as yours.

My libc is 2.2.2 while yours is 2.1.3 - this may be the difference.

Signature · 3 lines
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]>     | and significant law, no man may kill a cat.
<http://www.mclure.org> |             -- H.P. Lovecraft
#3 lore raw
Quoted 4 lines · Manuel McLure
Quoted 1 line · On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the problem.
The problem is easy to reproduce - go to a console, log in as root, do

an

Quoted 3 lines

"su -" (this will succeed) and then another "su -". The second "su -" should hang - ps shows it started bash and that the bash process is sleeping. You need to "kill -9" the bash to get your prompt back.

No problem here either...
Tried nesting 7 levels deep, a few times.

p75

# uname -a
Linux lapsis 2.4.3-ac12 #2 Sun Apr 22 17:41:08 EST 2001 i586 unknown
# ls /lib/libc-*
-rwxr-xr-x    1 root     root      1417065 Feb 17 14:57 /lib/libc-2.2.2.so*
# gcc --version
2.95.3
# su --version
su (GNU sh-utils) 2.0j

/ Brett

#4 lore raw
In reply to Manuel McLure
Quoted 2 lines · Manuel A. McLure

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

 8825 pts/2    S      0:00 /bin/su -
 8826 pts/2    S      0:00 -bash
 8854 pts/2    T      0:00 stty erase ?
 8855 pts/0    R      0:00 ps ax

"kill -CONT 8854" has no effect.

Quoted 3 lines

I'm on RH71 - this may be specific to this release. It's also kernel-dependent, I can reboot with ac5 and the problem does not happen. The kernel is compiled with the same compiler as yours.

I'm RH-7.1 and kernel 2.4.4-pre6 (with the via 3.23 driver from -ac)

Cheers, Wayne

#5 lore raw
Quoted 11 lines · Wayne
Quoted 2 lines · Manuel A. McLure

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

 8825 pts/2    S      0:00 /bin/su -
 8826 pts/2    S      0:00 -bash
 8854 pts/2    T      0:00 stty erase ?
 8855 pts/0    R      0:00 ps ax

Try this:

ps -t pts/2 -o pid,ppid,pgid,sess,f,stat,ruid,euid,fname,nwchan,wchan ps -t pts/2 s

(replace "pts/2" as needed to select the right tty, and split that first one into two commands if it is too long)

#6 lore raw
Quoted 4 lines · Albert D. Cahalan

Try this:

ps -t pts/2 -o pid,ppid,pgid,sess,f,stat,ruid,euid,fname,nwchan,wchan ps -t pts/2 s

OK, below are the results. Since I'm sleepy I haven't looked up the ps man page to see what it all means or whether I need to translate any numbers into symbols, sorry. Let me know if you'd like anything else.

Cheers, Wayne

[whitney@pizza whitney]$ ps auxwOT
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
[ . . . ]

root      1792  0.1  0.2  2300 1068 pts/0    S    22:19   0:00 /bin/su -
root      1796  0.2  0.2  2356 1384 pts/0    S    22:19   0:00 -bash
root      1825  0.0  0.1  2112  952 pts/0    S    22:19   0:00 /bin/su -
root      1826  0.2  0.2  2188 1148 pts/0    S    22:19   0:00 -bash
root      1854  0.0  0.0  1352  412 pts/0    T    22:19   0:00 stty erase ?
whitney   1855  0.0  0.1  2664  792 pts/2    R    22:19   0:00 ps auxwOT
[whitney@pizza whitney]$ ps -t pts/0 -o pid,ppid,pgid,sess,f,stat,ruid,euid,fname,nwchan,wchan
  PID  PPID  PGID  SESS   F STAT  RUID  EUID COMMAND   WCHAN WCHAN
 1722  1711  1722  1722 000 S      500   500 bash     117801 wait4
 1792  1722  1792  1722 000 S      500     0 su       117801 wait4
 1796  1792  1796  1722 100 S        0     0 bash     117801 wait4
 1825  1796  1825  1722 000 S        0     0 su       117801 wait4
 1826  1825  1826  1722 100 S        0     0 bash     117801 wait4
 1854  1826  1826  1722 000 T        0     0 stty     106a5f do_signal
[whitney@pizza whitney]$ ps -t pts/0 s
  UID   PID   PENDING   BLOCKED   IGNORED    CAUGHT STAT TTY        TIME COMMAND
  500  1722  00000000  00010000 <00384004  4b813efb S    pts/0      0:00 bash
    0  1792  00000000 <fffb9eff <00000000  00004000 S    pts/0      0:00 /bin/su -
    0  1796  00000000  00010000 <00384004  4b813efb S    pts/0      0:00 -bash
    0  1825  00000000 <fffb9eff <00000000  00004000 S    pts/0      0:00 /bin/su -
    0  1826  00000000  00010000 <00384004  4b813efb S    pts/0      0:00 -bash
    0  1854  00000000  00000000 <00000000  00000000 T    pts/0      0:00 stty erase ?
#7 lore raw
In reply to Wayne Whitney
Quoted 4 lines
Quoted 2 lines

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

It appears to be a bug in PAM. Someone seems to reply on parent/child running order and just got caught out

#8 lore raw

In article <[email protected]>,

Quoted 8 lines · Alan Cox
Quoted 4 lines
Quoted 2 lines

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

It appears to be a bug in PAM. Someone seems to reply on parent/child running order and just got caught out

I once debugged a very simular sounding problem that I solved with the following patch to login. It's a wild guess, but you could try if it happens to solve it. If not it might at least be a hint of what has to be done to su.
(the problem is that the extra process PAM keeps waiting is process leader) (I don't have redhat, so I can't check if this is relevant here)

login-utils/login.c +9 -0
diff -ur util-linux-2.9x/login-utils/login.c util-linux-2.9x-ton/login-utils/login.c
@@ -1109,6 +1112,15 @@
        exit(0);
     }
     /* child */
+
+    if (tcsetpgrp(0, getpid()) < 0)
+        fprintf(stderr,
+                _("login: could not become foreground process group: %s\n"),
+                strerror(errno));
+    if (setpgid(0, 0) < 0)
+        fprintf(stderr, _("login: could not become process leader: %s\n"),
+                strerror(errno));
+
 #endif
     signal(SIGINT, SIG_DFL);
     
#9 lore raw
In reply to Wayne Whitney
Quoted 7 lines · Alan Cox
Quoted 4 lines
Quoted 2 lines

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

It appears to be a bug in PAM. Someone seems to reply on parent/child running order and just got caught out

I'm not so sure; this hang is already after all the authentication is done.

Bill

#10 lore raw
In reply to Manuel McLure
Quoted 28 lines · On 2001.04.22 19:42 Brett wrote:
Quoted 7 lines · Manuel McLure
Quoted 4 lines · On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
Quoted 4 lines

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the problem.
The problem is easy to reproduce - go to a console, log in as root,

do

Quoted 2 lines
Quoted 2 lines

an

Quoted 1 line

"su -" (this will succeed) and then another "su -". The second "su

-"

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

should hang - ps shows it started bash and that the bash process is sleeping. You need to "kill -9" the bash to get your prompt back.

No problem here either...
Tried nesting 7 levels deep, a few times.

p75

# uname -a
Linux lapsis 2.4.3-ac12 #2 Sun Apr 22 17:41:08 EST 2001 i586 unknown
# ls /lib/libc-*
-rwxr-xr-x    1 root     root      1417065 Feb 17 14:57
/lib/libc-2.2.2.so*
Quoted 8 lines
# gcc --version
2.95.3
# su --version
su (GNU sh-utils) 2.0j

/ Brett

In my case:

# su --version
su (GNU sh-utils) 2.0
# bash --version
GNU bash, version 2.04.21(1)-release (i386-redhat-linux-gnu)
# uname -a
Linux ulthar 2.4.3-ac12 #3 Sat Apr 21 23:15:08 PDT 2001 i686 unknown
# ls -l /lib/libc-*        
-rwxr-xr-x    2 root     root      1236396 Apr  6 14:58 /lib/libc-2.2.2.so
# kgcc --version
egcs-2.91.66
Signature · 3 lines
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]>     | and significant law, no man may kill a cat.
<http://www.mclure.org> |             -- H.P. Lovecraft
#11 lore raw
In reply to Manuel McLure

"Manuel McLure wrote:"

Quoted 27 lines · On 2001.04.22 14:38 Andrzej Krzysztofowicz wrote:
Quoted 26 lines
Quoted 4 lines

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the problem.
The problem is easy to reproduce - go to a console, log in as root, do

an

Quoted 3 lines

"su -" (this will succeed) and then another "su -". The second "su -" should hang - ps shows it started bash and that the bash process is sleeping. You need to "kill -9" the bash to get your prompt back.

No problem here.

P233MMX

# uname -a
Linux kufel 2.4.3-ac12 #2 nie kwi 22 15:32:51 CEST 2001 i586 unknown
# ls -l /lib/libc-*
-rwxr-xr-x   1 root     root      1060168 Nov 19 11:17 /lib/libc-2.1.3.so
# gcc --version
egcs-2.91.66
(kernel with the fix by Niels Kristian Bech Jensen <[email protected]>)
# su --version
su (GNU sh-utils) 2.0
Quoted 6 lines
Quoted 3 lines

Maybe it is RH7 specyfic ? Or you have some compiler / hardware problem ?

Andrzej

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

I've tried three levels.
But my systsem is based on RH6.x

Quoted 5 lines

I'm on RH71 - this may be specific to this release. It's also kernel-dependent, I can reboot with ac5 and the problem does not happen. The kernel is compiled with the same compiler as yours.

My libc is 2.2.2 while yours is 2.1.3 - this may be the difference.

Andrzej

#12 lore raw
In reply to Manuel McLure
Quoted 2 lines · Manuel McLure

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

I tried it with about a half-dozen nested and no problem. Mandrake cooker here...

uname -a
Linux lion 2.4.3-ac11 #5 SMP Fri Apr 20 22:10:41 EDT 2001 i686 unknown

gcc --version
2.96

ls -l /lib/libc-*
-rwxr-xr-x 1 root root 1216268 Feb 21 05:38
/lib/libc-2.2.2.so

su --version
su (GNU sh-utils) 2.0

I don't think libc is the problem, unless it is in conjunction with the compiler choice. Have you tried building the kernel with the updated Red Hat gcc version? I know Mandrake has kept theirs current to Red Hat and it works fine for me.

John

#13 lore raw
In reply to Manuel McLure
Quoted 12 lines · On 2001.04.22 19:42 Wayne Whitney wrote:
Quoted 2 lines · Manuel A. McLure

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

 8825 pts/2    S      0:00 /bin/su -
 8826 pts/2    S      0:00 -bash
 8854 pts/2    T      0:00 stty erase ?
 8855 pts/0    R      0:00 ps ax
Quoted 7 lines

"kill -CONT 8854" has no effect.

Quoted 3 lines

I'm on RH71 - this may be specific to this release. It's also kernel-dependent, I can reboot with ac5 and the problem does not happen. The kernel is compiled with the same compiler as yours.

I'm RH-7.1 and kernel 2.4.4-pre6 (with the via 3.23 driver from -ac)

It looks like this may very well be a RH 7.1 interaction with the kernel, since others are not seeing this.

Signature · 3 lines
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]>     | and significant law, no man may kill a cat.
<http://www.mclure.org> |             -- H.P. Lovecraft
#14 lore raw
In reply to Manuel McLure
Quoted 16 lines · On 2001.04.22 20:21 Manuel McLure wrote:
Quoted 14 lines · On 2001.04.22 19:42 Wayne Whitney wrote:
Quoted 2 lines · Manuel A. McLure

Did you try nesting more than one "su -"? The first one after a boot works for me - every other one fails.

Same here: the first "su -" works OK, but a second nested one hangs:

 8825 pts/2    S      0:00 /bin/su -
 8826 pts/2    S      0:00 -bash
 8854 pts/2    T      0:00 stty erase ?
 8855 pts/0    R      0:00 ps ax

"kill -CONT 8854" has no effect.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I'm on RH71 - this may be specific to this release. It's also kernel-dependent, I can reboot with ac5 and the problem does not happen. The kernel is compiled with the same compiler as yours.

I'm RH-7.1 and kernel 2.4.4-pre6 (with the via 3.23 driver from -ac)

It looks like this may very well be a RH 7.1 interaction with the kernel, since others are not seeing this.

Your email made me look closer at my ps output. I also have stty waiting in "T" state.

Signature · 3 lines
Manuel A. McLure KE6TAW | ...for in Ulthar, according to an ancient
<[email protected]>     | and significant law, no man may kill a cat.
<http://www.mclure.org> |             -- H.P. Lovecraft
#15 lore raw
In reply to Manuel McLure
Quoted 9 lines · In article <[email protected]> you wrote:

I'm having a problem with "su -" on ac11/ac12. ac5 doesn't show the problem.
The problem is easy to reproduce - go to a console, log in as root, do an "su -" (this will succeed) and then another "su -". The second "su -" should hang - ps shows it started bash and that the bash process is sleeping. You need to "kill -9" the bash to get your prompt back.

Distribution is Red Hat 7.1, running on an Athlon Thunderbird 900MHz on a MSI K7T Turbo R motherboard.

I have tested it on 2.4.4pre6, here is result:

[root@lt /root]# su - test

[root@lt /root]# ps xaf

 1372 tty1     S      0:00 login -- root
 1373 tty1     S      0:00  \_ -bash
 1819 tty1     S      0:00      \_ su - test
 1820 tty1     S      0:00          \_ -bash
 1846 tty1     T      0:00              \_ stty erase ?

Last 10 lines from gdb su

Loaded symbols for /lib/security/pam_env.so Reading symbols from /lib/security/pam_unix.so...done. Loaded symbols for /lib/security/pam_unix.so Reading symbols from /lib/security/pam_cracklib.so...done. Loaded symbols for /lib/security/pam_cracklib.so Reading symbols from /usr/lib/libcrack.so.2...done. Loaded symbols for /usr/lib/libcrack.so.2
Reading symbols from /lib/security/pam_limits.so...done. Loaded symbols for /lib/security/pam_limits.so 0x401156c9 in __wait4 () from /lib/libc.so.6 (gdb)

but:

[lukasz@lt lukasz]$ su -
Password:
[root@lt /root]#

It's looks OK :)

[lukasz@lt lukasz]$ su --version
su (GNU sh-utils) 2.0

[lukasz@lt lukasz]$ bash --version
GNU bash, version 2.04.21(1)-release (i386-redhat-linux-gnu) Copyright 1999 Free Software Foundation, Inc.

[lukasz@lt lukasz]$ stty --version
stty (GNU sh-utils) 2.0

Kernel 2.4.4-pre6, 2.2.2-10, 0.74-22 - RedHat 7.1 AMD-K6 300 Mhz,

Signature · 2 lines
*[ Łukasz Trąbiński ]*
SysAdmin @wsisiz.edu.pl
#16 lore raw
Quoted 1 line · In article <[email protected]> you wrote:

Kernel 2.4.4-pre6, 2.2.2-10, 0.74-22 - RedHat 7.1

Little update to my last mail: glibc 2.2.2-10, PAM 0.74-22 - RedHat 7.1.

Signature · 2 lines
*[ Łukasz Trąbiński ]*
SysAdmin @wsisiz.edu.pl