DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-05-10 01:41:09

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

power button check program

hi,
this is a simple program that do the only one right thing - waits till the power button is pressed, then executes a custom script provided by you..

it is the simple app that should work with d-link crappy kernel, but i will make another one (but maybe i should check the apm utils) for custom kernel i am planning to build.
post if it works for you, because on my box it works only for one button press (???lol wtf??). it catches the button for factory defaults too, and does the same as with the powerbutton

Offline

 

#2 2008-05-10 16:22:21

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: power button check program

great honour to you! It works!

But seems to have still some little problems.
When I start the pbutton on command-line, it works fine.
O.K., after a reboot it never works, but this isnīt a really prob.
But when i try to load it in /etc/rc.local it never stays alive.
When I found the reason why, I will immediately report here.

Many thanks     the bear.


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#3 2008-05-10 16:43:44

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: power button check program

CharminBaer wrote:

great honour to you! It works!

But seems to have still some little problems.
When I start the pbutton on command-line, it works fine.
O.K., after a reboot it never works, but this isnīt a really prob.
But when i try to load it in /etc/rc.local it never stays alive.
When I found the reason why, I will immediately report here.

Many thanks     the bear.

Didn't you forget to add a & on the end of the line, to start the program in the background?

Offline

 

#4 2008-05-10 19:31:08

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: power button check program

Yes, did...
added some lines playing with the ledīs too...
Manually it works, automatically on bootup dont...


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#5 2008-05-10 21:25:03

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: power button check program

i made this in the default system:
copied the pbutton into the /ffp/sbin/
commented out ubutton start in the /etc/rc.sh
added a line
Code:

Code:

 /ffp/sbin/pbutton -s /ffp/bin/sh -e /usr/sbin/halt.sh&

at the end of the /etc/rc.sh

now it works with the "restore default settings button", but not with the front power button hmm dunno what is wrong

Offline

 

#6 2008-05-11 12:48:36

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: power button check program

Just looked after the user user rights, pbutton and pbscript having 755, this must be right, /etc/rc.local has 755, also itīs O.K. Starting "pbutton -s /bin/sh -e /usr/sbin/halt.sh" manually, also when starting /etc/rc.local by hand. Then I can see the PID of pbutton with ps -aef, and when pressing the powerbutton the messagefile says  "Power event by Button..." and the box shutting down fine.
But not by bootup, seems somebody or somewhat kills the pbutton process after the rc.local finished.
Iīm still searching for the reason...

Greetings   the bear


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#7 2008-05-12 16:50:23

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: power button check program

Success!

It was a simple Debian-related problem. We must prevent Debianīs init from his tidiness.
Seems the init process kills every recent task after finishing the bootscripts.

a simple line
"nohup pbutton -s /bin/sh -e /usr/sbin/halt.sh"
in /etc/rc.local solves the problem and the pbutton-process stays alive...

Next I plan to setting up the cross compiling environment.
Will be hard, donīt know, what to do yet...

Greetings and many thanks again...


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#8 2008-05-12 17:23:47

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: power button check program

Glad to hear it works for you!

crosscompile:
http://forum.dsmg600.info/viewtopic.php … 653#p14653

Offline

 

#9 2008-06-09 23:47:22

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: power button check program

This thread is quite interesting, donīt let it perish...


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#10 2009-03-07 19:01:19

schrei5
New member
Registered: 2009-03-07
Posts: 1

Re: power button check program

I'd love to see something like this for DNS 323.

But I can't find anything similar to /dev/sl_pwr on the DNS 323.

Has anybody an idea where to look for information how the power button is managed on the DNS 323?

thanks

Offline

 

#11 2009-06-02 02:16:08

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: power button check program

pcp wrote:

hi,
this is a simple program that do the only one right thing - waits till the power button is pressed, then executes a custom script provided by you..

Is the script available somewhere ? I can't see the file anywhere ... Maybe the post is too old ?

Thanks !


DNS-313

Offline

 

#12 2009-09-05 17:55:04

stoneage
New member
Registered: 2009-08-29
Posts: 3

Re: power button check program

HI PCP & CHARMINBAER

Vry interested in this development.
Need to bypass the Pbutton to start automatically after power resumes from power failure.
cant afford a UPS.
can u guys shed some light. Not familiar with linux lingo. step by step help needed.

tks

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB