Ubuntu - single user mode. How can it be done, without rebooting the computer?
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ubuntu - single user mode. How can it be done, without rebooting the computer?
Using Slackware, when updating, it's recommended to use:
Code:
telinit 1
to get into single user mode and use the updating instructions.
Code:
telinit 3
to return.
Using FreeBSD, you just run:
Code:
shutdown now
to get into single user mode.
Code:
return
to return.
How, using Ubuntu, can you possibly enter single user mode and return from it without rebooting and booting into single user mode!? It won't work. I tried "sudo telinit 1" and it doesn't work. I tried "sudo /etc/init.d/gdm stop" to then try it, and that doesn't work. I tried "Ctrl + Alt + F1" to go to the tty and try "sudo telinit 1" and that doesn't work.
How do you switch to single user mode when using Ubuntu and then switch back to normal without rebooting the computer!?
It looks like Ubuntu has decided that that option isn't allowed. From my cursory googling of the situation, Canonical has replaced the sysvinit process with upstart, and configured it in such a way as to make booting with a kernel switch the only way to enter single user mode. I don't think "init 1" will work any better than "telinit 1" but I guess you could try.
I read they use Upstart, but I couldn't find anything saying that it wouldn't allow a switch to single user.
I tried init 1, also. I forgot to mention it.
Okay, how can you reboot the system without rebooting the computer, physically? I don't like rebooting the computer all the time, physically. I think you'd call it a soft reboot.
Here's my problem:
I know that booting the computer is the hardest thing on it, not leaving it on. I've read about it being like a light bulb, how they always burn out when you hit the switch to turn them on. It's harder on them to start up than stay on all the time. I don't want to reboot physically all the time, and I want to leave the computer on all the time unless I have to reboot for a new kernel. How can I do it? Ctrl-Alt-Delete and choosing "restart" from the shutdown menu in Gnome both do a physical reboot, correct? I want to do what I think is called a soft reboot, but I've seen people call Ctrl-Alt-Delete a soft reboot, and I'm 99% sure that's not what I want.
I want to reboot/restart everything without putting the physical strain on the computer of physically shutting it down and starting it up again all the time.
Last edited by pr_deltoid; 08-06-2010 at 04:34 PM.
Never mind, I've googled some more. I don't want a soft reboot, I want to reboot or restart everything without physically rebooting the computer. How can I do this without switching to single user mode and back again?
You're looking for kexec. It requires activation in the (running) kernel, which it looks like Ubuntu do. It works by pre-loading another (can be the same) kernel into reserved kernel memory, then directly booting that without the hardware reset. You'll need to get the userland kexec-tools.
Good to know. My only problem is this:
I don't really mind rebooting the computer for a kernel upgrade, but rebooting for any other reason is what I'm really thinking of. I would like to avoid rebooting for ordinary updates, or in any other circumstances, but rebooting for a kernel upgrade I'm not really worried about all that much. I don't need to completely rid myself of reboots, I just want to minimize them.
I know that doing this by switching into single user mode and back again works well and is very, very easy for Slackware and FreeBSD, EDIT: (and probably most other Linux distributions, as far as I know), but apparently Ubuntu is just not going to let me do this.
Last edited by pr_deltoid; 08-07-2010 at 06:36 PM.
RUNLEVEL may also be S or s which will place the system directly into
single-user mode without actually stopping processes first, you
probably won’t want that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.