# [SOLVED(-ish)] Sudo hanging (after sleep)

## tealeaf

I've had a problem for a month or so now. Occasionally, sudo will just hang rather than executing a command. This then fails for any further sudo/su commands. The hang seems to last for as long as I leave it, and leaves me with no way to execute root commands. `su` also fails to work in this situation. This even prevents me from shutting down the machine without hitting the power button. At the same time, logging out of fluxbox hangs the system.

I've recently noticed that this seems to happen after my laptop wakes from sleep mode.

I've checked in the logs, and can't find anything that looks unusual or any errors. I've also run an `emerge -e pam` in case that would fix it. I even ran an `emerge -e world`. I'm really stuck now! The system is ~x86 and kept fully up to date. I always run etc-update.

Relevant USE flags:

app-admin/sudo-1.7.2_rc1  USE="ldap pam -offensive (-selinux) -skey"

sys-libs/pam-1.1.0  USE="cracklib nls vim-syntax -audit -debug (-selinux) -test"

sys-auth/pambase-20090620.1  USE="consolekit cracklib sha512 -debug -gnome-keyring -mktemp -passwdqc (-selinux) -ssh"Last edited by tealeaf on Thu Jul 09, 2009 7:49 am; edited 1 time in total

----------

## tealeaf

After a flash of inspiration, I noticed that syslog-ng was sometimes failing to carry on logging after a sleep. It also wouldn't respond to a restart command, and eventually had to be `kill -9`'d. At this point I could still su/sudo.

I haven't verified if this always happens after a sleep, and I'm still investigating if it's that that causes sudo and others to behave badly, but I imagine it might come from some kind of buffer being filled as syslog-ng refuses to write to the log file.

Once I'm sure that this is the cause, I'll put up another question about that!

----------

## tealeaf

Just to follow up. This definitely seems to be the problem. If the system has been in sleep mode for more than about 10 minutes, syslog-ng seems to be unable to write to /var/log/syslog and must be `kill -9`'ed. I can't seem to find anyone else with this problem via Google or searching here.

For the moment I've worked around the problem by adding a manual shutdown/restart for syslog-ng in my ACPI sleep script. I'll post a question about syslog-ng now!

----------

