Rudder2 Posted May 8, 2017 Share Posted May 8, 2017 My server runs non stop with minimal servicing. I find when it's up from 1.5 to 8 weeks the server's internet speed is seriously slowed on everything from Dockers to VMs. I don't find this as off because I reboot all my computers once a week but unRAID get neglected because it's the server and I don't think about it when I'm home and I'm also away from home relying on unRAID to keep chugging on it's own. I was wandering if there was either a plugin, or command I can use in a cron script, to have my server reboot every week on a certain day @ 0400. Since the problem always manifests greater than one week, usually closer to 2 weeks, and after a reboot the whole server functions better as a whole makes me feel this is a good idea. I've been searching the internet and Lime-Tech forms high and lot to find this answer and nothing has came from it. If anyone could help me I would GREATLY appreciate it. Oh, yeah, I'm running unRAID 6.3.3 at the time of writing this. It would be nice if a reboot was able to be scheduled from the Scheduler but I'm not asking for that because I know you have more pressing matters. Thank you for your time, Rudder2 Quote Link to comment
Squid Posted May 8, 2017 Share Posted May 8, 2017 User scripts pluginScript will bepowerdown -rSent from my LG-D852 using Tapatalk 1 Quote Link to comment
Rudder2 Posted May 8, 2017 Author Share Posted May 8, 2017 Thank you so much Squid! This is exactly what I needed! Quote Link to comment
Rudder2 Posted May 8, 2017 Author Share Posted May 8, 2017 (edited) Squid, I spoke too soon. I cannot get the powerdown -r to function because I cannot find the location of the powerdown command to write my own user script and I cannot find a pre written powerdown -r script. I've once again search google high and low and have resorted back to this form. I keep getting a this error: Script location: /tmp/user.scripts/tmpScripts/powerdown -r/scriptNote that closing this window will abort the execution of this script/usr/local/emhttp/plugins/user.scripts/startScript.sh: /tmp/user.scripts/tmpScripts/powerdown -r/script: /bin/bashpowerdown: bad interpreter: No such file or directory The script I wrote is #!/bin/bashpowerdown -r Please tell me what I'm doing wrong. Sorry for any inconvenience. Thank you for you time, Rudder2 Edited May 8, 2017 by Rudder2 Messed up Quote Link to comment
Squid Posted May 8, 2017 Share Posted May 8, 2017 Squid, I spoke too soon. I cannot get the powerdown -r to function because I cannot find the location of the powerdown command to write my own user script and I cannot find a pre written powerdown -r script. I've once again search google high and low and have resorted back to this form. I keep getting a this error: Script location: /tmp/user.scripts/tmpScripts/powerdown -r/scriptNote that closing this window will abort the execution of this script/usr/local/emhttp/plugins/user.scripts/startScript.sh: /tmp/user.scripts/tmpScripts/powerdown -r/script: /bin/bashpowerdown: bad interpreter: No such file or directory The script I wrote is #!/bin/bashpowerdown -r Please tell me what I'm doing wrong. Sorry for any inconvenience. Thank you for you time, Rudder2Read the op or add a script and edit it within the plugin itselfSent from my LG-D852 using Tapatalk Quote Link to comment
CHBMB Posted May 8, 2017 Share Posted May 8, 2017 Try a space and a new line between bash & powerdown -r Quote Link to comment
Rudder2 Posted May 8, 2017 Author Share Posted May 8, 2017 This is going to sound stupid but I don't understand acronyms...What does op mean? I've read over and over what you originally said Squid but end up with more questions than answers. I went to the Plugin Page and read all I could there and even went to the Scripts page and read there. Yes, I discovered when I saved the script it didn't save with the enter the first time. Should of saw that when I copied and pasted, Thanks for pointing that out CHBMB. The new saved script it: #!/bin/bash powerdown -r And I get this error now: Script location: /tmp/user.scripts/tmpScripts/powerdown -r/scriptNote that closing this window will abort the execution of this script/tmp/user.scripts/tmpScripts/powerdown -r/script: line 2: powerdown: command not found Ironically, when I type powerdown -r in terminal it works fine. I think I need to know the location of the powerdown file to put in the script but I don't know that for sure. Thank you for your time, Rudder2 Quote Link to comment
CHBMB Posted May 8, 2017 Share Posted May 8, 2017 Have a read here. OP = Original Post 1 Quote Link to comment
CHBMB Posted May 8, 2017 Share Posted May 8, 2017 Create a file called "script" containing only this powerdown -r Copy that file to your flash drive, in the folder config/plugins/user.scripts/scripts/powerdown/ Job done. Quote Link to comment
Rudder2 Posted May 8, 2017 Author Share Posted May 8, 2017 I tried that and I get command not found. Script location: /tmp/user.scripts/tmpScripts/powerdown -r/scriptNote that closing this window will abort the execution of this script/tmp/user.scripts/tmpScripts/powerdown -r/script: line 2: powerdown: command not found Quote Link to comment
CHBMB Posted May 8, 2017 Share Posted May 8, 2017 What version of Unraid you running? Quote Link to comment
Squid Posted May 8, 2017 Share Posted May 8, 2017 You May have to give it the full path. Probably wrong but off the top of my head /usr/sbin/powerdown -rSent from my LG-D852 using Tapatalk 1 Quote Link to comment
Rudder2 Posted May 8, 2017 Author Share Posted May 8, 2017 It works. The complete path is /usr/local/sbin/powerdown -r and you must use it. Thank you both CHBMB and Squid! I though that was the problem but nowhere on-line could I find that path. The working script Just want to spell it out so the next person who looks for this will hopefully be able to get it to work without asking. I'm all about self help but sometimes after days of searching and coming up short I eventually ask for help. I've been researching this for 3 days till I got frustrated and asked for help. Thank you for both of your time so much! Rudder2 1 1 Quote Link to comment
CHBMB Posted May 8, 2017 Share Posted May 8, 2017 Just a thought.... the powerdown -r command might be deprecated. I'll need to check. Quote Link to comment
Squid Posted May 8, 2017 Share Posted May 8, 2017 (edited) 1 hour ago, CHBMB said: Just a thought.... the powerdown -r command might be deprecated. I'll need to check. It technically is, and is just a wrapper script for either the reboot or shutdown commands. However its use is so prevalent that I for one would be mildly peeved should that wrapper script ever not be included in unraid (and would be forced to create a plugin just to have the script present). (IE: no matter how much LT says its deprecated, I've been saying powerdown -r for years now, and will continue to say it for years to come) Edited May 9, 2017 by Squid Quote Link to comment
MrCrispy Posted May 9, 2017 Share Posted May 9, 2017 So does shutdown/reboot perform a graceful shutdown? Does it abort current disk activity? Can it cause corruption on the file system? Does it interface with the UPS? I remember reading that there are issues with shutdown. Quote Link to comment
Squid Posted May 9, 2017 Share Posted May 9, 2017 Shutdown / reboot / powerdown all perform a graceful shutdown. There are some edge cases where it is possible that it won't work - akin to Windows sitting there on a shutdown screen stating that "program xxxx" is preventing this computer from shutting down, but those edge cases are rare. Not sure what you exactly mean by interface with the UPS though. The UPS can trigger a powerdown of unRaid (which runs the shutdown routine). Quote Link to comment
Fireball3 Posted May 9, 2017 Share Posted May 9, 2017 5 hours ago, MrCrispy said: I remember reading that there are issues with shutdown. 5 hours ago, Squid said: Shutdown / reboot / powerdown all perform a graceful shutdown. Until unRAID v6.? it was not performing a graceful shutdown by default. Posts from former times are still spread all over the forum so that's where you probably read about it. Quote Link to comment
cholzer Posted December 2, 2017 Share Posted December 2, 2017 On 5/9/2017 at 12:49 AM, Rudder2 said: It works. The complete path is /usr/local/sbin/powerdown -r and you must use it. Thank you both CHBMB and Squid! I though that was the problem but nowhere on-line could I find that path. The working script Just want to spell it out so the next person who looks for this will hopefully be able to get it to work without asking. I'm all about self help but sometimes after days of searching and coming up short I eventually ask for help. I've been researching this for 3 days till I got frustrated and asked for help. Thank you for both of your time so much! Rudder2 Thanks! I just had my unRAID freeze after it worked nicely for an entire week. I will try scheduled restarts to see if that makes the system more stable. Quote Link to comment
Braulio Dias Ribeiro Posted October 16, 2021 Share Posted October 16, 2021 (edited) Need to stop array before running powerdown -r? Or powerdown -r does this automatically? And the VM? Do I need some command to shut down first? Edited October 16, 2021 by Braulio Quote Link to comment
techukie Posted October 26, 2021 Share Posted October 26, 2021 A graceful shutdown stops all docker containers and VMs gracefully, without issue. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.