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

#26 2009-06-24 03:02:29

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

Thanks for your reply, jcard.

jcard wrote:

No, I mean using the front-button.

That's good to know. The front-button goes through all of your LED glory perfectly when launched manually. No problem there.

jcard wrote:

What do you mean with "successive cron checks" in the above sentence? You are not running chkbutton2 through cron, aren't you?

Let me try to clarify. When chkbutton2 is launched (either at boot, or manually) I see the following for example when running 'logread':

Code:

Jun 23 15:44:26 dlink-EE65AE daemon.info chkbutton2: Starting
Jun 23 15:50:01 dlink-EE65AE cron.notice crond[1739]: USER root pid 2983 cmd /usr/sbin/offl_chk two&

If chkbutton2 is launched at boot, the "cron.notice" messages repeat successively with no standby. However if I launch it manually, eventually I get this:

Code:

Jun 23 15:53:17 dlink-EE65AE user.warn kernel: 
Jun 23 15:53:17 dlink-EE65AE user.warn kernel: ***************************************
Jun 23 15:53:17 dlink-EE65AE user.warn kernel: *            HD0 stand by now!        *
Jun 23 15:53:17 dlink-EE65AE user.warn kernel: ***************************************
Jun 23 15:53:17 dlink-EE65AE user.warn kernel: 
Jun 23 15:53:17 dlink-EE65AE user.warn kernel: ***************************************
Jun 23 15:53:17 dlink-EE65AE user.warn kernel: *            HD1 stand by now!        *
Jun 23 15:53:17 dlink-EE65AE user.warn kernel: ***************************************

jcard wrote:

No, I use ext3 (on a CH3SNAS)

That's great to know!

jcard wrote:

chkbutton2 does not touch the disk in any way. But it is an interesting hint, as all those programs use the same ioctl interface as chkbutton2 does. yes...
Some positive answers (that chkbutton works) from other users could be very usefull...

*crosses fingers* I'll keep troubleshooting in the meantime...

Offline

 

#27 2009-06-24 03:15:13

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

Hope this isn't taken as being a "spammy" kind of post, but I thought I'd share exact output of 'ps' with both the not-working-boot-launch and the working-manual-launch of chkbutton2.

The two PIDs begin to change with 'crond', though all the same number of processes are present in both. Do you think the order makes any difference?

The beginning is common to both:

Code:

PID   USER     COMMAND
    1 root     init                                
    2 root     [ksoftirqd/0]
    3 root     [events/0]
    4 root     [khelper]
    5 root     [kthread]
   11 root     [kblockd/0]
   14 root     [khubd]
   49 root     [pdflush]
   50 root     [pdflush]
   52 root     [aio/0]
   51 root     [kswapd0]
  190 root     [scsi_eh_0]
  191 root     [scsi_eh_1]
  192 root     [scsi_eh_2]
  193 root     [scsi_eh_3]
  204 root     [mtdblockd]
  218 root     [kcryptd/0]
  219 root     [kmirrord/0]
  241 root     [loop0]
 1293 root     atd 
 1298 root     smbd -D 
 1300 root     nmbd -D 
 1308 root     smbd -D 
 1330 root     xmldb -n config 
 1373 root     [md0_raid1]
 1411 root     [kjournald]
 1447 root     [kjournald]
 1515 root     [kjournald]
 1564 root     [kjournald]
 1609 root     /web/webs 
 1625 root     fancontrol 0 
 1645 root     op_server 3 3 3 
 1654 root     -sh 
 1716 root     check_hotplug 
 1720 root     check_daemon

If started at boot via enabling execute permissions /ffp/start:

Code:

PID   USER     COMMAND
 1746 root     crond 
 1783 root     pure-ftpd (SERVER)                                                                                                               
 1836 root     lpd Waiting
 1876 root     mserver 
 1877 root     apkg 
 1933 root     [scsi_eh_4]
 1934 root     [usb-storage]
 1942 root     [scsi_eh_5]
 1943 root     [usb-storage]
 1951 root     [scsi_eh_6]
 1952 root     [usb-storage]
 2115 root     /ffp/sbin/syslogd -C100 
 2125 root     /ffp/sbin/klogd -c 3 
 2141 root     /sbin/chkbutton2 /ffp/share/chkbutton2/cleanup.sh /ffp/share/chkbutton2/backup.sh 
 2156 root     /ffp/sbin/sshd 
 2191 root     /ffp/bin/openvpn --daemon --config /ffp/etc/openvpn/server.conf --tls-server 
 2242 root     sshd: root@pts/0  
 2244 root     -sh 
 2261 root     ps

If started manually as root via SSH:

Code:

PID   USER     COMMAND
 1783 root     pure-ftpd (SERVER)                                                                                                               
 1836 root     lpd Waiting
 1876 root     mserver 
 1877 root     apkg 
 1933 root     [scsi_eh_4]
 1934 root     [usb-storage]
 1942 root     [scsi_eh_5]
 1943 root     [usb-storage]
 1951 root     [scsi_eh_6]
 1952 root     [usb-storage]
 2115 root     /ffp/sbin/syslogd -C100 
 2125 root     /ffp/sbin/klogd -c 3 
 2156 root     /ffp/sbin/sshd 
 2191 root     /ffp/bin/openvpn --daemon --config /ffp/etc/openvpn/server.conf --tls-server 
 2242 root     sshd: root@pts/0  
 2244 root     -sh 
 2468 root     crond 
 2494 root     /sbin/chkbutton2 /ffp/share/chkbutton2/cleanup.sh /ffp/share/chkbutton2/backup.sh 
 2495 root     ps

