Firmware Release 04.05.00-320 (11/28/2017) Discussion

Updated and I still don’t think the My Cloud is going to sleep. I’ve just rebooted it again after the update to see if helps, but I’ve come to terms with just being able to control the USB drive spin down and not the internal drive’s.

All working fine as before, no issues seen.

If you search this forum you will find several items dealing with the sleep issue. Probably the main issue with sleep is the fact that it keeps writing to the journal. This can be fixed with the following command.

mount -o remount,noatime,nodiratime /dev/root /

I’ve searched the forum and tweaked a lot of things. Ultimately nothing worked to keep my internal drive sleeping, so I just disabled sleep and enabled it for my USB drive (which sleeps just fine).

Does this mount -o remount,noatime,nodiratime /dev/root / have to be re-run after every reboot of the My Cloud?

Yes. You can put the command in the /etc/rc2.d/S98user-start script which gets run on every boot.

Yup, still no functioning properly unless we tweak the hell out of it. Turning off drive sleep and leaving it on all the time is the best solution to my problem.

Thanks for the help though RAC!

The drive should sleep some times. How do you know it does not sleep? What does the /var/log/user.log show.
You can use the following command to check for sleep.
grep standby /var/log/user.log

The following files will give you the total sleep time.
file sleep.awk
awk ’
NR==1 { a=substr($1,6,2); b=substr($1,9,2); c=substr($1,12,8); y=substr($1,1,4)}
{if ($7 ~ /after/){
hh1=int($8/3600)
mm1=int(($8%3600)/60)
ss1=($8%3600)%60
TotalSleep = TotalSleep + $8
printf “%2s %2s %8s %8s %5d %2d:%02d:%02d\n”,substr($1,6,2),substr($1,9,2) ,substr($11,0,9),substr($
1,12,8),$8 ,hh1,mm1,ss1}}
END {
hh1=int(TotalSleep/3600)
mm1=mm1=int(($8%3600)/60)
ss1=($8%3600)%60
printf “Total Sleep Time: %2d:%02d:%02d\n” ,hh1,mm1,ss1
start= a “/” b “/” y " " c
“date +%Y”|getline year
end= substr($1,6,2) “/” substr($1,9,2) “/” year " " substr($1,12,8)
$1=start
#print start " " end
cmd=“date --date="”$1"" +%s"
#print cmd
cmd|getline st
printf “Start %s\n” ,st
$1=end
cmd=“date --date="”$1"" +%s"
cmd|getline end
#print cmd
printf “End %s\n” ,end
Total=end-st
hh1=int(Total/3600)
mm1=mm1=int((Total%3600)/60)
ss1=(Total%3600)%60
Percent=int((TotalSleep/Total)*100)
WakeTime= int(100 - Percent)
printf “Total Up Time: %2d:%02d:%02d %2d%% Sleep %2d%% Wake\n” ,hh1,mm1,ss1,Percent,WakeTime
}’

sleeptime.sh
gunzip -c /var/log/user.log.2.gz > tmpuserlog
cat tmpuserlog /var/log/user.log.1 /var/log/user.log|/nfs/George/sleep.awk
rm tmpuserlog

I put the files in a folder called George. So you need to change the location of the sleep.awk in sleeptime.sh
then just execute sleeptime.sh

Oh I know it sleeps sometimes, just not often or for very long. I’m getting
the dynamic config ini error message in my logs, so I know I could try to
stop the restsdk, but I’m kind of done with worrying about it. The drive
spinning endlessly will wear it down about the same as a drive that decides
to try to spin up and down all the time IMO.

Here is my /etc/rc2.d/S98user-start file

file S98user-start
/etc/rc2.d/S03atop stop
/etc/rc2.d/S20nfs-common stop
/etc/rc2.d/S20nfs-kernel-server stop
/etc/rc2.d/S20restsdk-serverd stop
/etc/rc2.d/S20winbind stop
/etc/rc2.d/S50netatalk stop
/etc/rc2.d/S60mDNSResponder stop
/etc/rc2.d/S61upnp_nas stop
#/etc/rc2.d/S75sudo
/etc/rc2.d/S84itunes stop
/etc/rc2.d/S85twonky stop
/etc/rc2.d/S85wdmcserverd stop
/etc/rc2.d/S86wdphotodbmergerd stop
/etc/rc2.d/S92wdnotifierd stop
/etc/rc2.d/S95wdAutoMount stop
mount -o remount,noatime,nodiratime /dev/root /

This is some of output of the sleeptime.sh script.
12 03 09:06:59 09:14:20 441 0:07:21
12 03 09:28:37 09:28:45 8 0:00:08
12 03 12:32:02 12:32:40 38 0:00:38
12 03 13:23:35 13:26:11 156 0:02:36
12 03 13:46:33 14:02:23 950 0:15:50
12 03 14:12:34 14:34:14 1300 0:21:40
12 03 15:14:58 15:17:12 134 0:02:14
12 03 15:47:45 15:47:52 7 0:00:07
12 03 15:58:03 20:14:12 15368 4:16:08
Total Sleep Time: 2343:16:08
Start 1503202640
End 1512350052
Total Up Time: 2540:56:52 92% Sleep 8% Wake

That’s awesome, but I’d be worried about what the repercussions of
disabling that many services would be.

S20restsdk-serverd is what causes the dynamic file error. You can insert a # in front of all of the commands. This would disable the command. Then you can remove the # one at a time to see how things work. I think the S20restsdk-serverd should be the first one to try.
I stop atop but it restarts every 8 hours. The nfs ones have to do with nfs mount. netatalk and itunes have to do with mac’s. twonky is the media server.

So, I attempted to add to my S98 file and placed a few services in there, however they were still running when I rebooted the My Cloud. I could manually stop the restsdk service though and that worked. My file has nothing but this in it.

/etc/rc2.d/S20restsdk-serverd stop
/etc/rc2.d/S84itunes stop
/etc/rc2.d/S85twonky stop
/etc/rc2.d/S85wdmcserverd stop
/etc/rc2.d/S86wdphotodbmergerd stop
mount -o remount,noatime,nodiratime /dev/root /

Am I missing something?

Here is an example /etc/rc2.d/S98user-start:

mount -o remount,noatime,nodiratime /dev/root /
/etc/init.d/wdmcserverd stop
/etc/init.d/wdphotodbmergerd stop
/etc/rc2.d/S85wdmcserverd stop
/etc/rc2.d/S86wdphotodbmergerd stop
/etc/rc2.d/S20restsdk-serverd stop

So, I don’t think my S98user-start file actually runs at boot up. The
script itself works when I “sh S98user-start”, but not when I reboot the My
Cloud. I just upgraded to the newest firmware, does that have anything to
do with it? Are you guys running the latest firmware as well?

@Bennor I’m attempting with your example S98user-start file now. Rebooting to see if it stops the restsdk service on boot.

I’ve scoured my user.log file and can’t see where it executes that S98user-start file anywhere. I’m not sure this new version of the firmware actually runs that file any longer.

Ugh

Add this statement to the file?
touch /tmp/user-start

After reboot check the /tmp folder for a file called user-start
I did an ls -l on /etc/rc2.d The results below. The way Linux works is on boot when going to init 2 the system will run all files in the /etc/rc2.d folder that begin with the letter S. It executes them in numerical order starting with 00.
So no matter what firmware it should run the script.

.lrwxrwxrwx 1 root root 23 Jan 11 2016 S98user-start → /CacheVolume/user-start
ls -l /CacheVolume/user-start
-rwxrwxrw- 1 root root 944 Nov 30 14:57 /CacheVolume/user-start

Okay, so my permission were wrong. I believe adding the execute privilege fixed that problem. The file seems to be working correctly now after a chmod 776 S98user-start :smiley:

Thanks @rac8006 I’m going to observe the sleep (although I haven’t loaded your sleep script yet) and see if it’s any better. I’d rather the unit sleep occasionally, but if it’s just going to go to sleep and wake up again right away then I’m going to just leave it on all the time.

The sleep issue is a frustrating one to track down and try to solve. There is no one set of services to stop that will work for everyone. One has to experiment to find what works for them and their My Cloud usage.

One factor not much discussed with the sleep issue is local devices on the local network may be triggering the My Cloud to wake up. For example when a Windows computer comes out of sleep/hibernation mode or is booted up/restarted it appears to trigger the My Cloud to wake up (at least it does in my case). In any case on my network my My Cloud simply does not sleep for multi hours at a time, even at night when it and the router are the only devices powered on. Will have to experiment at some point to see if the ISP supplied router is keeping the My Cloud awake.

The sleep option is a feature that was good in concept but poor in actual implementation. For some they may find just leaving the sleep option off works best for them. In my case I leave sleep enabled, but also shut down the My Cloud at night or when not using it for long periods of time seems to be the current happy medium.

Posted some more experimentation on the sleep issue with my v4.x My Cloud in the following thread.

Putting the My Cloud on an independent network with no other devices or internet access the device had one sleep time period that ran over 5 hours. Longest I’ve seen it sleep in one continuous sleep time frame.

You guys are awesome. I really do appreciate the time and effort in your replies and answers to my questions. I did see the device sleep a little today, but it’s not consistent nor for a very long time. I think I’ll just roll with my internal drive staying on all the time and my USB external sleeping every 15 minutes (that one stay sleeping until I actually access it).

The sleep times I got last night with my S98user-start file configured was this:

**2017-12-04T03:26:06.533426-08:00 di=v69hAMKNyS notice logger: exit standby after 7 (since 2017-12-04 03:25:58.974716001 -0800)**
**2017-12-04T03:44:08.400872-08:00 di=v69hAMKNyS notice logger: exit standby after 470 (since 2017-12-04 03:36:18.514716001 -0800)**
**2017-12-04T03:54:50.543137-08:00 di=v69hAMKNyS notice logger: exit standby after 30 (since 2017-12-04 03:54:20.324716001 -0800)**
**2017-12-04T04:10:09.499670-08:00 di=v69hAMKNyS notice logger: exit standby after 307 (since 2017-12-04 04:05:02.574716001 -0800)**
**2017-12-04T04:47:16.891199-08:00 di=v69hAMKNyS notice logger: exit standby after 1309 (since 2017-12-04 04:25:27.424716001 -0800)**
**2017-12-04T05:14:40.329657-08:00 di=v69hAMKNyS notice logger: exit standby after 1032 (since 2017-12-04 04:57:28.784716001 -0800)**
**2017-12-04T05:45:21.024866-08:00 di=v69hAMKNyS notice logger: exit standby after 1167 (since 2017-12-04 05:25:53.854716001 -0800)**
**2017-12-04T06:14:51.800000-08:00 di=v69hAMKNyS notice logger: exit standby after 1159 (since 2017-12-04 05:55:32.924716001 -0800)**
**2017-12-04T07:00:46.774569-08:00 di=v69hAMKNyS notice logger: exit standby after 2081 (since 2017-12-04 06:26:05.084716001 -0800)**
**2017-12-04T07:15:03.748211-08:00 di=v69hAMKNyS notice logger: exit standby after 245 (since 2017-12-04 07:10:58.624716001 -0800)**
**2017-12-04T07:46:27.011541-08:00 di=v69hAMKNyS notice logger: exit standby after 1209 (since 2017-12-04 07:26:17.324716001 -0800)**
**2017-12-04T08:01:10.418425-08:00 di=v69hAMKNyS notice logger: exit standby after 271 (since 2017-12-04 07:56:39.014716001 -0800)**
**2017-12-04T08:01:20.590973-08:00 di=v69hAMKNyS notice logger: Rotated atop, atop_size=3906021 atop_upload_size=4923**
**2017-12-04T08:15:15.310430-08:00 di=v69hAMKNyS notice logger: exit standby after 172 (since 2017-12-04 08:12:23.894716001 -0800)**
**2017-12-04T08:46:30.975973-08:00 di=v69hAMKNyS notice logger: exit standby after 1202 (since 2017-12-04 08:26:28.734716001 -0800)**
**2017-12-04T09:15:27.913650-08:00 di=v69hAMKNyS notice logger: exit standby after 1125 (since 2017-12-04 08:56:42.884716001 -0800)**
**2017-12-04T09:46:33.907047-08:00 di=v69hAMKNyS notice logger: exit standby after 1192 (since 2017-12-04 09:26:41.284716001 -0800)**
**2017-12-04T10:15:39.462361-08:00 di=v69hAMKNyS notice logger: exit standby after 1134 (since 2017-12-04 09:56:45.744716001 -0800)**
**2017-12-04T10:43:25.974298-08:00 di=v69hAMKNyS notice logger: exit standby after 993 (since 2017-12-04 10:26:52.734716001 -0800)**
**2017-12-04T11:15:51.363935-08:00 di=v69hAMKNyS notice logger: exit standby after 1334 (since 2017-12-04 10:53:37.824716001 -0800)**
**2017-12-04T11:44:07.279286-08:00 di=v69hAMKNyS notice logger: exit standby after 1022 (since 2017-12-04 11:27:05.064716001 -0800)**
**2017-12-04T12:16:03.033841-08:00 di=v69hAMKNyS notice logger: exit standby after 1303 (since 2017-12-04 11:54:19.194716001 -0800)**
**2017-12-04T12:50:09.661450-08:00 di=v69hAMKNyS notice logger: exit standby after 1373 (since 2017-12-04 12:27:16.354716001 -0800)**
**2017-12-04T13:11:42.523525-08:00 di=v69hAMKNyS notice logger: exit standby after 7 (since 2017-12-04 13:11:34.964716001 -0800)**
**2017-12-04T13:48:47.036225-08:00 di=v69hAMKNyS notice logger: exit standby after 1183 (since 2017-12-04 13:29:03.494716001 -0800)**
**2017-12-04T14:01:32.098740-08:00 di=v69hAMKNyS notice logger: exit standby after 154 (since 2017-12-04 13:58:58.884716001 -0800)**
**2017-12-04T14:16:18.224934-08:00 di=v69hAMKNyS notice logger: exit standby after 213 (since 2017-12-04 14:12:45.434716001 -0800)**
**2017-12-04T14:48:49.991835-08:00 di=v69hAMKNyS notice logger: exit standby after 1216 (since 2017-12-04 14:28:33.224716001 -0800)**
**2017-12-04T15:15:46.925292-08:00 di=v69hAMKNyS notice logger: exit standby after 1005 (since 2017-12-04 14:59:01.834716001 -0800)**
**2017-12-04T15:48:53.035299-08:00 di=v69hAMKNyS notice logger: exit standby after 1190 (since 2017-12-04 15:29:03.214716001 -0800)**
**2017-12-04T16:01:11.551522-08:00 di=v69hAMKNyS notice logger: Rotated atop, atop_size=4547770 atop_upload_size=4304**
**2017-12-04T16:01:16.943619-08:00 di=v69hAMKNyS notice logger: exit standby after 9 (since 2017-12-04 16:01:07.844716001 -0800)**
**2017-12-04T16:16:35.234866-08:00 di=v69hAMKNyS notice logger: exit standby after 306 (since 2017-12-04 16:11:29.024716001 -0800)**
**2017-12-04T16:49:56.921113-08:00 di=v69hAMKNyS notice logger: exit standby after 1267 (since 2017-12-04 16:28:49.894716001 -0800)**
**2017-12-04T17:00:16.016333-08:00 di=v69hAMKNyS notice logger: exit standby after 7 (since 2017-12-04 17:00:08.824716001 -0800)**
**2017-12-04T17:16:48.084086-08:00 di=v69hAMKNyS notice logger: exit standby after 380 (since 2017-12-04 17:10:28.124716001 -0800)**
**2017-12-04T17:50:00.021755-08:00 di=v69hAMKNyS notice logger: exit standby after 1256 (since 2017-12-04 17:29:03.034716001 -0800)**
**2017-12-04T18:02:09.969795-08:00 di=v69hAMKNyS notice logger: exit standby after 118 (since 2017-12-04 18:00:11.954716001 -0800)**
**2017-12-04T18:16:09.362220-08:00 di=v69hAMKNyS notice logger: exit standby after 228 (since 2017-12-04 18:12:21.914716001 -0800)**

That’s just too much on/off action for me to be comfortable with. Thanks again you guys. I’m still going to keep my tweaked S98user-start file as it remedies the crazy dynamicconfig messages every 10 seconds and shuts off some services I don’t use (which I can only assume is a good thing).

Can you post the output of a ps -eaf also your S98user-start file.