Jump to content

Recommended Posts

Posted
Now I'm new to nix and only use it from a boot CD for imaging PC's, but how do I exit and powerdown nix correctly, instead of just exiting the desktop and just turning off the PC :rolleyes: Thought I'd best learn how to do it correctly!
Posted

shutdown -h now works as well. H imply halt.

 

You can also specify timings as well with -t in seconds

 

Shutdown -r -t 120 instead of now if you so wanted.

 

Anywho.

 

"man shutdown" and you'll get all available commands.

  • Thanks 1
Posted
Now I'm new to nix and only use it from a boot CD for imaging PC's, but how do I exit and powerdown nix correctly, instead of just exiting the desktop and just turning off the PC :rolleyes: Thought I'd best learn how to do it correctly!

 

On Linux (most distros) "poweroff" and "reboot" work fine. But if you're booting from CD and haven't mounted any hard-disks, you can just switch off with impunity.

 

--

Simon

Posted

Assuming Ubuntu (or variant)

 

sudo shutdown -P now

 

works pretty well for me. Capital "P" is important as it's the poweroff flag. If you've got a desktop (therefore GUI?) is there not a simple poweroff/shutdown button?

Posted

One never to use on a Sun Solaris box, unless in the lab.

 

$ uadmin 2 0

 

Fastest shutdown in the west!!! (Its not pretty, it just stops everything)

 

Andy

Posted

If you're working from a live CD then there's little reason not to just hit the power switch once you've unmounted any hard drives etc, you're not going to corrupt anything.

 

However, I tend to use the halt command.

Posted

 

Sorry about the hijack but how can I shut down a nix box remotely from a Windows system with say, a batch file? Is this possible?

HBJB

 

This is heresy, Unix should shutdown Windows and not the other way round. :D

 

net rpc shutdown -I -U %

 

 

*apt-get install samba-common-bin

  • Thanks 1
Posted

Going back to 'init 6/ 0' I'm now using Ubuntu and can't seem to 'init' or 'telinit'. Is there a way to enable it?

 

I prefered 'init 0' to 'shutdown -h now' immensely on my fedora box.

Posted
Going back to 'init 6/ 0' I'm now using Ubuntu and can't seem to 'init' or 'telinit'. Is there a way to enable it?

 

I prefered 'init 0' to 'shutdown -h now' immensely on my fedora box.

 

Check your path for /sbin or try the following command

[font=Courier New]sudo /sbin/init [/font]

"init" must be installed for Ubuntu to work.

 

[font=Courier New][b]apaton@ratbox:~$ apt-file search /sbin/init[/b]
mindi: /usr/lib/mindi/rootfs/sbin/init
runit-run: /sbin/init
[i]upstart: /sbin/init[/i]
upstart: /sbin/initctl
[b]apaton@ratbox:~$ dpkg --get-selections | grep upstart[/b]
[i]upstart                        install[/i]
upstart-compat-sysv                deinstall
upstart-logd                    deinstall
[/font]

Posted (edited)

Init is definitely in /sbin but on typing

sudo /sbin/init

it asks for my password as usual but then when I type it nothing happens.

 

I've tried this as root as well including the init and telinit commands as root and nothing happens. Everything else works under sudo so I'm not typing my password wrong or anything silly.

 

Is this normal?

 

Also when i type

runlevel

after 'init 4' it says '4 5' so it believes its in runlevel 4 even though I still have a GUI.

 

I'm still getting used to Ubuntu and Debian after using Fedora for ages but I have heard that to change runlevel in a Debian based system you have to change the default runlevel and then reboot. Also I have heard that the runlevel numbers are different in Debian based systems. Is this true?

Edited by llawwehttam
Posted
Init is definitely in /sbin but on typing
sudo /sbin/init

it asks for my password as usual but then when I type it nothing happens.

 

I've tried this as root as well including the init and telinit commands as root and nothing happens. Everything else works under sudo so I'm not typing my password wrong or anything silly.

 

Is this normal?

 

Also when i type

runlevel

after 'init 4' it says '4 5' so it believes its in runlevel 4 even though I still have a GUI.

 

In Debian runlevels 4 and 5 are aliases. You should be able to switch between them with telinit (not init) but I don't know the Ubuntu specifics.

 

I'm still getting used to Ubuntu and Debian after using Fedora for ages but I have heard that to change runlevel in a Debian based system you have to change the default runlevel and then reboot. Also I have heard that the runlevel numbers are different in Debian based systems. Is this true?

 

False.

Posted
So then if I type
init 3

for instance shouldn't I't kill the GUI? Its just thats what i'm used to in Red Hat based distros but nothing seems to happen with Ubuntu even though when I use the runlevel command It claims I am in runlevel 3.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...