1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

restart server from SSH

Discussion in 'General Discussion' started by mahdionline, Sep 29, 2004.

  1. mahdionline

    mahdionline Member

    Joined:
    Oct 18, 2003
    Messages:
    127
    Likes Received:
    0
    Trophy Points:
    16
    Hi

    I want to restart server from SSH, whtat is the needed command ?

    Regard
     
  2. ukhost4u

    ukhost4u Member

    Joined:
    Apr 24, 2003
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Thats easy "reboot" from SSH should do it.
     
  3. sjackson909

    sjackson909 Member

    Joined:
    Jun 8, 2004
    Messages:
    113
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Columbus, OH
    don't sync; sync; halt; :)
     
  4. SarcNBit

    SarcNBit Active Member

    Joined:
    Oct 14, 2003
    Messages:
    1,015
    Likes Received:
    3
    Trophy Points:
    38
    shutdown -r now

    Time for someone to look for a Linux 101 class or find a few introduction to Linux books and/or websites ;)
     
  5. ukhost4u

    ukhost4u Member

    Joined:
    Apr 24, 2003
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    hey, you could always pull the plug or take a good guess :D
     
  6. SarcNBit

    SarcNBit Active Member

    Joined:
    Oct 14, 2003
    Messages:
    1,015
    Likes Received:
    3
    Trophy Points:
    38
    No that would not be good if your goal was to reboot :)

    init 6 (reboot) instead of init 0 (halt) should work though.

    Run

    man shutdown

    and you will see that it simply calls reboot or halt, but it includes a few extra features that make it my choice over a simple

    init 6

    :D
     
  7. chirpy

    chirpy Super Moderator

    Joined:
    Jun 15, 2002
    Messages:
    13,499
    Likes Received:
    14
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Personally, I use reboot, 'cos it takes away the possibility of forgetting the -R with shutdown or using the wrong init function and having to contact the NOC ;)
     
  8. Sheldon

    Sheldon Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    in my mind using reboot is bad.... its a shock to the system.

    not to mention if any user is editing files, uploading a file etc.

    using the proper format allows the server to shutdown / reboot on its time

    not yours.

    there are times when reboot or shutdown -r now is required, but most
    of the time you want the services/programs/users to be able to save
    their work and stop what they are doing.

    you wouldnt want an update process for example to be killed in the middle
    of it would you? or for example a user creating or running a db query.

    that would / could corrupt a db.

    Sheldon
     
  9. Sinewy

    Sinewy Member

    Joined:
    May 15, 2004
    Messages:
    370
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney, Australia
    reboot = equivalent of Forceful System Reboot in whm
    shutdown -r = equiv of graceful.
     
  10. chirpy

    chirpy Super Moderator

    Joined:
    Jun 15, 2002
    Messages:
    13,499
    Likes Received:
    14
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Nope. From the man page:
    Reboot shuts down your processes first, dismounts partitions where it can and then reboots. The chances of corruption are minimal. I don't understand what you're suggesting as an alternative? Don't reboot?
     
  11. SarcNBit

    SarcNBit Active Member

    Joined:
    Oct 14, 2003
    Messages:
    1,015
    Likes Received:
    3
    Trophy Points:
    38
    They are essentially the same command. Assuming now is appended to the shutdown command, 'shutdown -r now' will call reboot. 'reboot -f' is the not so nice one.
     
  12. mhbrands

    mhbrands New Member

    Joined:
    Apr 12, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Kansas
    reboot

    I use:

    /sbin/shutdown -r now

    and have never had a problem :p
     

Share This Page