Jump to content

[RESOLVED] HELP !!! How to Shut Down via Telnet??


Recommended Posts

Okay, my server just stopped responding to the web GUI -- tried from several different PC's.

 

But I can access the disks and shares just fine !!

 

When I first noticed this, I tried UnMenu ... and it responded !!    I could switch between its pages, etc. just fine UNTIL I tried to access UnRAID Main from UnMenu.    It then hung, and won't respond anymore (I suspect it's still trying to access UnRAID Main).

 

So ... I hit the power switch on the server, which should cause a clean power-down;  but it did not.  [i could of course just hold it for a few seconds and force a "dirty" power down ... but I'd really like that to be a last resort.]

 

Next, with not much expectation of success, I tried to Telnet in to the server -- and it Worked !!

 

So, I've got a root login, but am a total dunce with regard to Linux.  I have no idea how to gracefully shut down the server ... but I'll leave the telnet window open in the hopes that someone can tell me (Joe L, are you there ??).    I found several threads where folks have used various commands -- but usually someone else chimes in and says it was the wrong way to do it ... and these have often resulted in "dirty" shutdowns and/or other problems.

 

System is UnRAID 4.7 with no add-ons except UnMenu, Clean Powerdown, and the APC UPS utility.    I suppose one way to do a "clean" shutdown is just unplug it ... and after 5 minutes it SHOULD shut down.    But if there's a way to do this a bit more directly via my Telnet window that would be preferable.

 

 

Link to comment

Does that execute the "clean powerdown" script?    My understanding is that all the drives need to be spun up;  unmounted; and then the system can do a clean shutdown.    I think that's what the "clean powerdown" script does.

 

So is it your understanding that I should do the following:

 

(1)  Navigate to:

 

root@Tower:/etc/rc.d#

 

(2)  Type:

 

rc.unRAID "powerdown"

 

I found a March 2010 post from JoeL that indicates the powerdown command will run all the unraid stop scripts; un-mount the disks; and powerdown.  I presume this is his "clean Powerdown" script that I installed through UnMenu.    Also, does "powerdown" need to be in quotes (as I show it), or is the command just like this:

 

rc.unRAID powerdown

 

 

Added:  One more thought:  Is rc.unRAID powerdown (with/without quotes as appropriate) the same thing that SHOULD happen if the APC UPS package initiates a powerdown?    One way to be sure it's executed correctly (IF the APC package is running okay)  is to simply unplug the server ... as I noted above, I'd prefer to not do that;  but I'll certainly try that before I just do a "forced" power off by holding in the power switch.

 

Link to comment

Well ... after reading some more, I had decided the rc.unRAID powerdown was to install the script;  and to actually execute it you just type "powerdown" at root.

 

So ... that's what I did -- and the Telnet session simply hung.

 

It's now been about 30 minutes, and it's still hung, so I just shut down the Telnet client.

 

Meanwhile, I connected a monitor to the server, and it still shows what I assume is the original login from the last time it was booted (several months ago).  I plugged in a USB keyboard and it's fully responsive, so I can type commands at the server console as needed.

 

Just for grins, I just now tried to reopen a Telnet connection -- and it works fine ... so I'm also logged in that way.    Finally, I tried streaming a movie from the server -- and it also works just fine.    So I can USE the server with no problem;  I just can't get to the web GUI !!  (or to UnMenu ever since I tried to access UnRAID Main from it)

 

I think I'll leave everything as they are overnight to see if someone has a definitive way to resolve this short of simply yanking the plug.    I know the GUI was working a few hours ago, as I copied a few GB to the server and looked at the status right after the copy (both to confirm all was well, and to note the free space on the share I was copying to).

 

VERY frustrating -- and definitely makes me realize how much I REALLY should spend some time and learn a bit of Linux.

 

FWIW the server's on a SuperMicro C2SEE board with 4GB of RAM and has 14 drives with ~ 22TB of space (mostly 2TB drives).    As I noted earlier, it's running v4.7;  the only add-on is UnMenu with the Clean Powerdown and APC packages.

 

Link to comment

You wouldn't happen to have Simple Features installed do you?  I had the same issue last week when I was upgrading my parity drive from 2TB to 3TB HDD.  I used telnet and "powerdown" wouldn't work either.  I typed reboot, and it rebooted the server.  There after I was able to access the web GUI via IP address, and I was able to shutdown and re-start the server.

 

This never happened to me until I started using Simple Features.

Link to comment

No, I'm not using Simple Features (I don't think that's even possible in v4.7).    When you typed "reboot" did you do that from root?    ... and did that cause an automated parity check on the next reboot?

 

As for shutting things down cleanly ... I've been trying to find just how to do this clean shutdown from old threads, but without any luck.    Hopefully Joe L., WeeboTech, etc. will see this and hold my hand :-)

 

I don't feel TOO bad, however, as I did find a thread from a couple years ago with a long discussion about how to cleanly shut down from the power button (I think my system's supposed to do that, but it's not working -- which may mean it's tied to the Web GUI "Stop", and of course with the Web GUI crashed ...);  and as part of that discussion someone asked why folks don't just shut down from the console ==> Joe L's comment was that "... If there is a keyboard, and if you know how to cleanly stop the array, yes. But 99.99% of unRAID users will not know the commands to cleanly shut down from the keyboard."

 

So at least I'm not alone in not having a clue as to how to do this !!

 

Surprisingly, I can't find any subsequent tutorials to help those 99.9% do it from the console.

 

I also found where typing "powerdown" (as Automatic suggested and as I tried ~ 90 min ago) won't necessarily do a clean powerdown of the system ==>  Question:  "Doesn't the command "powerdown" typed in at the root just cleanly powerdown the system? ..."    Answer: "maybe".    Bottom line is it depends      I THINK the command I had found earlier [rc.unRAID "powerdown"  run from  root@Tower:/etc/rc.d# ] might be what I need to do;  but at this point I'd like to have that confirmed before I simply try it.    I really would like to get this shut down gracefully if possible.

 

I assume that what I conceptually need to do (but don't know how to in Linux) is ...

(a) List all active processes

(b) Kill those that shouldn't be running (e.g. the powerdown I tried earlier)

© Either restart the web GUI if possible;  or simply run the commands necessary to gracefully stop the array and powerdown ... either manually or via the Clean Powerdown script

 

Link to comment

I am running RC11.  When I did the reboot, I head my server rebooting, and I just assumed it rebooted.  I waited for a few minutes, and I tried tower:8080, but no luck.  I then tried my IP address, and I was able to get to the main menu of the GUI, and from there I was able to re-start it.

Link to comment

Between a bit of sleep and an AM Dr's appt, I'm just now back.

 

Is there any way to simply restart the web GUI ?

 

Or at least to see what is/isn't running right now (something similar to Windows Task Manager)?

 

I'd like to be able to confirm the APC package is running -- if it is, then simply unplugging the server should cause a clean powerdown, as it will for sure (at least I think it's for sure) run the correct version of powerdown.    Does this sound right?

 

Link to comment

Status update:  No real difference -- I'd still like some guidance on how to actually determine what is/isn't running.    But I did confirm that the array is working perfectly -- I just can't "see" it.

 

I copied a large (1GB or larger) file from each of the 13 data disks in the array -- this forces each of them to spin up;  and the good transfer rate confirms they're reading from the disk; not from a parity-reconstructed version of the data [Not to mention that if the latter happened, all subsequent disks would have already been spun up ... and that was never the case.].    Just to be sure, I then did some copies from the two shares I use ["DVDs" and "Backups"], and these also worked fine.

 

So ... my trusty old array is working fine ... I just can't get to the web GUI and don't know how to "look" at things from the console and/or telnet.  [The ONLY thing I've ever done from the console is run PreClear script ... by VERY carefully following JoeL's excellent instructions.]

 

Ideally, I'd like to just get the web GUI running again; then use it to cleanly stop the array and reboot the system.    But I've read several threads that note you can't simply restart the "emhttp" process to do this -- it can cause other issues.

 

What I thought might work is to kill UnMenu; then restart it.  Since I THINK UnMenu is currently "hung" trying to access the UnRAID Main (see the 3rd line of my first post).    I just don't know how to (a) confirm it's actually still running;  (b) kill it;  and © restart it.  I THINK the answer to © is /boot/unmenu/uu  (that's how it's started in the GO script, so I assume it will work from a telnet session -- but first I need to do (a) and (b)

 

Link to comment

THANKS !!

It takes two captures, but here's the output of /usr/bin/ps -eaf

 

It shows a line for both emhttp and unmenu/uu (see the top of the 2nd picture)  ==> does that mean they're both still running, but hung?

 

If so, how can I kill them and then restart them?

 

UnRAID_Processes_1.jpg.2be18885845ea4b7025e9a113c5381e7.jpg

UnRAID_Processes_2.jpg.1dc8e570c196e35499d5d499c9cd0baa.jpg

Link to comment

You said you tried accessing the web gui from several PC's, have you tried again recently? Also, is there a chance that you are using the same security software on all the PC's you have tried? I have seen multiple reports of an update to an antivirus / firewall program that suddenly blocked all access to local webservers.

Link to comment

I've tried it from 4 different PC/s laptops; a virtual machine with zero security (no firewall, no A/V) etc.

 

Note also that UnMenu originally responded when the webGUI wouldn't - but then it too quit responding when I clicked on the "UnRAID Main" link ... and hasn't responded since.

 

A few things I noticed on the list of processes ...

 

(a)  /usr/local/sbin/emhttp  => Does that mean it's running?  (but simply hung)

(b)  /bin/bash /boot/unmenu/uu  => Ditto for unmenu.    Also why the "/bin/bash" prefix?

©  logger -tunmenu -plocal17.info -i  ==> What does this mean?  Is it normal? or is it an indication of some issue with unmenu?

(d)  [mdrecoveryd]  => Does this mean something is trying to recover from an error?

(e)  /bin/bash /usr/local/sbin/powerdown  => Is this the powerdown I tried to run last night still trying to run?

 

Note also that while I've been running everything from a telnet session, I did hook up a monitor and USB keyboard to the server, so I can also do things directly from the console [but due to the location and a fairly large distance between the monitor and keyboard it's FAR more convenient to use the Telnet window on my PC.]  I assume that a command is a command -- regardless of which session it's entered from.

 

r.e. your note about just doing /usr/local/sbin/emhttp &

... I found a thread that said you shouldn't just do that -- I forget the specific errors it can cause (I'll see if I can find the thread).

... but I've seen several references to this sequence:

 

killall emhttp

nohup /usr/local/sbin/emhttp &

 

I presume that first kills the web GUI (which I assume is "emhttp");  then reloads it ... but what does the "nohup" do ??

 

Link to comment

UPDATE:

 

I just tried using a different browser (Firefox), and UnMenu connected !!

 

Still can't get to the primary Web GUI, but I do get a response from it as follows (My UnRAID server is named "media"):

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

Apache/2.2.3 (Red Hat) Server at www.media.com Port 80

 

HOWEVER ... there are no recent log files on the flash drive.  Is there a way to force the server to write the current log file?

 

Finally, is there a way to do a "clean" shutdown from UnMenu?  The Array Management page has a "Stop Array" button, but it's also got a note that you then have to use the normal Web GUI to restart it.  I don't see any "powerdown" option from within UnMenu-- but it seems to be fully functional (although I don't want to click on the button to go to the main Web GUI, as I suspect that will hang it again).

 

Link to comment

A bit more data ... while the flash drive doesn't have any recent logs;  UnMenu does show a complete log.  I've copied the most recent data -- attached below.

 

One issue not shown in this snippet is a line that read:

Mar  3 19:22:39 Media emhttp: shcmd (627): killall -HUP smbd (Minor Issues)

 

This is shown several times in the log --  on Dec 8, Dec 31, Jan 1, Jan 28, Feb 2, Feb 5, Feb 10, and finally on Mar 3 (the line I just copied).    Other than this line, and a few power failure/restore pairs when we've had minor power glitches that the UPS covered, there are no other "yellow" entries in the log -- and NO red entries except the one shown in the attached snippet, which I think is when I plugged in a keyboard last night (early this morning actually).

 

The attached snippet starts from when I logged in via Telnet, so this was after the web GUI stopped responding -- but there are NO non-routine entries in the log for days before that.    Note also the unmenu entries at 12:01:53 -- that seems to be where it "gave up" on connecting to the web server; and probably explains why I could then log in to unmenu a while ago.

 

UnRAID_Log_Segment_from_UnMenu.jpg.8081d5cbb9d7a20d14f4e9605bd1e7aa.jpg

Link to comment

Okay, I've got the webGUI back up and running [see my "Is this Safe to do?" question]

 

But for future reference, is the /sbin/powerdown  command the built-in UnRAID version;  or is that where the Clean Powerdown script installed by UnMenu is at?

 

I tried "powerdown" last night ... but all it did was hang the telnet session.

But I typed the powerdown command from root -- not from /sbin  ==> so I assume I was executing the wrong one.

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...