LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 05-01-2006, 08:34 AM   #1
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 535

Rep: Reputation: 34
shutting down after init=/bin/bash


Hi all,

Today I decided to upgrade my Testing version of Debian, which I haven't used in a while. I haven't figured out how to give sudo rights for APT to non-root members yet (irrelevant), and I forgot the root password. It's written down somewhere I don't have easy access to today, so I decided to try something I'd never done before and change it. I followed Google here:
http://aplawrence.com/Linux/lostlinuxpassword.html

I used init=/bin/bash with GRUB and mounted / and also /usr (to get passwd). When I wanted to shut down I also found I needed to mount /var. No problem, but I finally got an error message I couldn't get past:
Code:
# shutdown -h now
shutdown: timeout opening/writing control channel /dev/initctl
init: timeout opening/writing control channel /dev/initctl
I got the same error whether I used "init 0" or "init 6".

I also tried mounting more partitions, but nothing worked. I consulted a printed Linux manual and looked at my /etc/inittab, which was fairly opaque, and finally just used CtlAltDel, which worked.

After searching for a bit on Google the discussions I find on initctl are not very clear to me. I understand that init starts all other processes and I understand from the linked article that by specifying init=/bin/bash to the kernel argument it "dumps me to a bash prompt much earlier than single user mode." I'm not sure, however, what the /dev/initctl is about.

According to this LQ post, I need to init(ialize) init, but that still doesn't tell me what initctl is. Does anyone have a reasonably dumbed-down article for me to read, or care to quickly explain it?

Thanks,
Mike
 
Old 05-01-2006, 11:18 AM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
This bit:
Quote:
init/telinit always assumes it is already running on root filesystem. /dev/initctl is a FIFO that init listens to. When you ask init/telinit to let's say switch runlevels for example, it is fed to init via this FIFO. So if init isnt already running using the *same* root filesystem, nobody is at the other end of the pipe to pickup this information. Hope that explains the timeout.
from this thread:
http://www.linuxquestions.org/questi...ad.php?t=39056

seems to be germain to your situation.
 
Old 05-02-2006, 05:15 AM   #3
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
By the way, when you do init=/bin/sh (or bash), it isn't strictly necessary to reboot afterwards (well, depending on what you change I suppose), you can just do an 'exec /sbin/init' to continue the boot process. Make sure the state of the system is as it would normally be though (e.g. umount /usr, make / readonly again etc).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when starting up snort: bash:!/bin/sh/usr/local/bin/snort :Eent not found cynthia_thomas Linux - Software 1 11-11-2005 03:59 PM
Change /bin/bash to /bin/zsh Smokey Slackware 12 07-14-2004 02:06 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM
Problem with init scripts when shutting down atlesn Linux - General 3 03-13-2004 06:10 AM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 03:30 AM


All times are GMT -5. The time now is 01:03 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration