LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Ubuntu - single user mode. How can it be done, without rebooting the computer? (https://www.linuxquestions.org/questions/ubuntu-63/ubuntu-single-user-mode-how-can-it-be-done-without-rebooting-the-computer-824655/)

pr_deltoid 08-06-2010 03:46 PM

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!?
:banghead:

mostlyharmless 08-06-2010 04:03 PM

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.

pr_deltoid 08-06-2010 04:12 PM

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.

pr_deltoid 08-06-2010 04:27 PM

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.

pr_deltoid 08-06-2010 04:59 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?
:doh:

syg00 08-06-2010 06:13 PM

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.

pr_deltoid 08-07-2010 06:32 PM

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.

wagscat123 08-07-2010 06:37 PM

Try putting in init S, because runlevel S is single-user also.

pr_deltoid 08-07-2010 07:51 PM

http://manpages.ubuntu.com/manpages/...telinit.8.html
Quote:

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.


All times are GMT -5. The time now is 08:04 AM.