Version 4.X Support (deprecated - use General Support above) > unRAID Server 4.5 [No new topics]

how can i customize the powerdown script?

(1/2) > >>

flixxx:
Hello,

I have the powerdown script installed and i'd like to know if there is anyway I can modify it.

My server does not ave a screen attached and sometimes it crashes (something i am sitll trying to figure out). When it does though i go press the power button but I have some custom files running preventing it from shutting down.

Specifically i'd like it to run swapoff -a -v and rc.syslogd stop

Is there a simple way of editing the powerdown script to include those 2?

Thank you

bubbaQ:
It can be done, but you have to either overwrite the script with your own or edit it with sed at bootup using the go script.

You might consider adding a cache drive, and putting swap and the logs there... then they won't affect shutdown.

flixxx:
Thanks Bubba,

I have a cache drive and swap is enabled on the drive. Currently though I moved the logs on one of the hard drives to capture the crashes that i'm experiencing, sometimes though they don't get captured, i guess because when i force reboot the server it loses the log file since it wasn't properly stopped.

jupilerman:
bump !  because i need some advice.

I'd like to run a script before any powerdown actions.
So I try to modify the powerdown script but I don't what to do (I'm not a linux expert, sorry).
Do I add it in the rc.unRAID script ?
And where ?

Thanks for any help. :)

WeeboTech:

--- Quote from: jupilerman on December 24, 2011, 02:24:39 AM ---bump !  because i need some advice.

I'd like to run a script before any powerdown actions.
So I try to modify the powerdown script but I don't what to do (I'm not a linux expert, sorry).
Do I add it in the rc.unRAID script ?
And where ?

Thanks for any help. :)


--- End quote ---

You can add another call out in this section like this.

[ -x /etc/rc.d/init.d/myscript  ] && /etc/rc.d/init.d/myscript stop


--- Code: ---# Stop unraid:
unRAID_stop()
{
    logger "Stopping unRAID."

    diagnostic_dump

    [ -x /etc/rc.d/init.d/vmware  ] && /etc/rc.d/init.d/vmware stop
    [ -x /etc/rc.d/rc.samba ] && /etc/rc.d/rc.samba stop
    [ -x /etc/rc.d/rc.nfsd  ] && /etc/rc.d/rc.nfsd  stop
>> add your lines here

    logger "Killing active pids on the array drives"

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version