Offline

 

#28 2009-06-26 06:01:57

jcard
Member
From: Portugal
Registered: 2008-09-21
Posts: 289

Re: chkbutton2, a replacement for chkbutton and cleanboot

I'm afraid I can't help you, as my CH3SNAS has a different firmware, and I don't know what is the purpose of the processes running on your box.
Anyhow, it seems to be a fw problem, as rcblackwell said that it is working OK on 1.07.

Just to be sure that the problem is not related with an early launch of chkbutton2, replace in /ffp/start/chkbutton2.sh the line "proc_start $command" with exactly the following:

at now + 10 min<<EOF
/sbin/chkbutton2
EOF

The EOF must be at the line start, no leading spaces!
This change just delays the launch of chkbutton2 by 10 minutes.


Please consider discussing Alt-F at http://groups.google.com/group/alt-f/topics
Please consider filling Alt-F bugs at http://code.google.com/p/alt-f/issues/list

Offline

 

#29 2009-06-26 06:27:46

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

You've done everything you could to help, and I'm very appreciative of that.

So right now I've changed my code per your suggestion to:

Code:

chkbutton2_start() 
{
        echo "Setting up $name..."
    pid=$(pidof chkbutton)
    if [ "$pid" != "" ]; then
        kill $pid
    fi

    cp $required_files /sbin/
    ln -sf /sbin/chkbutton2 /sbin/reboot2
    ln -sf /sbin/chkbutton2 /sbin/poweroff2
    # proc_start $command
    at now + 10 min<<EOF
    /sbin/chkbutton2
EOF
}

Hope that's correct. I'll post back the results soon.

EDIT: No dice. Weird!

Last edited by krimb1 (2009-06-26 13:46:07)

Offline

 

#30 2009-06-26 09:18:37

Sharp Rock
Member
Registered: 2009-05-13
Posts: 14

Re: chkbutton2, a replacement for chkbutton and cleanboot

Greetings to all,

New kid on the block.  Fairly new to Linux, but learning a lot fast.  I have chkbutton2 running on my DNS-323 with FW 1.08beta, ext3 file system, and booting ffp off a usb stick.  No issues.  Works GREAT!  I just checked my boot order in the /ffp/start (rcorder *.sh).  Chkbutton2 is starting right after syslogd, so very early.  Again, no problems.

krimb1:  Are you running ffp off the harddrive, or usb stick?  I'm quite the noob, but I had many issues trying all this stuff out, and keeping the disks so they would power down.  Once I got things booting off the stick, the drives stay down most of the time.  Something to think about.

Your mileage may vary, wishing you the best.

jcard:  Thanks for a great program!!!

Jerry

Last edited by Sharp Rock (2009-06-26 09:20:39)

Offline

 

#31 2009-06-26 10:06:58

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: chkbutton2, a replacement for chkbutton and cleanboot

I noticed the author of the script also created the yafsck.sh script. Is it possible to combine the 2 scripts?
Something like if you keep the button pressed for 12 seconds, it will perform the yafsck script, followed by a reboot, so services like lpd are started again as well?

Offline

 

#32 2009-06-26 13:45:14

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

Sharp Rock wrote:

I have chkbutton2 running on my DNS-323 with FW 1.08beta, ext3 file system, and booting ffp off a usb stick.  No issues.  Works GREAT!

This is quite encouraging! Thanks for letting me know it works for you.

Sharp Rock wrote:

I just checked my boot order in the /ffp/start (rcorder *.sh).  Chkbutton2 is starting right after syslogd, so very early.  Again, no problems.

My order is slightly different:

root@dlink-EE65AE:/mnt/freebird/ffp/start# rcorder *.sh
syslogd.sh
SERVERS.sh
portmap.sh
unfsd.sh
transmission.sh
chkbutton2.sh
...

Is there any command to bump chkbutton2 right after syslogd? That way my setup would be identical to yours. (Though portmap, unfsd, and transmission are not executable at the moment, and so will they will not be run.)

Sharp Rock wrote:

krimb1:  Are you running ffp off the harddrive, or usb stick?  I'm quite the noob, but I had many issues trying all this stuff out, and keeping the disks so they would power down.  Once I got things booting off the stick, the drives stay down most of the time.

Yup, running ffp off the usb stick. ^^  ("freebird" is my usb drive.) Though the problem I'm experiencing with chkbutton2 is the same whether I run ffp off the hard drive as well.

Offline

 

#33 2009-06-26 20:34:14

jcard
Member
From: Portugal
Registered: 2008-09-21
Posts: 289

Re: chkbutton2, a replacement for chkbutton and cleanboot

knireis wrote:

I noticed the author of the script also created the yafsck.sh script. Is it possible to combine the 2 scripts?
Something like if you keep the button pressed for 12 seconds, it will perform the yafsck script, followed by a reboot, so services like lpd are started again as well?

I think it is possible, you have to try it.

Is better to use the scripts associated with the button actions: the reboot/shutdown script and the backup script. You have to use the second, as the first has only 5 secs to do its work.

You can write your own script and customize /ffp/start/chkbutton2.sh, or modify the default and dummy one, /ffp/share/chkbutton2/backup.sh, adding the needed commands. You start it by momentary pressing the box back reset button.

You might have to change yafsck.sh, setting the "doreboot" variable to "yes" -- don't do it if you are using yafsck.sh in the boot mode!!! This was discussed in another thread.

Tradicionaly fsck is done at boot time, not at shutdown time, for obvious reasons. At boot time, If the disk is clean, fsck just takes a couple of seconds to complete, and boot time is not compromised. If the box was not properly shutdown, than you might have to wait a lot of time.
But, even if the disk is clean, every N mounts or M days fsck does a complete check. No free lunch :-)


Please consider discussing Alt-F at http://groups.google.com/group/alt-f/topics
Please consider filling Alt-F bugs at http://code.google.com/p/alt-f/issues/list

Offline

 

#34 2009-06-28 09:30:35

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

Okay, I think I may have gotten to the bottom of something.

In desperation I backed up the data on my drives and reformatted in FW 1.08 beta to RAID 1. Installed a basic version of fun_plug with only telnet, syslogd, and chkbutton2 enabled in /ffp/start.

To my amazement I saw the following in the last few lines of my 'logread' right after boot:

Jun 27 18:28:34 dlink-EE65AE user.info kernel: kjournald starting.  Commit interval 5 seconds
Jun 27 18:28:34 dlink-EE65AE user.info kernel: EXT3 FS on sdb4, internal journal
Jun 27 18:28:34 dlink-EE65AE user.info kernel: EXT3-fs: mounted filesystem with ordered data mode.
Jun 27 18:28:34 dlink-EE65AE user.warn kernel: md: mdadm(pid 1795)
Jun 27 18:28:34 dlink-EE65AE user.info kernel:  used obsolete MD ioctl, upgrade your software to use new ictls.
Jun 27 18:28:34 dlink-EE65AE daemon.info chkbutton2: Starting
Jun 27 18:30:01 dlink-EE65AE cron.notice crond[1727]: USER root pid 1979 cmd /usr/sbin/offl_chk two&
Jun 27 18:40:01 dlink-EE65AE cron.notice crond[1727]: USER root pid 2136 cmd /usr/sbin/offl_chk two&
Jun 27 18:50:01 dlink-EE65AE cron.notice crond[1727]: USER root pid 2281 cmd /usr/sbin/offl_chk two&
/ #

Obsolete ioctl? Isn't mdadm related to RAID configuration? Looking for help. smile

EDIT: I wanted to test my RAID theory and tried reformatting both my drives to standard partitions, no RAID. Unfortunately I keep getting "Hard Drive(s) Formatting Failure. (Error Code:107)." Do you think this might be related as well?

Last edited by krimb1 (2009-06-28 09:37:17)

Offline

 

#35 2009-06-28 18:58:49

Sharp Rock
Member
Registered: 2009-05-13
Posts: 14

Re: chkbutton2, a replacement for chkbutton and cleanboot

krimb1 wrote:

Jun 27 18:28:34 dlink-EE65AE user.info kernel:  used obsolete MD ioctl, upgrade your software to use new ictls.
Obsolete ioctl? Isn't mdadm related to RAID configuration? Looking for help. smile

EDIT: I wanted to test my RAID theory and tried reformatting both my drives to standard partitions, no RAID. Unfortunately I keep getting "Hard Drive(s) Formatting Failure. (Error Code:107)." Do you think this might be related as well?

krimb1,

Being a noob, I'm reluctant to jump in, but since I don't see any other replys...

I've read somewhere here on the forum that the "used obsolete MD ioctl" is a non-issue.  Part of D-Link's firmware, and not a problem.  I think we all have that message (I know I do).  Perhaps you could do a search, and find that post.  Something I noticed, but did not test to find all the "in's and out's" was if funplug was running, I could not "scan drives" or "format" using the 1.08 beta.  Sadly, I also forgot to mention that I am running RAID 1 on my first box, and a single drive on my second (my testing Toaster smile ).  checkbutton2 runs fine on both boxes.  I don't think this is your problem.

You had asked about how to change the start order of things in the /ffp/start directory.  In each of those ".sh" files, they usually begin with some lines stating PROVIDE, REQUIRE, and BEFORE.  By manipulating these entries, you can move things around.  Be careful!  Always recheck what you've done with rcorder *.sh .  It's possible to muck things up with "circular entries" (things will loop, and never finish).  I have no idea if there are other ramifications to doing this, but I've had no problems myself.

In your spot, I think I'd try narrowing things down.  What isn't causing the problem...  I'd try turning everything off in the /ffp/start first.  Command chmod a-x filename.sh   Of course, you need to leave telnetd (or sshd) running, and the checkbutton2.  If your problem goes away, start re-enabling things, one at a time (chmod a+x filename.sh), perhaps finding the conflict.  If the problem doesn't go away trying this, at least you know it's nothing you are starting here (or the order of starting) that is causing the problem, and you can look elsewhere. 

Being very new to Linux, I am reluctant to post this, but perhaps it may be helpful.

Good Luck!

Jerry

Last edited by Sharp Rock (2009-06-28 19:58:30)

Offline

 

#36 2009-06-28 22:56:44

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

Sharp Rock, thanks very much for your suggestions. I'm trying many of them and will report back soon.

Jcard, just wondering if I overlooked the obvious: do I need to compile chkbutton2 to run on my DNS323? I don't think I did, just ran 'funpkg -i cleanboot2-0.2.tar.gz'.

The reason I ask is because I saw in the .c file you kept in the 'share' folder that one *must* compile, but no one has mentioned that in the posts above...

EDIT:

rcblackwell wrote:

I'm not seeing this behaviour. I'm running 1.07 FW.

Bob Blackwell

Bob, are you by any chance running chkbutton2 on a DNS-323 Rev B? I should mention I'm running on Rev A; is this a problem as well? I believe the CPU's slightly different between the two: http://www.cyrius.com/debian/orion/d-link/dns-323/specs.html

Last edited by krimb1 (2009-06-28 23:07:34)

Offline

 

#37 2009-06-28 23:30:16

jcard
Member
From: Portugal
Registered: 2008-09-21
Posts: 289

Re: chkbutton2, a replacement for chkbutton and cleanboot

Jcard, just wondering if I overlooked the obvious: do I need to compile chkbutton2 to run on my DNS323? I don't think I did, just ran 'funpkg -i cleanboot2-0.2.tar.gz'.

No, you don't need to recompile it.
The warning is there just in case someone wants to modify it.

Bob, are you by any chance running chkbutton2 on a DNS-323 Rev B? I should mention I'm running on Rev A; is this a problem as well?

Yes, that must be the problem.


Please consider discussing Alt-F at http://groups.google.com/group/alt-f/topics
Please consider filling Alt-F bugs at http://code.google.com/p/alt-f/issues/list

Offline

 

#38 2009-06-29 00:27:22

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: chkbutton2, a replacement for chkbutton and cleanboot

krimb1 wrote:

Bob, are you by any chance running chkbutton2 on a DNS-323 Rev B?

The unit I have here is F/W version A1 flashed with 1.07 < ---- I Just double checked the FW version. MADE A MISTAKE roll. That should have been revision 1.06 not 1.07.

PS Shows

Code:

PID   USER     COMMAND
    1 root     init
    2 root     [ksoftirqd/0]
    3 root     [events/0]
    4 root     [khelper]
    5 root     [kthread]
   11 root     [kblockd/0]
   14 root     [khubd]
   50 root     [pdflush]
   52 root     [aio/0]
   51 root     [kswapd0]
  190 root     [scsi_eh_0]
  191 root     [scsi_eh_1]
  192 root     [scsi_eh_2]
  193 root     [scsi_eh_3]
  204 root     [mtdblockd]
  218 root     [kcryptd/0]
  219 root     [kmirrord/0]
  238 root     [loop0]
 1233 root     atd
 1629 root     /web/webs
 1635 root     fancontrol
 1653 root     crond
 1680 root     op_server 3 3 3
 1687 root     -sh
 1719 root     pure-ftpd (SERVER)
 1805 root     [scsi_eh_4]
 1806 root     [usb-storage]
 1943 root     /sbin/chkbutton2
 1969 root     /ffp/sbin/sshd
 2009 root     /ffp/bin/rsync --daemon --config=/ffp/etc/rsyncd.conf
 2017 root     /ffp/bin/usbhid-ups -a APC_UPS
 2019 root     /ffp/sbin/upsd
 2021 root     /ffp/sbin/upsmon -u monuser
 2022 nutmon   /ffp/sbin/upsmon -u monuser
 2033 root     /ffp/sbin/mt-daapd
 2034 root     /ffp/sbin/mt-daapd
 2040 root     /ffp/sbin/mt-daapd
 2049 lighttpd /ffp/sbin/lighttpd -f /ffp/etc/lighttpd.conf
 2052 root     /ffp/sbin/mt-daapd
16850 root     /ffp/sbin/inetd /ffp/etc/inetd.conf
21850 root     /ffp/sbin/smbd -D
21859 root     /ffp/sbin/smbd -D
21861 root     /ffp/sbin/nmbd -D
21862 root     /ffp/sbin/nmbd -D
21864 root     lpd Waiting
23734 root     /ffp/sbin/smbd -D
25328 root     /ffp/bin/svnserve -d -r /mnt/HD_a2/svn/
13221 root     [pdflush]
13566 root     sshd: root@pts/0
13569 root     -sh
13571 root     ps

Sys Log isn't running at the moment however when it was I don't believe any errors were reported. I can turn Logging on and let it run for a few days if you want?

Last edited by rcblackwell (2009-06-29 00:38:41)


Bob Blackwell
Pickering, ON

Offline

 

#39 2009-06-29 02:05:21

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

SharpRock: I think you were right on with suggesting ffp be disabled for reformatting. My box is now fully reformatted in RAID1 (and JBOD) in EXT3 using the 1.08 beta FW.

jcard: Don't think I can mail my DNS-323 Rev A1 to you so that you can troubleshoot, can I? wink

