LinuxQuestions.org
Help answer threads with 0 replies.
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 05-01-2006, 08:34 AM   #1
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Rep: Reputation: 39
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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-01-2006, 11:18 AM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Blog Entries: 4

Rep: Reputation: 78
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: 34
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).
 
2 members found this post helpful.
Old 12-21-2015, 06:13 AM   #4
bts145
LQ Newbie
 
Registered: May 2012
Posts: 4

Rep: Reputation: Disabled
First you must activate the magic SysRq option:

echo 1 > /proc/sys/kernel/sysrq

When you are ready to reboot the machine simply run the following:

echo b > /proc/sysrq-trigger


http://www.linuxjournal.com/content/rebooting-magic-way
 
Old 12-21-2015, 09:56 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by bts145 View Post
First you must activate the magic SysRq option:

echo 1 > /proc/sys/kernel/sysrq

When you are ready to reboot the machine simply run the following:

echo b > /proc/sysrq-trigger


http://www.linuxjournal.com/content/rebooting-magic-way
09 year old necropost. ;(

Double-Secret Probation!
 
Old 10-28-2017, 08:16 PM   #6
jovanmal
LQ Newbie
 
Registered: Oct 2017
Distribution: Fedora 26
Posts: 1

Rep: Reputation: Disabled
Post

Quote:
Originally Posted by ioerror View Post
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).
I had exactly same problem and your tip worked for me

Thank you ioerror


Quote:
Originally Posted by Habitual View Post
09 year old necropost. ;(
This is still current command on most Linux distros. I dont see the problem with posting after so many years, if problematics is actual. I recently had the same problem

Cheers
 
1 members found this post helpful.
  


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

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

All times are GMT -5. The time now is 05:32 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