LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-27-2012, 12:20 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
How to work on Debian Squeeze in runlevel 1 over ssh?


In runlevel 1, sshd is not running by default so something has to be done to work remotely via ssh. The advice used to be to remove the K*ssh links from /etc/rc{2..5}.d but there are no such links on Squeeze:
Code:
root@LS1:~# ll /etc/rc*.d/*ssh*
lrwxrwxrwx 1 root root 13 Mar 16  2011 /etc/rc2.d/S03ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 Mar 16  2011 /etc/rc3.d/S03ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 Mar 16  2011 /etc/rc4.d/S03ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 Mar 16  2011 /etc/rc5.d/S03ssh -> ../init.d/ssh
I tried an alternative solution, adding an ssh start link to /etc/rc1.d:
Code:
root@LS1:~# cd /etc/rc1.d && ln -s ../init.d/ssh S07ssh
but it did not work (trying to ssh in got "connection refused".

Unexpectedly, manually running /etc/init.d/ssh start on the console did enable ssh login. I do not understand why the init script link was not equivalent to the command.

Incidentally, using telinit 2 to leave runlevel 1 resulted in a hung system displaying "Starting NFS kernel daemon: nfsd". This was solved by using the power button to initiate shutdown and boot -- not an option when working remotely. The workaround is to use telinit 6 (not yet tested).
 
Old 05-27-2012, 01:56 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

If I add an ssh link to /etc/rc1.d it works, but only if the link has the correct S number. ../init.d/ssh needs to be started before ../init.d/single is started (have a look at /etc/init.d/single).

Your setup looks a bit different then mine (S03ssh vs S20ssh) , but I guess you get the idea:
Code:
# initial setup, no ssh:
# ls -l /etc/rc1.d/S*
lrwxrwxrwx 1 root root 19 May 20 14:20 /etc/rc1.d/S01killprocs -> ../init.d/killprocs
lrwxrwxrwx 1 root root 18 May 20 14:50 /etc/rc1.d/S23bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root 16 May 20 14:50 /etc/rc1.d/S24single -> ../init.d/single

# new setup with ssh added:
# ls -l /etc/rc1.d/S*
lrwxrwxrwx 1 root root 19 May 20 14:20 /etc/rc1.d/S01killprocs -> ../init.d/killprocs
lrwxrwxrwx 1 root root 18 May 20 14:50 /etc/rc1.d/S23bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root 15 May 27 08:46 /etc/rc1.d/S23ssh -> /etc/init.d/ssh
lrwxrwxrwx 1 root root 16 May 20 14:50 /etc/rc1.d/S24single -> ../init.d/single
After a reboot into RL 1, ssh will be up and running (it does on my box). If the ssh link is below the single link ssh will not be started due to what the single script starts (init -t1 S).

Quote:
Incidentally, using telinit 2 to leave runlevel 1 resulted in a hung system displaying "Starting NFS kernel daemon: nfsd"
This is mentioned in the init man page:
Code:
WARNINGS
On a Debian system, entering runlevel 1 causes all processes to be killed except for kernel threads and the
script  that  does the killing and other processes in its session.  As a consequence of this, it isn't safe
to return from runlevel 1 to a multi-user runlevel: daemons that were started in runlevel S and are  needed
for normal operation are no longer running.  The system should be rebooted.

Last edited by druuna; 05-27-2012 at 02:01 AM. Reason: fixed weird sentence
 
1 members found this post helpful.
Old 05-27-2012, 02:32 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks drunna

That all makes perfect sense.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[debian squeeze] Logging in with SSH using machine name after modem upgrade XicKy Linux - Networking 3 07-26-2011 10:49 AM
Various segmentation faults Debian Squeeze Virtualbox running on Debian Squeeze host fordwrench Debian 1 07-21-2011 03:55 AM
LXer: Debian Squeeze 6.0 Installation Over SSH LXer Syndicated Linux News 0 03-24-2011 04:50 AM
[SOLVED] Getting a text console runlevel in Kubuntu 10.04 (Changing runlevel won't work) gregorian Linux - Newbie 4 09-05-2010 10:50 AM
[SOLVED] Problem getting mythweb to work in debian/squeeze garyg007 Linux - Software 6 08-26-2010 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:55 AM.

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