Blackwell: Haha, no problem! If you wouldn't mind running syslogd for me that would be a real saver. I'll try the 1.06 firmware and see if I can't get this baby to sleep in the meantime. smile

EDIT: Just for the record—in 1.08 beta FW on the DNS-323 A1, I cannot get chkbutton2 to sleep the HDs if chkbutton2.sh is executable at start. However if I manually telnet inside and start the script, everything works fine. I don't suppose there's anyway I could "simulate a ssh/telnet login" to login for me; run the script; and exit can I?

Last edited by krimb1 (2009-06-29 02:08:42)

Offline

 

#40 2009-06-29 03:04:32

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: chkbutton2, a replacement for chkbutton and cleanboot

krimb1 wrote:

Blackwell: Haha, no problem! If you wouldn't mind running syslogd for me that would be a real saver.

Logs have been enabled. I'll post the output in the next day or so.


Bob Blackwell
Pickering, ON

Offline

 

#41 2009-06-29 03:51:51

Sharp Rock
Member
Registered: 2009-05-13
Posts: 14

Re: chkbutton2, a replacement for chkbutton and cleanboot

krimb1 wrote:

EDIT: Just for the record—in 1.08 beta FW on the DNS-323 A1, I cannot get chkbutton2 to sleep the HDs if chkbutton2.sh is executable at start. However if I manually telnet inside and start the script, everything works fine. I don't suppose there's anyway I could "simulate a ssh/telnet login" to login for me; run the script; and exit can I?

krimb1, and the group,

Hmmm, I wonder...  If Bob is running checkbutton2 with no issues on hardware A1 +  FW 1.06, why wouldn't it work with a later FW?  The kernals are the same with 1.08beta.  And someone correct me if I'm wrong, the applications in the /ffp/start are the last things to be run.  When they finish, the booting is complete.  So if krimb1 can telnet into the box right after boot and start it manually with no issues, what could be hooking the application, keeping the drives active?  I just took a quick look at checkbutton2.sh.  So a file gets copied to the ramdisk (/sbin), and a couple of symlinks are done.  Then execute.

Thinking out loud.  I'm new, so kick me in the head if I get out of line.  smile

Is there a boot proccess running in the background on his machine that hasn't finished up when checkbutton2 runs?  I suggest a quick test.  Open up checkbutton2.sh with your favorite linux text editor and add a "sleep 30" to the begining of the script, right under the PROVIDES and BEFORE entries.  Maybe even a sleep 60.  This is an extreme test to see if something in the box has not settled before running checkbutton2.  Reboot with checkbutton2 executable.

Something else to check...  I just looked at my own box.  I can see the checkbutton2 file on the ramdisk in /sbin.  And I can see the symlinks.  krimb1, you might want to see if your script is really executing these commands correctly (when booting with checkbutton2), or is something preventing them from doing so.

Good Luck!

Jerry

EDIT: I just reread the original thread, and found where jcard gave instructions to modify the script to delay start by 10 minutes.  Please disreguard my rambling.

Last edited by Sharp Rock (2009-06-29 04:10:26)

Offline

 

#42 2009-06-29 09:07:47

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

So it is confirmed now. FW 1.08b officially breaks chkbutton2 from loading properly at boot time. The drives sleep great under 1.06 and 1.07.

No need to apologize Jerry; thanks very much for your suggestions. It turns out even in 1.08, the symlinks are all correctly set in /sbin. Have to try something else...

Offline

 

#43 2009-06-29 09:16:37

krimb1
Member
Registered: 2008-01-05
Posts: 65

Re: chkbutton2, a replacement for chkbutton and cleanboot

WHOAH! Breakthrough!

Alright, so it's a bit of a hack. But isn't that what fun_plug is? smile

I still don't know what the heck is causing chkbutton2 not to work properly at boot on 1.08 beta. I've tried all sorts of things: adding the call to chkbutton2 at the end of fun_plug (despite fonz's wishes wink); adding a line to /ffp/etc/rc; the works. No matter what I do—no matter when I call the script—it will always fail if it is executed during fun_plug.

Remember that funny "simulate an ssh login" idea? Well I pretty much achieved it with a crontab entry.

Essentially at the boot, the crontab is edited so that chkbutton2 is started "every 1 minute". Within 60 seconds chkbutton2 is launched and visible in 'ps'.

However it would be disastrous if the cron job were left in there—chkbutton2 would just keep being called! So with a little sed magic, as soon as chkbutton2 is called, the job in crontab is deleted.

You might ask why I didn't use the '@reboot' call in crontab. In fact that's what I tried at first, but for some reason or another it wouldn't work. I kind of like the "distance" chkbutton2 gains from the boot sequence the other way anyhow.

Best part is it worked! I'll make a tgz package out of it in a day or two and post it up as a DNS-323 A1 1.08 firmware workaround.


YAAAYYYY!!!!!!!!! big_smile big_smile big_smile

Last edited by krimb1 (2009-06-29 09:17:19)

Offline

 

#44 2009-06-30 02:43:47

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: chkbutton2, a replacement for chkbutton and cleanboot

krimb1 wrote:

WHOAH! Breakthrough!

Glad to see you've had a break-through !!

As promised, here is a clip from my log;

Code:

Jun 29 05:25:20 DNS323_NAS user.warn kernel: 
Jun 29 05:25:20 DNS323_NAS user.warn kernel: ***************************************
Jun 29 05:25:20 DNS323_NAS user.warn kernel: *            HD1 stand by now!        *
Jun 29 05:25:20 DNS323_NAS user.warn kernel: ***************************************
Jun 29 05:30:01 DNS323_NAS cron.notice crond[1653]: USER root pid 15748 cmd /ffp/bin/rsync -avu --delete /mnt/HD_a2/www /mnt/USB
Jun 29 05:30:19 DNS323_NAS user.warn kernel: 
Jun 29 05:30:19 DNS323_NAS user.warn kernel: ***************************************
Jun 29 05:30:19 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 05:30:19 DNS323_NAS user.warn kernel: ***************************************
Jun 29 05:31:04 DNS323_NAS user.warn kernel: 
Jun 29 05:31:04 DNS323_NAS user.warn kernel: #######################################
Jun 29 05:31:04 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 05:31:04 DNS323_NAS user.warn kernel: #######################################
Jun 29 05:40:01 DNS323_NAS cron.notice crond[1653]: USER root pid 15781 cmd /ffp/bin/rsync -avu --delete /mnt/USB/ffp /mnt/HD_a2
Jun 29 05:41:14 DNS323_NAS user.warn kernel: 
Jun 29 05:41:14 DNS323_NAS user.warn kernel: #######################################
Jun 29 05:41:14 DNS323_NAS user.warn kernel: #              HD1 awake now !        #
Jun 29 05:41:14 DNS323_NAS user.warn kernel: #######################################
Jun 29 05:45:01 DNS323_NAS cron.notice crond[1653]: USER root pid 15799 cmd /ffp/bin/perl /mnt/USB/www/awstats-6.9/wwwroot/cgi-bin/awstats.pl -update -config=afticarr.com
Jun 29 05:50:01 DNS323_NAS cron.notice crond[1653]: USER root pid 15816 cmd /ffp/bin/rsync -avu --delete /mnt/HD_a2/ffp /mnt/USB
Jun 29 05:50:15 DNS323_NAS user.warn kernel: 
Jun 29 05:50:15 DNS323_NAS user.warn kernel: ***************************************
Jun 29 05:50:15 DNS323_NAS user.warn kernel: *            HD1 stand by now!        *
Jun 29 05:50:15 DNS323_NAS user.warn kernel: ***************************************
Jun 29 06:00:01 DNS323_NAS cron.notice crond[1653]: USER root pid 15849 cmd /ffp/My_Scripts/snapshot.sh
Jun 29 06:00:01 DNS323_NAS user.warn kernel: 
Jun 29 06:00:01 DNS323_NAS user.warn kernel: #######################################
Jun 29 06:00:01 DNS323_NAS user.warn kernel: #              HD1 awake now !        #
Jun 29 06:00:01 DNS323_NAS user.warn kernel: #######################################
Jun 29 06:59:59 DNS323_NAS user.warn kernel: 
Jun 29 06:59:59 DNS323_NAS user.warn kernel: ***************************************
Jun 29 06:59:59 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 06:59:59 DNS323_NAS user.warn kernel: ***************************************
Jun 29 06:59:59 DNS323_NAS user.warn kernel: 
Jun 29 06:59:59 DNS323_NAS user.warn kernel: ***************************************
Jun 29 06:59:59 DNS323_NAS user.warn kernel: *            HD1 stand by now!        *
Jun 29 06:59:59 DNS323_NAS user.warn kernel: ***************************************
Jun 29 06:59:59 DNS323_NAS user.warn kernel: 
Jun 29 06:59:59 DNS323_NAS user.warn kernel: #######################################
Jun 29 06:59:59 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 06:59:59 DNS323_NAS user.warn kernel: #######################################
Jun 29 07:08:59 DNS323_NAS auth.info sshd[16060]: Accepted password for root from xxx.xxx.xxx.xxx port xxxxx ssh2
Jun 29 07:08:59 DNS323_NAS auth.info sshd[16060]: subsystem request for sftp
Jun 29 07:14:56 DNS323_NAS user.warn kernel: 
Jun 29 07:14:56 DNS323_NAS user.warn kernel: ***************************************
Jun 29 07:14:56 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 07:14:56 DNS323_NAS user.warn kernel: ***************************************
Jun 29 07:17:43 DNS323_NAS auth.info sshd[16089]: Accepted password for root from xxx.xxx.xxx.xxx port xxxxx ssh2
Jun 29 07:17:53 DNS323_NAS user.warn kernel: 
Jun 29 07:17:53 DNS323_NAS user.warn kernel: #######################################
Jun 29 07:17:53 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 07:17:53 DNS323_NAS user.warn kernel: #######################################
Jun 29 07:25:01 DNS323_NAS auth.info sshd[16139]: Accepted password for root from xxx.xxx.xxx.xxx port xxxxx ssh2
Jun 29 07:25:01 DNS323_NAS auth.info sshd[16139]: subsystem request for sftp
Jun 29 08:00:07 DNS323_NAS user.warn kernel: 
Jun 29 08:00:07 DNS323_NAS user.warn kernel: #######################################
Jun 29 08:00:07 DNS323_NAS user.warn kernel: #              HD1 awake now !        #
Jun 29 08:00:07 DNS323_NAS user.warn kernel: #######################################
Jun 29 08:09:43 DNS323_NAS user.warn kernel: 
Jun 29 08:09:43 DNS323_NAS user.warn kernel: ***************************************
Jun 29 08:09:43 DNS323_NAS user.warn kernel: *            HD1 stand by now!        *
Jun 29 08:09:43 DNS323_NAS user.warn kernel: ***************************************
Jun 29 08:14:42 DNS323_NAS user.warn kernel: 
Jun 29 08:14:42 DNS323_NAS user.warn kernel: ***************************************
Jun 29 08:14:42 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 08:14:42 DNS323_NAS user.warn kernel: ***************************************
Jun 29 08:15:52 DNS323_NAS user.warn kernel: 
Jun 29 08:15:52 DNS323_NAS user.warn kernel: #######################################
Jun 29 08:15:52 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 08:15:52 DNS323_NAS user.warn kernel: #######################################
Jun 29 08:44:35 DNS323_NAS user.warn kernel: 
Jun 29 08:44:35 DNS323_NAS user.warn kernel: ***************************************
Jun 29 08:44:35 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 08:44:35 DNS323_NAS user.warn kernel: ***************************************
Jun 29 09:07:47 DNS323_NAS user.warn kernel: 
Jun 29 09:07:47 DNS323_NAS user.warn kernel: #######################################
Jun 29 09:07:47 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 09:07:47 DNS323_NAS user.warn kernel: #######################################
Jun 29 09:14:28 DNS323_NAS user.warn kernel: 
Jun 29 09:14:28 DNS323_NAS user.warn kernel: ***************************************
Jun 29 09:14:28 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 09:14:28 DNS323_NAS user.warn kernel: ***************************************
Jun 29 12:05:01 DNS323_NAS cron.notice crond[1653]: USER root pid 17059 cmd /ffp/bin/ntpdate time.nrc.ca time.chu.nrc.ca tick.utoronto.ca tock.utoronto.ca>>/ffp/log/ntpdate.log 2>&1
Jun 29 12:05:01 DNS323_NAS user.warn kernel: 
Jun 29 12:05:01 DNS323_NAS user.warn kernel: #######################################
Jun 29 12:05:01 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 12:05:01 DNS323_NAS user.warn kernel: #######################################
Jun 29 12:13:45 DNS323_NAS user.warn kernel: 
Jun 29 12:13:45 DNS323_NAS user.warn kernel: ***************************************
Jun 29 12:13:45 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 12:13:45 DNS323_NAS user.warn kernel: ***************************************
Jun 29 19:20:48 DNS323_NAS user.warn kernel: 
Jun 29 19:20:48 DNS323_NAS user.warn kernel: #######################################
Jun 29 19:20:48 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 19:20:48 DNS323_NAS user.warn kernel: #######################################
Jun 29 19:27:00 DNS323_NAS user.warn kernel: 
Jun 29 19:27:00 DNS323_NAS user.warn kernel: ***************************************
Jun 29 19:27:00 DNS323_NAS user.warn kernel: *            HD0 stand by now!        *
Jun 29 19:27:00 DNS323_NAS user.warn kernel: ***************************************
Jun 29 19:34:40 DNS323_NAS user.warn kernel: 
Jun 29 19:34:40 DNS323_NAS user.warn kernel: #######################################
Jun 29 19:34:40 DNS323_NAS user.warn kernel: #              HD0 awake now !        #
Jun 29 19:34:40 DNS323_NAS user.warn kernel: #######################################
Jun 29 19:34:52 DNS323_NAS auth.info sshd[18362]: Accepted password for root from xxx.xxx.xxx.xxx port xxxxx ssh2
Jun 29 19:34:52 DNS323_NAS auth.info sshd[18362]: subsystem request for sftp

I didn't include much of the log as no related issues were recorded. The above demonstrates that the drives are going to sleep then waking up when called upon.


Bob Blackwell
Pickering, ON

Offline

 

#45 2009-07-05 00:03:21

Sharp Rock
Member
Registered: 2009-05-13
Posts: 14

Re: chkbutton2, a replacement for chkbutton and cleanboot

chkbutton2, Chapter 2...

A few days ago, I made a seemingly minor change using the Web GUI.  The same evening, just before bed, I checked my /ffp/var/log/messages.  RATS!!!  I now had the same issues as kimb1.  All I changed was to sleep the drives after 30 minutes, instead of the 10 minutes I had been using.  Thinking this had to be something in FLASH that had gotten mucked up, I started flashing older FW, trying to over write what ever had not updated properly.  I ended up going to far back, and have bricked this box.  Since I do have 2 DNS-323 boxes, I moved the Raid 1 drives over to the other box, changed the USB stick too.  Brought it up, and changed all the needed configurations to reflect it's different name and IP.  All good EXCEPT the crond messages persisted.  They issue came along with the drives.  Swaped things back, and confirmed.  Problem is on the drives and not in flash memory.  I bricked a box for nothing (and feel pretty stupid).  I have a post in the firmware group asking for assistance.

To simplify the above:

Toaster working with no issues, FW 1.08beta, hardware B1, Raid 1 drives.  Running apps; chkbutton2, kickwebs (disabled this to make the change), samba 3.3.2, sshd, fanctl, booting ffp off a USB stick.

Made a change to sleep times for the drives using Web GUI.  Saved.  Now have the same crond message every 10 minutes, but my drives would still power down.  Perplexing!!!  And it's not in flash memory.  Perhaps a system file in the hidden directory on HD_a4/.systemfile

If I can get my first box back up (hoping) I will research this throughly!

Jerry

Offline

 

#46 2010-04-06 09:37:08

sorna
Member
Registered: 2010-03-02
Posts: 9

Re: chkbutton2, a replacement for chkbutton and cleanboot

Hi,

I've installed this and there was no errors or anything. I could reboot/shut down the unit using the method mentioned. However I still get the following message

EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended

I've already run fsck and verified that the disks are fixed. But the errors were generated with the consecutive shut downs. I am having FW 1.08 (beta) in DNS-323.

Any help is appreciated. Thanks.

Offline

 

#47 2010-04-06 15:01:51

rintje
Member
Registered: 2010-02-08
Posts: 14

Re: chkbutton2, a replacement for chkbutton and cleanboot

sorna wrote:

Hi,

I've installed this and there was no errors or anything. I could reboot/shut down the unit using the method mentioned. However I still get the following message

EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended

I've already run fsck and verified that the disks are fixed. But the errors were generated with the consecutive shut downs. I am having FW 1.08 (beta) in DNS-323.

Any help is appreciated. Thanks.

I had this problem as well. The solution for me was to change the mount point of my USB stick from /mnt/HD_a2/ffp to /mnt/USB. This removes the dependency between the mountpoints of USB and HD.

The mountpoint is configured in one of the funplug files, either 'fun_plug' or '.bootstrap/setup.sh'.


Conceptronic CH3SNAS | Firmware v1.05b1 | Funplug 0.5 on USB
Mods: Cleanboot, Chkbutton2, NZBGet, Squeezebox Server

Offline

 

#48 2010-04-06 17:00:45

sorna
Member
Registered: 2010-03-02
Posts: 9

Re: chkbutton2, a replacement for chkbutton and cleanboot

rintje wrote:

I had this problem as well. The solution for me was to change the mount point of my USB stick from /mnt/HD_a2/ffp to /mnt/USB. This removes the dependency between the mountpoints of USB and HD.

The mountpoint is configured in one of the funplug files, either 'fun_plug' or '.bootstrap/setup.sh'.

Thanks Rintje.

I have the following lines in fun_plug
# setup script (used for ffp on USB disk)
FFP_SETUP_SCRIPT=/mnt/HD_a2/.bootstrap/setup.sh
but there is no .bootstrap directory. (Tried through telnet with ls -a as well). I am not sure what I am missing. BTW I dont use any USB drives.

Offline

 

#49 2010-04-06 21:05:15

rintje
Member
Registered: 2010-02-08
Posts: 14

Re: chkbutton2, a replacement for chkbutton and cleanboot

sorna wrote:

Thanks Rintje.

I have the following lines in fun_plug
# setup script (used for ffp on USB disk)
FFP_SETUP_SCRIPT=/mnt/HD_a2/.bootstrap/setup.sh
but there is no .bootstrap directory. (Tried through telnet with ls -a as well). I am not sure what I am missing. BTW I dont use any USB drives.

Oops, in that case this solution does not apply here. (It only makes sense in an USB setup.)

But it seems that chkbutton2 is not able to kill some process keeping files open on your harddrive. This makes the umount command fail.
Try the 'lsof' funplug package to see what files are open on your harddrive(s) before you shutdown.

To shutdown my processes more gently than just 'kill' them, i moved part of the cleanboot script into the /ffp/share/chkbutton2/cleanup.sh script. 
See the attachment for my cleanup file. Maybe this does some more thorough process cleanup than the default config as well, solving your problem.
Make sure you review the script before using it, it might contain some system-specific things like addressing only one harddrive and/or the USB stick. Hope this helps.

Edit
-----
- Fixed cleanup script path in first post
- On thing i forgot: chkbutton2 grants the cleanup.sh no more than 5 seconds to run. As my cleanup.sh script requires a little more, i increased the timeout from 5 to 25 seconds and then recompiled chkbutton2.

Last edited by rintje (2010-04-07 10:49:40)


Attachments:
Attachment Icon cleanup.sh, Size: 5,083 bytes, Downloads: 416

Conceptronic CH3SNAS | Firmware v1.05b1 | Funplug 0.5 on USB
Mods: Cleanboot, Chkbutton2, NZBGet, Squeezebox Server

Offline

 

#50 2010-04-07 17:39:58

sorna
Member
Registered: 2010-03-02
Posts: 9

Re: chkbutton2, a replacement for chkbutton and cleanboot

rintje wrote:

- Fixed cleanup script path in first post
- On thing i forgot: chkbutton2 grants the cleanup.sh no more than 5 seconds to run. As my cleanup.sh script requires a little more, i increased the timeout from 5 to 25 seconds and then recompiled chkbutton2.

Hi Rintje,

Thanks for all the information. Wonder if you can attach the version compiled for 25 sec time out. Seems I need a linux environment, if I want to compile myself.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB