Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

powerbutton clean shutdown

Featured Replies

Hmmm, Looks like it did not actually stop the array.

I must look into this.

 

Sep  8 23:30:19 Tower mdcmd[2241]: mdState=STARTED

 

 

OOOPPS...

 

I'm a bone head.

 

    logger "Stopping the Array"
    #echo stop > /proc/mdcmd
    #sleep 1
    #echo status > /proc/mdcmd
    #logger      < /proc/mdcmd

/etc/rc.d/rc.unRAID: unmodified, readonly: line 137 of 165 [83%]

 

Uncomment these after install and you can try again. LOL.

I'll update the package later on when I get home.

 

  • Replies 103
  • Views 47.1k
  • Created
  • Last Reply

    logger "Stopping the Array"
    #echo stop > /proc/mdcmd
    #sleep 1
    #echo status > /proc/mdcmd
    #logger      < /proc/mdcmd

/etc/rc.d/rc.unRAID: unmodified, readonly: line 137 of 165 [83%]

 

Uncomment these after install and you can try again. LOL.

I'll update the package later on when I get home.

 

 

WeeboTech;

 

I'm not sure if you updated the powerdown package and uploaded it somewhere else, so my apologies if I only succeed in creating confusion here, but I've attached an updated powerdown package with the corrections you suggest above and can confirm it works well on my system.  Very helpful package, thank you!

 

>>> I'm not sure if you updated the powerdown package and uploaded it somewhere else

 

I was adding some other functionality to the script and have not finished it.

I wanted to do an mdcmd status before I stop the array, then another after I stop it, then do a diff.

This is just to capture certain issues.

 

I'm also adding a status command that will display part of what Joe cooL's unMENU and unRAID Mailer do.

There was something else I thought about doing in the wee hours of the morning.. but now I cannot remember it.

Ahh.. it'll come back, always does.

 

Yes. I dream in Full Code..  ;)

Actually on the subway ride I go into low alpha-theta state and write chunks of my programs in a sorta dream like trance.

 

well, so hurry up and finish it !!!  ;D

Powerdown comes to the rescue!

 

I was in the middle of copying a large file to my unRAID server last night when we had a power outage at about 11:00pm

 

I had been meaning to install the APC package, but had not done that yet, but do have Powredown installed.

 

In a pitch black house, I grapped my closest lightsource (a Blackberry) and was able to find my way into the dark basement (where my unRAID server lives) and pressed [Ctrl][Alt][Del].

 

It took a little while to spin up all the drive to complete the shutdown, but within a minute of so the machine powered down cleanly.

 

I then grabbed the UPS and took it upstairs to hook up a fan in the MBR.  (Interesting that the fan did not spin at quite full speed under UPS power).

 

With power restored this morning, I powered up unRAID and all is well. No parity check!

 

I checked the syslog (that it saved) and notice that quite a lot of information was added (Call Traces?).  I am assuming that is by design. 

 

Thanks WeeboTech!

 

I checked the syslog (that it saved) and notice that quite a lot of information was added (Call Traces?).  I am assuming that is by design.

 

This is just a few diagnostic dumps of information about the machine, it's state and devices.

 

If you run the /etc/rc.d/rc.unRAID syslog command it will do the diagnostic dump and syslog save to the flash.

 

Should make it easier for newbies. (it even makes .zip archive if you have infozip installed).

 

What I plan to do is add a hook into log rotate to call the syslog save routine here.

This should allow 10 syslogs, either from a rotate or reboot.

 

I figured it would be good to add dumps of the smartctl information too. That's why it's so lengthy.

 

Glad it worked for ya!  That's why I added the ctrl-alt-del hook.

 

 

  • 2 weeks later...

brainbone, help me please.

 

I do install powerdown script. I do press ctrl+alt+del on keyboard connected to UnRaid server. Powerdown is execute and after power on UnRaid server then parity check is not run. This is OK.

 

But if I press power-off button then server is shutdown UnRaid server not correctly - probably not process powerdown script. After UnRaid server start then parity check is run.

 

Thnaks for help me

But if I press power-off button then server is shutdown UnRaid server not correctly

 

Not every machine can process the power button correctly. I think you might need acpi enabled in the bios.

I do have a machine that does not process the powerbutton (and another that does).

WeeboTech,  ACPI in BIOS I have enabled.

When you press the power button, do you see the messages on the console showing unRAID shutting down.. or does it just... ummm.. ::) Blip and power off? 

 

With my machines, (that do work with the power button) I press it for a mere second and then it goes through the shutdown gracefully.

 

Do you have immediate power off in your bios or 4 second delay?

I think the working machine is set for a 4 second delay.

When you press the power button, do you see the messages on the console showing unRAID shutting down.. or does it just... ummm.. ::) Blip and power off? 

 

I see messages on LCD.

 

But I look on same row on screen this:

 

..../config/rc.local/rc.local_shutdown : Bad interrpreter.. #!/bin/bash

 

In file rc.local_shutdown I have:

