# very slow boot and authentication

## jezaustin

Hi,

Since I came back from the holidays, my office gentoo setup has been misbehaving.

Booting takes an excruciating long time, then so does logging in, and so does performing a command as another user with sudo or su.

This is probably due to something I did before the holidays. It could be an update, but it could also be some LDAP stuff I was playing with (I was experimenting with SOGO open groupware).

I have tried commenting out the LDAP lines from my /etc/pam.d/system-auth

```
$ cat /etc/pam.d/system-auth

auth      required   pam_env.so 

#auth      required   pam_unix.so try_first_pass likeauth nullok 

auth      sufficient   pam_ldap.so use_first_pass

auth      optional   pam_permit.so

 

#account      sufficient   pam_ldap.so

account      required   pam_unix.so 

account      optional   pam_permit.so

 

password   required   pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3 

password   required   pam_unix.so try_first_pass use_authtok nullok sha512 shadow 

#password   sufficient   pam_ldap.so use_authtok use_first_pass

password   optional   pam_permit.so

 

session      required   pam_limits.so 

session      required   pam_env.so 

session      required   pam_unix.so 

#session      optional   pam_ldap.so

session      optional   pam_permit.so
```

This doesn't help, and adds a bug in that I can now log in without a password, so I shall be uncommenting all the above lines.

Any ideas very welcome.

Thanks,

Jez.

----------

## jezaustin

Here's my abridged dmesg showing where the long hangs are:

```
$ dmesg

[    0.000000] Linux version 2.6.36-gentoo-r3 (root@harrison) (gcc version 4.5.2 (Gentoo 4.5.2 p1.0, pie-0.4.5) ) #2 SMP PREEMPT Tue Jan 4 19:02:56 GMT 2011

[    0.000000] Command line: root=/dev/sda7 splash=silent,theme:natural_gentoo CONSOLE=/dev/tty1

...

[    0.226646] pci 0000:00:02.0: Boot video device

[    0.226662] pci 0000:00:1d.0: uhci_check_and_reset_hc: legsup = 0x0f30

[    0.226664] pci 0000:00:1d.0: Performing full reset

[    0.226682] pci 0000:00:1d.1: uhci_check_and_reset_hc: legsup = 0x0030

[    0.226684] pci 0000:00:1d.1: Performing full reset

[    0.226701] pci 0000:00:1d.2: uhci_check_and_reset_hc: legsup = 0x0030

[    0.226704] pci 0000:00:1d.2: Performing full reset

[    0.226720] pci 0000:00:1d.3: uhci_check_and_reset_hc: legsup = 0x1030

[    0.226723] pci 0000:00:1d.3: Performing full reset

[    0.226758] pci 0000:00:1d.7: EHCI: BIOS handoff

[    1.560023] pci 0000:00:1d.7: EHCI: BIOS handoff failed (BIOS bug?) 01010001

[    1.560280] PCI: CLS 64 bytes, default 64

[    1.560337] Trying to unpack rootfs image as initramfs...

...

[    1.926760] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input3

[    1.926772] ACPI: Video Device [GFX0] (multi-head: no  rom: yes  post: no)

[    1.926821] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0

[    1.926877] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

[    2.200164] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

[    2.221052] 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

[    2.223119] brd: module loaded

...

[    2.913218] drivers/usb/core/inode.c: creating file '002'

[    2.913244] hub 1-0:1.0: state 7 ports 8 chg 0000 evt 0002

[    3.346708] usb usb3: suspend_rh (auto-stop)

[    3.346732] usb usb4: suspend_rh (auto-stop)

[    3.346755] usb usb5: suspend_rh (auto-stop)

[    5.353376] hub 3-0:1.0: hub_suspend

[    5.353389] usb usb3: bus auto-suspend

...

[    5.353472] usb usb1: bus auto-suspend

[    5.353481] ehci_hcd 0000:00:1d.7: suspend root hub

[   97.878711] udev[899]: starting version 164

[   98.245312] FDC 0 is a post-1991 82077

[   98.490098] i801_smbus 0000:00:1f.3: PCI INT B -> GSI 19 (level, low) -> IRQ 19

...

[  102.108076] Ending clean XFS mount for filesystem: sda6

[  102.176262] EXT2-fs (sda3): warning: mounting unchecked fs, running e2fsck is recommended

[  194.314232] coretemp coretemp.0: TjMax is assumed as 100 C!

[  194.314298] coretemp coretemp.1: TjMax is assumed as 100 C!

...

[  195.125567] Adding 1959924k swap on /dev/sda2.  Priority:-1 extents:1 across:1959924k 

[  786.965104] fbcondecor: console 0 using theme 'natural_gentoo'

[  786.991954] fbcondecor: switched decor state to 'on' on console 0

[  883.669960] uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 93 us

[  969.758109] NET: Registered protocol family 10

[  980.456661] eth0: no IPv6 routers present

[ 1306.029189] sshd (2205): /proc/2205/oom_adj is deprecated, please use /proc/2205/oom_score_adj instead.
```

----------

## jezaustin

The problem persists with older backup kernels (all 64-bit).

Another symptom from yesterday was hangs whenever audio was attempted (eg. firefox betas on right-click or using the menu). Pulseaudio, if it was running, would let me know about discovering and then losing the new audio source, and I would have to wait for the timeout before I could continue using firefox. (other processes were not hung).

Today, this has not happened (I have not rebooted yet since uncommenting those LDAP lines in /etc/pam.d/system-auth, so I'm still running a system which doesn't ask for passwords... probably stupid!)

J.

----------

## augury

I had a problem like this today.  I *think* what happened was the pci-e timings I had set in BIOS were wrong OR something happened that set the system to "slow-mo".  There is an option in the BIOS to reset the configuration/saved data.  After that it was running normally again.    :Smile: 

----------

## jezaustin

Hi,

Thanks, but I tried loading BIOS defaults, with no luck.

Here are the most egregious portions of today's bootup:

```
...

[    5.353451] usb usb5: suspend_rh

[    5.353468] hub 1-0:1.0: hub_suspend

[    5.353474] usb usb1: bus auto-suspend

[    5.353478] ehci_hcd 0000:00:1d.7: suspend root hub

[   97.915843] udev[899]: starting version 164

[   98.272015] FDC 0 is a post-1991 82077

[   98.335640] i801_smbus 0000:00:1f.3: PCI INT B -> GSI 19 (level, low) -> IRQ 19

[   98.797360] HDA Intel 0000:00:1b.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

...

[  102.189536] XFS mounting filesystem sda6

[  102.361767] Ending clean XFS mount for filesystem: sda6

[  102.429960] EXT2-fs (sda3): warning: mounting unchecked fs, running e2fsck is recommended

[  194.717620] coretemp coretemp.0: TjMax is assumed as 100 C!

[  194.717679] coretemp coretemp.1: TjMax is assumed as 100 C!

[  194.746481] w83627ehf: Found W83627DHG chip at 0x290

...

[  195.528945] Adding 1959924k swap on /dev/sda2.  Priority:-1 extents:1 across:1959924k 

[  203.985028] fbcondecor: console 0 using theme 'natural_gentoo'

[  204.024190] fbcondecor: switched decor state to 'on' on console 0

[  881.729960] uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 93 us

[  969.767554] NET: Registered protocol family 10

[  980.643296] eth0: no IPv6 routers present

[ 1105.491742] uhci_hcd 0000:00:1d.0: release dev 2 ep81-INT, period 8, phase 4, 93 us

[ 1111.756596] uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 93 us

[ 1117.204728] uhci_hcd 0000:00:1d.0: release dev 2 ep81-INT, period 8, phase 4, 93 us

[ 1214.052287] aufs test_add:253:mount[2320]: uid/gid/perm /usr/portage 250/250/0755, 250/250/0750

[ 1257.423248] uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 93 us

[ 1257.423248] uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 93 us

[ 1305.854767] sshd (3541): /proc/3541/oom_adj is deprecated, please use /proc/3541/oom_score_adj instead.
```

----------

## jezaustin

Any advice would be appreciated. The system is not generally slow, but booting up, logging in or 'sudo'ing is painful...

J.

----------

## jezaustin

I've updated software, and a reluctant reboot today was just as bad as previous ones.

I noticed this in dmesg:

```
...

[    0.226709] pci 0000:00:02.0: Boot video device

[    0.226724] pci 0000:00:1d.0: uhci_check_and_reset_hc: legsup = 0x0f30

[    0.226727] pci 0000:00:1d.0: Performing full reset

[    0.226744] pci 0000:00:1d.1: uhci_check_and_reset_hc: legsup = 0x0030

[    0.226746] pci 0000:00:1d.1: Performing full reset

[    0.226763] pci 0000:00:1d.2: uhci_check_and_reset_hc: legsup = 0x0030

[    0.226765] pci 0000:00:1d.2: Performing full reset

[    0.226782] pci 0000:00:1d.3: uhci_check_and_reset_hc: legsup = 0x1030

[    0.226784] pci 0000:00:1d.3: Performing full reset

[    0.226818] pci 0000:00:1d.7: EHCI: BIOS handoff

[    1.560023] pci 0000:00:1d.7: EHCI: BIOS handoff failed (BIOS bug?) 01010001

[    1.560278] PCI: CLS 64 bytes, default 64

...
```

Anyone else noticed this BIOS bug? Looks like it's to do with EHCI (usb). It fits in with the delay about about 5.4s (suspend_rh usb). The delay after 102s (after mounting filesystems) I can't explain, but I notice that the delay after 195s is before a load of uhci_hcd activity.

I am suspecting my bios. Next reboot I shall try out a boot disc, but I'm too busy for another reboot today  :Sad: .

J.

----------

