LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-09-2004, 08:40 AM   #1
yull
Member
 
Registered: Dec 2004
Location: Belgium
Distribution: debian
Posts: 48

Rep: Reputation: 15
shutdown -h now and /etc/nologin


hi all

I can't figure out why the /etc/nologin (and also /etc/nologin.boot) file is not removed from my system when I do a shutdown of it.

As you can read here( Linux - Security -> strange ssh problem)
I had some troubles logging on my system.

Now I understood why (thanks sigsegv and krugger), I'd like to fix this. But I do not understand what's going wrong.

This comes from the man shutdown pages :
Quote:
If shutdown is called with a delay, it creates the advisory file /etc/nologin which causes programs such as login(1) to not allow new user logins. Shutdown removes this file if it is stopped before it can signal init
(i.e. it is cancelled or something goes wrong). It also removes it before calling init to change the runlevel.
but I'm doing a shutdown like this:

Code:
shutdown -h now
without any delay.

thanks for reading this

yull
 
Old 12-09-2004, 08:51 AM   #2
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Ususally, /etc/nologin is removed during the boot process. You may want to check your boot scripts.

Groetjes,

Kees-Jan
 
Old 12-09-2004, 08:57 AM   #3
yull
Member
 
Registered: Dec 2004
Location: Belgium
Distribution: debian
Posts: 48

Original Poster
Rep: Reputation: 15
those from /etc/init.d?

It's true I've written my first one not a long time ago, to start tomcat5 on system bootup and kill it on system shutdown.

maybe I did st wrong....

I copying it here.
Code:
#! /bin/sh
#
# Load your variables

export JAVA_HOME=/usr/local/bin/j2sdk1.4.2_05/
export TOMCAT_HOME=/usr/share/tomcat5
case "$1" in

   start)        
	$TOMCAT_HOME/bin/catalina.sh run         
        cmdtext="starting"        
        ;;
       
   restart)
       cmdtext="restarting"        
       ;;
   
   stop)        
       $TOMCAT_HOME/bin/catalina.sh stop
       cmdtext="stopping"        
       ;;

   *)        
       echo "Usage: $0 {start|stop|restart}"
       exit 1       
       ;;

   esac
   echo "Tomcat $cmdtext."
   if [ $? != 0 ]; then        
           echo "$status"        
           exit 1
   fi
exit 0
 
Old 12-09-2004, 12:57 PM   #4
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Ah... Finally at home...

On my debian box (running woody), there is in /etc/rcS.d a link called S10checkroot.sh. It points to /etc/init.d/checkroot.sh. Within it, there is a line that removes /etc/nologin.

Because this script is executed fairly early during boot, /etc/nologin should always be deleted.

Groetjes,

Kees-Jan
 
Old 12-15-2004, 07:42 AM   #5
yull
Member
 
Registered: Dec 2004
Location: Belgium
Distribution: debian
Posts: 48

Original Poster
Rep: Reputation: 15
FYI

I found this out:

running the tomcat server with 'catalina.sh run' makes it work in the current screen process.....
but running it with 'catalina.sh start' make it run into a separate process.

changing this avoids the login process to 'freeze' (I'm hating saying this for a linux system), and now, the /etc/nologin is successfully removed, tomcat is successfully started and the login process looks ok to me.

I'm learning each day;-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nologin oddity prn Linux - Security 2 04-22-2005 05:01 PM
sendmail adduser sbin/nologin using php mhatre kedar Linux - Networking 0 04-18-2005 01:12 AM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 06:21 PM
linux+yp /etc/nologin. How to exclude some users? kyle292002bro Linux - Security 2 12-16-2003 07:53 PM
/sbin/nologin tyccea Red Hat 2 10-22-2003 07:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration