STILL NOT SLEEPING! - and I GIVE UP!


#61

Do you have any mapped drives on your desktop?


#62

No. No mapped drives on my PC’s at the moment.


#63

Then you should try checking the smbpasswd file while the My Cloud is mapped to the desktop.


#64

The “Change” value updated to when a Share was mapped. No change after that in the last six minutes.

  File: `/etc/samba/smbpasswd'
  Size: 104       	Blocks: 8          IO Block: 4096   regular file
Device: 901h/2305d	Inode: 8519        Links: 1
Access: (0600/-rw-------)  Uid: (   33/www-data)   Gid: (   33/www-data)
Access: 2017-12-14 15:30:26.000000000 -0500
Modify: 2017-12-13 23:21:43.000000000 -0500
Change: 2017-12-14 21:49:59.000000000 -0500
 Birth: -

#65

Give it a few more minutes. Thanks


#66

I think rac8006 was wrong, and Bennor is right.

try command sleep --h

“sleep 1200” means sleep after 1200 sec(20 min) not for 2 hour.

in /etc/standby.conf, 5 min to check idle,

after 5 min idle, there will be command to sleep after 20min

so 20 sec wakeup is gone.

my logs don’t tell a lie

before

2017-12-13 15:12 22 sec
2017-12-13 16:27 22 sec
2017-12-13 17:00 728 sec
2017-12-13 17:59 2306 sec
2017-12-13 18:19 22 sec
2017-12-13 18:44 263 sec
2017-12-13 20:17 22 sec
2017-12-13 20:42 109 sec
2017-12-13 21:10 23 sec
2017-12-13 21:37 369 sec
2017-12-14 00:12 23 sec
2017-12-14 01:23 22 sec
2017-12-14 02:48 3833 sec
2017-12-14 03:26 22 sec
2017-12-14 04:33 2798 sec
2017-12-14 08:01 11260 sec
2017-12-14 08:25 250 sec
2017-12-14 08:54 483 sec
2017-12-14 09:16 22 sec

after

2017-12-14 15:27 1207 sec
2017-12-14 16:01 1701 sec
2017-12-14 16:54 2926 sec
2017-12-14 17:27 1208 sec
2017-12-14 18:00 1661 sec
2017-12-14 18:27 1208 sec
2017-12-14 19:00 1673 sec
2017-12-14 21:36 1207 sec
2017-12-14 23:03 4901 sec
2017-12-15 00:00 3111 sec
2017-12-15 00:30 1494 sec
2017-12-15 00:57 1207 sec
2017-12-15 02:48 6033 sec
2017-12-15 03:13 1207 sec
2017-12-15 08:01 16839 sec
2017-12-15 08:38 1967 sec
2017-12-15 09:07 1411 sec
2017-12-15 09:41 1714 sec


#67

Your log does not tell a lie. The problem is that the time that the disk entered sleep is taken before the sleep 1200. After the sleep the disk is put to sleep. Monitorio loops back to check for the disk to wake up.
When it sees that the disk woke up it subtracts the current time from the enter standbytime which was taken
1200 seconds before the disk was put to sleep.


#68

Apparently my system updates the file every 30 seconds or so. not sure why my system does this and yours does not.


#69

I’m currently using the sync, sleep addition to monitorio.sh discussed in this post:
https://community.wd.com/t/wd-my-cloud-randomly-wakes-up-the-drive-when-drive-sleep-is-enabled/152748/22

   ior_datavol=$ior_datavol2
    iow_datavol=$iow_datavol2
    iow_root=$iow_root2
    
    smartTestStatus=`getSmartTestStatus.sh | awk '{print $1}'`
    if [ "$standby_enable" == "enabled" ] && [ "$sleepcount" -eq "$standby_time" ] && [ "$smartTestStatus" != "inprogress" ]; then
        touch /tmp/standby

	#Added code try to fix 10 second wake up (12/14/17)
	sync
	sleep 5

        enterStandbyTime=`date +%s`
        echo "Enter standby"
        if [ "$1" == "debug" ]; then
                echo "`date`: Enter standby "
                dmesg -c > /dev/null
        fi

	#Added code try to fix 10 second wake up (12/14/17)
	sync
	sleep 5
	sync
	sleep 5
	sync
	sleep 5

        for i in ${drivelist[@]}; do
                hdparm -y $i >/dev/null
        done

        # turn on solid blue if applicable
        ledCtrl.sh LED_EV_DISK_STBY LED_STAT_IN_PROG
        sleep 5
        break
    fi
done

I think all it has done is turn the 7 seconds to 20 seconds.

12 14 17:59:27 17:59:57    25  0:00:25
12 14 18:10:09 18:15:34   320  0:05:20
12 14 18:47:12 18:47:43    26  0:00:26
12 14 18:57:55 18:58:25    25  0:00:25
12 14 19:08:37 19:09:07    25  0:00:25
12 14 19:19:20 19:19:50    25  0:00:25
12 14 19:30:03 19:30:42    34  0:00:34
12 14 19:56:15 19:56:46    25  0:00:25
12 14 20:25:48 20:26:22    25  0:00:25
12 14 20:36:34 20:45:09   510  0:08:30
12 14 21:12:41 21:13:12    26  0:00:26
12 14 22:05:16 22:05:46    25  0:00:25

#70

Still no change at 10:10pm.

  File: `/etc/samba/smbpasswd'
  Size: 104       	Blocks: 8          IO Block: 4096   regular file
Device: 901h/2305d	Inode: 8519        Links: 1
Access: (0600/-rw-------)  Uid: (   33/www-data)   Gid: (   33/www-data)
Access: 2017-12-14 15:30:26.000000000 -0500
Modify: 2017-12-13 23:21:43.000000000 -0500
Change: 2017-12-14 21:49:59.000000000 -0500
 Birth: -

Right now I have my first gen at stock v04.05.00-320 firmware no additional modules/apps added. Only the monitorio.sh and s98user-start files modified. I have remote access disabled via Dashboard. Only one user, the admin (renamed) user. Drive sleep enabled. Reserved IP address in router with DHCP time out in router set to 7 days as a test. Both DLNA and iTunes server are disabled in Dashboard.


#71

Hopefully that will give you reasonable sleep times. But it will not fix the 7 sec wakeup.


#72

What does the checkgen1.sh script show? I suspect the msg.sock. You could try the stat on the msg.sock file. See if it is changing.

PS also try stopping samba for a while.


#73

Rac8006, you are right, I was wrong

in /var/log/user.log there is time for sleeing,
it is time from command to sleep and to wake up, not for real sleeping time,

in my log

|2017-12-14|15:27|1207|sec|

at 15:27:07 it wakes up after 15:07:00 for 1207 sec.

but 15:07:00 is time to command to sleep after 1200sec

and start sleep-time is 15:27:00(15:07:00 + 1200sec)

and end sleep-time is 15:27:07 ,

so sleeping time is 7 sec (1207 - 1200)

my log time …

1207 sec,
1701 sec,
2926 sec,

is not real sleeping time,

real sleeping time is

7 sec (1207 - 1200)
501 sec (1701 - 1200)
1726 sec ( 2926 - 1200)

so… Bennor’s works don’t work…


#74

Will try stopping Samba tomorrow when I have some time to do more testing.

The msg.sock file hasn’t changed in a few minutes (current time 10:28pm).

stat /etc/samba/msg.sock/
  File: `/etc/samba/msg.sock/'
  Size: 140       	Blocks: 0          IO Block: 65536  directory
Device: 16h/22d	Inode: 9458        Links: 2
Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-12-14 22:15:43.234039002 -0500
Modify: 2017-12-14 22:15:43.244039002 -0500
Change: 2017-12-14 22:15:43.244039002 -0500
 Birth: -

Edit: msg.sock updated at 10:30pm

  File: `/etc/samba/msg.sock/'
  Size: 140       	Blocks: 0          IO Block: 65536  directory
Device: 16h/22d	Inode: 9458        Links: 2
Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-12-14 22:30:43.344039002 -0500
Modify: 2017-12-14 22:30:43.354039002 -0500
Change: 2017-12-14 22:30:43.354039002 -0500
 Birth: -

FileCheckGen1.sh results:

Thu Dec 14 22:19:59 EST 2017
22-19-59  sda4 10188962 1909352  md1 2085690 22056
22-20-03   md1 3368    0
22-20-07  sda4    8   48  md1 4040    0
22-20-11   md1    8    0
22-20-20  sda4    8    0  md1 4016    0
22-20-24  sda4  168    0  md1  384    0
22-20-36  sda4    0   32  md1 5624    0
22-20-40  sda4   16    0  md1 7144    0
22-20-44   md1    8    0
22-20-52  sda4  304    0  md1  392    0
22-20-56  sda4    8    0
22-21-00  sda4    0   80
22-21-08  sda4    8  120  md1 5472    0
22-21-12  sda4 1304   48  md1   56    0
22-21-16  sda4   16    0
22-21-20   md1  136    0
22-21-41  sda4    8   32  md1 8664    0
22-21-53  sda4   16    0
22-21-57  sda4   16    0
22-22-01  sda4    0   80
22-22-09   md1 2800    0
22-22-13   md1 1336    0
22-22-21  sda4    8    0
22-22-25  sda4    0   88
22-22-29  sda4    0   48
22-22-33  sda4    0   64
22-22-41   md1  240    0
22-22-57  sda4    8    0
22-23-01  sda4    0   80
22-23-14  sda4  120    0
22-23-22  sda4  432    0  md1 1960    0
22-23-26  sda4    0   88
22-23-30  sda4    0   48
22-23-34  sda4    0   64
22-23-38   md1  384    0
22-23-42   md1  776    0
22-23-58  sda4  368    0
22-24-02  sda4    0   80
22-24-14  sda4   32    0
22-24-26  sda4    0   88
22-24-30  sda4    0   48
22-24-35  sda4    0   64
22-24-51   md1  920    0
22-24-59   md1  528    0
22-25-03  sda4    0   80  md1  360    0
22-25-15  sda4    0  120  md1  296    0
22-25-19  sda4    0   48  md1 4088    0
22-25-35   md1 5624    0
22-25-51  sda4    0   32
22-26-03  sda4    0   80
22-26-16  sda4    0    8  md1  240    0
22-26-20   md1  144    0
22-26-28  sda4    0   88
22-26-36  sda4    0   48
22-26-40  sda4    0   56
22-26-44   md1  272    0
22-27-04  sda4    0   80
22-27-16  sda4    0  120  md1   72    0
22-27-20   md1   80    0
22-27-24  sda4    0   48
22-27-53  sda4    0   32
22-28-05  sda4    0   80
22-28-29  sda4    0   88
22-28-37  sda4    0   48
22-28-41  sda4    0   64

#75

If this is a gen1 why is the data disk being accessed so often. Secondly why is it not showing files accessed?


#76

Don’t know why it is being accessed so often. Just realized I ran the older checkgen1 script, running the newer version now which is displaying more information. Quick snippet. I did turn Twonky/media serving back on but haven’t accessed anything through the media server yet.

checkgen1.sh
22-36-38  sda1 1117346 29800 sda2 1070946 29800 sda3 1997184 1571968 sda4 10247690 2387752 sda5 1408    0 sda6 1408    0 sda7  384    0
/dev/xconsole
/tmp/external_share_size
/tmp/share_size
/tmp/minutes_since_disk_access
/tmp/atopacct/pacct_source
/var/log/sshd.log
/var/log/atop/atop_current
/proc
/sys
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31
22-37-24  sda1 84200    0 sda2 -924326 -1542168 sda3 -8250506 -808488 sda4 10321754 2387944 sda6 1024    0 sda7  384    0
/dev/xconsole
/tmp/external_share_size
/tmp/share_size
/tmp/minutes_since_disk_access
/tmp/atopacct/pacct_source
/var/log/sshd.log
/var/log/atop/atop_current
/proc
/sys
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31
22-38-07  sda1 91744   16 sda2 -879006 -1549448 sda3 -8325978 -808296 sda4 10395834 2388144 sda6 1024    0 sda7  384    0
/tmp/external_share_size
/tmp/share_size
/tmp/minutes_since_disk_access
/tmp/atopacct/pacct_source
/var/log/atop/atop_current
/proc
/sys
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31
22-38-49  sda1 64584   16 sda2 -850070 -1549816 sda3 -8399034 -805040 sda4 10471122 2388432 sda6 1024    0 sda7  384    0

#77

It shows that twonky is accessing the following files.
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/DataVolume/cache/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/pdbindex
/CacheVolume/twonkymedia/pdb/pdb_20E564CFDD50/clientinfo.31


#78

Yes it shows some Twonky access, that may be because I had just turned Twonky (media serving) back on through the Dashboard at the time. Will do some more experimenting later to see what gets accessed with Twonky on and with it off, same with Samba on and off.


#79

Might be worthwhile to put some tmpfs backed mounts at various “troublesome” locations, initially seeded from the HDD, and with suitable backup copy operations in the shutdown script.

I do that trick on my linux-ized chromebook to reduce wear on the eMMC and microSD cards I am forced to use for permanent storage. (Browser cache, log files, and pals all quickly overwhelm these low-tier flash storage solutions’ write lives, so I use tmpfs backed storage in /etc/fstab at such locations to avoid the issue.) The end goal is the same here— Avoid disk activity on a drive we would prefer to not be accessed except when it is really necessary— but for different reasons.

Might be something worth exploring for files that the system daemons INSIST on constantly checking. (Let them check the damn files-- they access tmpfs backed storage instead of waking the drive.)


#80

More experimentation. Went overkill and tried all the changes described here:
http://levo.pro/2017/05/13/barebone-my-cloud-gen1-fix-sleepstandby-problems-and-more/

My Cloud slept for 2 hours and 41 minutes before I woke it up to check on the sleep time. No more constant short sleep cycles.

Of course the down side is no DLNA and I have to use IP address to access My Cloud. :laughing: