Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I try to connect to a host either locally or remotely the machine denies logins thinking that the shutdown command has been initiated:

[~]$ ssh somehost
The system is going down for reboot in 1 minute!
This machine requires an immediate reboot. 

Connection closed by somehost

But the machine never goes down and no shutdown command is running:

[root@somehost ~]# shutdown -c
shutdown: Cannot find pid of running shutdown

If I reboot the host using the shutdown or reboot commands, the machine reboots just fine, but once it comes back up it still thinks the machine is going down for reboot in 1 minute. How do I stop it from being in a shutdown mode state?

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

somehost$ sudo rm /etc/nologin

This file probably exists and prevents further logins from happening, causing the above behaviour.

When a login is rejected, the contents of that file are used as the explanation why.

share|improve this answer
    
Yep, that was the problem. Shouldn't a subsequent reboot/shutdown clear that file? –  Andrew Case Oct 6 '11 at 21:41
    
Seems to be an selinux problem: messages:Oct 6 16:55:12 somehost kernel: type=1400 audit(1317934512.149:16): avc: denied { unlink } for pid=20773 comm="shutdown" name="nologin" dev=dm-0 ino=543059 scontext=system_u:system_r:shutdown_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file –  Andrew Case Oct 6 '11 at 21:43
    
There you go! Evidently your selinux policy is a little too restrictive. –  MikeyB Oct 6 '11 at 21:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.