clean shutdown

11 posts / 0 new
Last post
kopancek
kopancek's picture
clean shutdown

Hi, I'm wondering if there is a way to cleanly shutdown the wnr3500l, unmounting all the drives, stopping services, etc. I have dd-wrt and halt command is not working (not doing a thing).

Also, I'm wondering if I resolve this and can shutdown through ssh, is there a way, to trigger this clean shutdown by poweroff button? Because when I press it, the router goes off, but disk is not cleanly unmounted which can result in data loss... Thank's for your ideas.

Kong
Kong's picture
You can add some commands for

You can add some commands for a clean shutdown under: Administration->Commands
To make sure all data is written, just add:

killall pocessnames
sync
umount /mountpoint

kopancek
kopancek's picture
@Kong: What you suggest is

@Kong: What you suggest is nice, but I already have shutdown script set like you suggested. My problem is, that I can't shutdown the router in typical linux way, like shutdown -h now, halt, init 0, etc.

Because I need to shut it down every night (it's in my bedroom) and this would be the proper way. Neither halt, nor poweroff command did start the shutdown process, like reboot does. Also, switching off the power button in the back does not trigger the shutdown script, it just turns the power off. So, what is the proper command to shut it down? Or is there no such way?

I could simply invoke the shutdown script manually, but it seems a bit unclean to me :)

Kong
Kong's picture
Just add the commands via

Just add the commands via webinterface and press "Save Shutdown" the commands will be called on a reboot.

kopancek
kopancek's picture
As I said in my previous post

As I said in my previous post, I do NOT want to reboot, I want to TURN OFF the router... I also said, that I already have those commands added via web-interface... Did you read my previous posts?

Kong
Kong's picture
Sorry I did not completely

Sorry I did not completely read your post. Poweroff does not trigger any shutdown scripts as it does not really use SysVinit. If you look at:

/etc/profile

you will see that in case reboot is called shutdown scripts and the shutdown section from nvram is called, therefore you would have to write a function for poweroff that is doing the same, thus if poweroff is called the router will execute shutdown scripts etc.

martin
martin's picture
Hello Friends

Hello Friends

I am Justin Martin Smith from USA

I am new to this forum...

Some data recovery companies refer to the Dirty Shutdown message as the error of Doom! In the past, this may have required sending your company's data offsite for data recovery efforts, but this is no longer the case. Instead of spending thousands of dollars for data recovery, you can download eMag’s Clean Shutdown - Dirty Shutdown Repair Utility for $250.00 and fix the problem yourself within minutes!

Clean Shutdown has been proven successful through Microsoft's rigorous testing and has earned the Microsoft ISV Competency certification. Hundreds of our clients have already experienced the success and ease of using this program. It not only has an interface that is easy to navigate, but it works within minutes. The interface of this program has recently been redesigned to reflect the new Windows Vista layout.

Download Now

Have a Nice Day.

--------------------------------

Want to get-on Google's first page and loads of traffic to your website?
Hire a SEO Specialist from Ocean Groups [url=http://oceangroups.org/] SEO SPECIALIST [/url]

CrisNet
CrisNet's picture
Kong said:...  therefore you

Kong said:...  therefore you would have to write a function for poweroff that is doing the same, thus if poweroff is called the router will execute shutdown scripts etc.

"clean shutdown" sounds good..
@ kopancek: issue resolved? Did you or any one else find a workaround

 

kopancek
kopancek's picture
Well, as Kong said, there is

Well, as Kong said, there is a workaround to poweroff, write your own function. But it is not triggered by the poweroff button (I haven't figured out how could this be configured). Also, because dd-wrt does not allow to create other user than root, I can't create user shutdown with .bashrc or similar file set to shut the router down and then use ssh-keys to login without password. Therefore any automatic way to shutdown the router is in my opinion doomed.

What I have been succesfull at is creating my 'shutdown' script, which stops services which depend on disk and unmounts the disk (then it is safe to just unplug the power cable). I can run this script from webinterface or ssh (a BIT annoying, yes...). So if you have any advice how to automate this process, it would be highly appreciated.

CrisNet
CrisNet's picture
I think the poweroff button

I think the poweroff button can not be used for triggering anything, as it is simply a switch, cutting off the power supply (this is an assumption, however).

Tomato offers customised use of the WDS button.
By default USB unmount, shutdown, wireless on/off and reboot may be configured depending on how long the WDS button is pressed. Additionally custom commands can be issued as well. I guess that is what you have been looking for, although not dd-wrt.

kopancek
kopancek's picture
CrisNet said: I think the

CrisNet said: I think the poweroff button can not be used for triggering anything, as it is simply a switch, cutting off the power supply (this is an assumption, however). Tomato offers customised use of the WDS button. By default USB unmount, shutdown, wireless on/off and reboot may be configured depending on how long the WDS button is pressed. Additionally custom commands can be issued as well. I guess that is what you have been looking for, although not dd-wrt.

That sounds really interesting, so my next step is try to locate /dev/eventX for WDS button in DD-WRT. With no luck, Tomato sounds like solution if only it had Samba3 support.