#!/bin/bash

# Save User home files in root filesystem
if [ "${DEBUG:=0}" -gt 0 ]
   then set -x -v
fi

while read USER DIRS
do
NF=`eval find ~$USER -newer /boot/home/$USER.tar.gz | wc -l`
if [ $NF -gt 0 ] 
   then echo "Saving ~$USER home files"
        eval cd ~$USER && tar -vczf /boot/home/$USER.tar.gz $DIRS
fi
done <<-EOF
root     .ssh .profile .bash_profile sh bin
rcotrone .ssh .profile .bash_profile sh bin
EOF


find /etc/ssh -type f -newer /boot/config/etc/ssh/saved -exec cp -v {} /boot/config/etc/ssh \;
touch /boot/config/etc/ssh/saved

 

I copy this from post http://lime-technology.com/forum/index.php?topic=1511.0

 

 

With my machines, (that do work with the power button) I press it for a mere second and then it goes through the shutdown gracefully.

 

My server is shutdown directly too. if I press power button long (4 seconds?)

 

Do you have immediate power off in your bios or 4 second delay?

I think the working machine is set for a 4 second delay.

 

Yes power is off, if I press power button long (4 seconds?)

do

ls -l /etc/rc.d/rc.local_shutdown

then do

cat /etc/rc.d/rc.local_shutdown

do

ls -l /etc/rc.d/rc.local_shutdown

then do

cat /etc/rc.d/rc.local_shutdown

 

Ok. I do try it.

 

How to I create log file for shutdown process, please?

No log for shutdown at this time, let me see these files to determine the issue.

do

ls -l /etc/rc.d/rc.local_shutdown

then do

cat /etc/rc.d/rc.local_shutdown

 

Ok. I do try it.

 

How to I create log file for shutdown process, please?

 

WeeboTech, this is result:

 

Linux 2.6.24.4-unRAID.
root@Tower:~# ls -l /etc/rc.d/rc.local_shutdown
-rwxr--r-- 1 root root 40 Sep 26 14:14 /etc/rc.d/rc.local_shutdown*
root@Tower:~# cat /etc/rc.d/rc.local_shutdown
/boot/config/rc.local/rc.local_shutdown
root@Tower:~#

 

 

You have PM. Let's take this offline as the startup scripts being used is an older version that seems to be causing a conflict in initializing the rc.local_shutdown command.

Before I install the package from the command line, I have to cd /boot.  To do it from the go file would I add this line?

 

CTRLALTDEL=yes installpkg boot/powerdown-1.00-noarch-unRAID.tgz

Before I install the package from the command line, I have to cd /boot.  To do it from the go file would I add this line?

 

CTRLALTDEL=yes installpkg boot/powerdown-1.00-noarch-unRAID.tgz

Close...

You would need to give the full path to the file, your example gave a relative path.

 

instead of boot/powerdown.1.00-noarch-unRAID.tgz

you need in your command

/boot/powerdown.1.00-noarch-unRAID.tgz

 

Your example is missing the leading "/" of the file path.

 

Joe L.

Gotcha.  Thanks!

One more thing... shoudl this have displayed once iunstalled through telnet?

 

powerdown: powerdown  Control scripts for the unRAID server Environment.
powerdown:
powerdown: Implements powerdown control scripts to assist unRAID environment
powerdown: /sbin/powerdown for quick -n- simple powerdown from command line   
powerdown:
powerdown: contrl-alt-del hooks to allow quick keyboard shutdown
powerdown:  Install with
powerdown:
powerdown: CTRLALTDEL=yes installpkg powerdown-1.00-noarch-unRAID.tgz
powerdown:
powerdown: /etc/rc.d/rc.unRAID script to do basic power down functions
powerdown: Hooks are placed in /etc/rc.d/rc.local_shutdown
powerdown: so that normal poweroff/shutdown commands do a graceful shutdown
powerdown:
powerdown: Diagnostic mode for dumping and saving syslogs to /boot/logs
powerdown: call with /etc/rc.d/rc.unRAID syslog
powerdown: 

 

Because I didn't see that.

That banner should have displayed during installpkg

I see it now.  I didn't realize it, but I was using 1.00.  I upgraded to 1.01 and those lines now show.  Thanks.

Yeah, we gotta come up with a better way to post mods to keep the most up to date versions available and visible.

  • 4 weeks later...

I have this installed on both of my servers and neither and today I noticed that neither of them had saved any recent syslogs.  WeeboTech said:

 

It will keep at most 10 syslogs in the logs directory.

 

Each of my servers contains 10 logs, but all are old.  Is it possible that it's keeping the ten oldest logs instead of the ten most recent?  It looks as though that might be what's happening on my servers.  Can anyone confirm this?

Currently It only saves the syslogs upon shutdown. (or stop).

I think (depending on version) you can run /etc/rc.d/rc.unRAID syslog  and it will save the current syslog.

Please test and provide a capture of the output.

also do an ls -l /boot/logs

 

Archived

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.