+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
*nix Thread, How to shut down correctly? in Technical; If you're working from a live CD then there's little reason not to just hit the power switch once you've ...
  1. #16
    SteveBentley's Avatar
    Join Date
    Jun 2007
    Location
    Yorkshire
    Posts
    1,453
    Thank Post
    120
    Thanked 264 Times in 190 Posts
    Rep Power
    73
    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.

  2. #17
    Heebeejeebee's Avatar
    Join Date
    Nov 2006
    Location
    Intergalactic Cruise
    Posts
    1,061
    Thank Post
    69
    Thanked 79 Times in 62 Posts
    Rep Power
    36
    ** Thread hijack alert **

    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

  3. #18

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Quote Originally Posted by Heebeejeebee View Post
    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?
    With Simon Tatham's plink.

  4. Thanks to powdarrmonkey from:

    Heebeejeebee (3rd December 2009)

  5. #19
    ahuxham's Avatar
    Join Date
    Apr 2008
    Posts
    1,122
    Thank Post
    76
    Thanked 138 Times in 109 Posts
    Rep Power
    31
    Indeed, another way would be a batch to SSH into the machine via Putty and execute the command or .sh script as root.

  6. #20
    apaton's Avatar
    Join Date
    Jun 2009
    Location
    Kings Norton
    Posts
    283
    Thank Post
    54
    Thanked 106 Times in 87 Posts
    Rep Power
    36
    Quote Originally Posted by Heebeejeebee View Post

    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.

    net rpc shutdown -I <Windoz IP> -U <user>%<passwd>


    *apt-get install samba-common-bin

  7. #21
    llawwehttam's Avatar
    Join Date
    Nov 2008
    Location
    Birmingham
    Posts
    223
    Thank Post
    56
    Thanked 3 Times in 3 Posts
    Blog Entries
    2
    Rep Power
    15
    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.

  8. #22
    apaton's Avatar
    Join Date
    Jun 2009
    Location
    Kings Norton
    Posts
    283
    Thank Post
    54
    Thanked 106 Times in 87 Posts
    Rep Power
    36
    Quote Originally Posted by llawwehttam View Post
    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
    Code:
    sudo /sbin/init <level>
    "init" must be installed for Ubuntu to work.

    Code:
    apaton@ratbox:~$ apt-file search /sbin/init
    mindi: /usr/lib/mindi/rootfs/sbin/init
    runit-run: /sbin/init
    upstart: /sbin/init
    upstart: /sbin/initctl
    apaton@ratbox:~$ dpkg --get-selections | grep upstart
    upstart                        install
    upstart-compat-sysv                deinstall
    upstart-logd                    deinstall
    

  9. #23
    llawwehttam's Avatar
    Join Date
    Nov 2008
    Location
    Birmingham
    Posts
    223
    Thank Post
    56
    Thanked 3 Times in 3 Posts
    Blog Entries
    2
    Rep Power
    15
    Init is definitely in /sbin but on typing
    Code:
    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
    Code:
    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?
    Last edited by llawwehttam; 4th December 2009 at 11:59 PM.

  10. #24

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Quote Originally Posted by llawwehttam View Post
    Init is definitely in /sbin but on typing
    Code:
    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
    Code:
    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.

  11. #25
    llawwehttam's Avatar
    Join Date
    Nov 2008
    Location
    Birmingham
    Posts
    223
    Thank Post
    56
    Thanked 3 Times in 3 Posts
    Blog Entries
    2
    Rep Power
    15
    So then if I type
    Code:
    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.

  12. #26
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    439
    Thank Post
    79
    Thanked 95 Times in 79 Posts
    Rep Power
    63
    for Ubuntu,prefix everything in the shell with sudo.

    then enter your password.

    BoX

  13. #27
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    439
    Thank Post
    79
    Thanked 95 Times in 79 Posts
    Rep Power
    63
    Quote Originally Posted by Heebeejeebee View Post
    ** Thread hijack alert **

    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
    Not shutdown, but i expect you can edit it.


    Create a file /opt/ltsp-4.2/i386/sbin/rebootself that contains the lines:


    Code:
    #!/bin/sh
    exec /sbin/reboot
    and in /opt/ltsp-4.2/i386/etc/passwd, add:

    Code:
    reboot::0:0:root:/root:/sbin/rebootself
    Now do "ssh reboot@machine" to reboot it without a password.

    found on DNA Lounge: Source Code: Diskless Linux Kiosks

    I Hope this helps

    BoX

  14. #28

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Quote Originally Posted by box_l View Post
    for Ubuntu,prefix everything in the shell with sudo.

    then enter your password.

    BoX
    Er, no. Only when you want to execute something requiring privileges, and then you should drop them as soon as possible.

  15. #29

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Quote Originally Posted by box_l View Post
    Now do "ssh reboot@machine" to reboot it without a password.
    This is a really stupid idea.

  16. #30
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    439
    Thank Post
    79
    Thanked 95 Times in 79 Posts
    Rep Power
    63
    Quote Originally Posted by powdarrmonkey View Post
    Er, no. Only when you want to execute something requiring privileges, and then you should drop them as soon as possible.
    Sorry, I thought that people would realise that they would not need the password if they were not presented with a prompt for one.

    BoX



SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Printers not mapping correctly???
    By actech in forum Windows Server 2000/2003
    Replies: 3
    Last Post: 19th June 2009, 12:57 PM
  2. [CLOSED] Bug/Error: Signature not displaying correctly
    By kearton in forum EduGeek.net Site Problems
    Replies: 2
    Last Post: 9th January 2008, 10:20 AM
  3. Replies: 6
    Last Post: 19th October 2007, 03:48 PM
  4. Room not following policies correctly
    By localzuk in forum Windows
    Replies: 21
    Last Post: 22nd January 2007, 05:33 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •