[Solved] My NAS device NEVER SLEEP while btsync is alive


jdh

Recommended Posts

Hi, All~~

I have used btsync (v2.3.7.451) on "WD My Cloud" single bay (f/w version is v4.x)

Via various topics in many communities, I get to know that a lot of users faced to and solved the problem about the power-saving mode of nas using btsync...

And I keep up with various solutions for this tricky issue, too

But.... Unfortunately, as a result my nas drive do not sleep... NEVER SLEEP while btsync is running.. :-(

All configurations of btsync to solve it are absolutely set correct .... so far as I know....

- use_upnp, enable_journaling are disable

- folder_rescan_interval, config_refresh_interval and config_save_interval is set to 86400 (1 day)

what more should be changed???

 

Thanks in any advance....

 

Some logs and config are as follows...

Additionally, I attached the result of lsof command for btsync, executing "lsof | grep btsync" when btsync was running 

 

1. btsync.conf is

Quote

 -- snip the upper --
  
  ,"use_upnp": false
  ,"folder_rescan_interval": 86400
  ,"config_refresh_interval": 86400
  ,"config_save_interval": 86400
  ,"enable_journaling": false 

  ,"profiler_enabled": false

  ,"folder_defaults.use_relay": false
  ,"folder_defaults.use_tracker": false
  ,"folder_defaults.use_lan_broadcast": false

  ,"enable_file_system_notifications": false

   -- snip the rest --

My nas is continuously awake on, Even though "folder_rescan_interval", "config_refresh_interval" and "config_save_interval" is set to zero (stands for disable),

 

2. sync.log is

Quote

platform: Linux 3.2.26 #1 SMP Thu Jul 9 11:14:15 PDT 2015 wd-2.4-rel armv7l
version: 2.3.7.451
[20160622 00:44:41.611] UDP: bound listening socket 9 to IP 0.0.0.0:13378
[20160622 00:44:41.634] Loading config file version 2.3.7, current version 2.3.7
[20160622 00:44:41.635] My PeerID: 1090248CB2441C4012721D0793C12A..........
[20160622 05:37:48.209] Received shutdown request via signal 15
[20160622 05:37:49.144] Shutdown. Saving config sync.dat

btsync was started at 00:44:41 and then, stopped at 05:37:49....

Furthermore, "use_upnp" option is disable and "debug logging mode" is off (debug.txt in storage folder has zero value)

so the log of btsync is way too simple as you can see from above messages...

 

3. /var/log/user.log is

Quote

-- snip the above --

2016-06-21T23:23:16.648160+09:00 di=n0d8wLJPZY notice logger: exit standby after 7 (since 2016-06-21 23:23:09.079113001 +0900) 
2016-06-22T00:01:13.113575+09:00 di=n0d8wLJPZY notice logger: Rotated atop, atop_size=10545781 atop_upload_size=7489
2016-06-22T03:00:03.053687+09:00 di=n0d8wLJPZY notice getNewFirmwareUpgrade.sh: begin script: immediate send_alert auto
2016-06-22T03:00:03.365199+09:00 di=n0d8wLJPZY notice getNewFirmwareUpgrade.sh: http://support.wdc.com/nas/list.asp?devtype=sq&devfw=04.04.02-105&devlang=kor&devsn=&auto=0&devid=*****
2016-06-22T03:01:01.864103+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/", "capacityK":1968336, "totalK":869276, "partition":"rootfs" }
2016-06-22T03:01:01.926661+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/", "capacityK":1968336, "totalK":869276, "partition":"/dev/root" }
2016-06-22T03:01:01.983826+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/run", "capacityK":40960, "totalK":3712, "partition":"tmpfs" }
2016-06-22T03:01:02.035352+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/run/lock", "capacityK":40960, "totalK":64, "partition":"tmpfs" }
2016-06-22T03:01:02.265430+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"5a500f0368bd01ae8dc965a89133d5b3", "capacityK":10240, "totalK":0, "partition":"tmpfs" }
2016-06-22T03:01:02.293896+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/run/shm", "capacityK":5120, "totalK":0, "partition":"tmpfs" }
2016-06-22T03:01:02.322054+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/tmp", "capacityK":102400, "totalK":3328, "partition":"tmpfs" }
2016-06-22T03:01:02.357658+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/var/log", "capacityK":40960, "totalK":8640, "partition":"ramlog-tmpfs" }
2016-06-22T03:01:02.385731+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"dataSize", "mountPoint":"/DataVolume", "capacityK":3841069352, "totalK":117406132, "partition":"/dev/sda4" }
2016-06-22T03:01:02.506796+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"rootfs", "inode":125184, "iused":31560, "mountPoint":"/" }
2016-06-22T03:01:02.534690+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"/dev/root", "inode":125184, "iused":31560, "mountPoint":"/" }
2016-06-22T03:01:02.563036+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"tmpfs", "inode":1815, "iused":219, "mountPoint":"/run" }
2016-06-22T03:01:02.590952+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"tmpfs", "inode":1815, "iused":5, "mountPoint":"/run/lock" }
2016-06-22T03:01:02.679076+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"tmpfs", "inode":1815, "iused":151, "mountPoint":"5a500f0368bd01ae8dc965a89133d5b3" }
2016-06-22T03:01:02.707227+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"tmpfs", "inode":1815, "iused":2, "mountPoint":"/run/shm" }
2016-06-22T03:01:02.735465+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"tmpfs", "inode":20480, "iused":83, "mountPoint":"/tmp" }
2016-06-22T03:01:02.771665+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"ramlog-tmpfs", "inode":1815, "iused":123, "mountPoint":"/var/log" }
2016-06-22T03:01:02.799865+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"inodeUsage", "filesystem":"/dev/sda4", "inode":243900416, "iused":13569, "mountPoint":"/DataVolume" }
2016-06-22T03:01:04.494532+09:00 di=n0d8wLJPZY notice BaseOSlog: { "msgid":"usageSize", "totalB":123420645950, "photos":0, "video":0, "music":0, "other":123420645950 }
2016-06-22T03:05:02.805201+09:00 di=n0d8wLJPZY notice logger: disable lazy init
2016-06-22T05:49:48.294841+09:00 di=n0d8wLJPZY notice logger: exit standby after 8 (since 2016-06-22 05:49:40.707614001 +0900)
2016-06-22T06:00:05.476511+09:00 di=n0d8wLJPZY notice logger: exit standby after 6 (since 2016-06-22 05:59:59.307614001 +0900)
2016-06-22T06:12:27.739495+09:00 di=n0d8wLJPZY notice logger: exit standby after 7 (since 2016-06-22 06:12:20.147614001 +0900)
2016-06-22T06:24:42.655429+09:00 di=n0d8wLJPZY notice logger: exit standby after 123 (since 2016-06-22 06:22:39.027614001 +0900)
2016-06-22T06:42:09.536946+09:00 di=n0d8wLJPZY notice logger: exit standby after 7 (since 2016-06-22 06:42:02.077614001 +0900)
2016-06-22T07:00:08.735602+09:00 di=n0d8wLJPZY notice logger: exit standby after 468 (since 2016-06-22 06:52:20.617614001 +0900)
2016-06-22T07:17:10.322191+09:00 di=n0d8wLJPZY notice logger: exit standby after 411 (since 2016-06-22 07:10:19.827614001 +0900)
2016-06-22T07:30:32.912468+09:00 di=n0d8wLJPZY notice logger: exit standby after 7 (since 2016-06-22 07:30:25.317614001 +0900)
2016-06-22T08:00:08.676961+09:00 di=n0d8wLJPZY notice logger: exit standby after 1164 (since 2016-06-22 07:40:44.037614001 +0900)
2016-06-22T08:01:12.724448+09:00 di=n0d8wLJPZY notice logger: Rotated atop, atop_size=5812196 atop_upload_size=6003
2016-06-22T08:17:10.260334+09:00 di=n0d8wLJPZY notice logger: exit standby after 410 (since 2016-06-22 08:10:20.107614001 +0900)
2016-06-22T08:35:59.243211+09:00 di=n0d8wLJPZY notice logger: exit standby after 518 (since 2016-06-22 08:27:21.227614001 +0900)
2016-06-22T09:00:35.958545+09:00 di=n0d8wLJPZY notice logger: exit standby after 7 (since 2016-06-22 09:00:28.387614001 +0900

From system log (/var/log/user.log), I found that my nas never sleep while btsync is running...

But After stopping btsync daemon, my nas gets some sleep ordinarily if free....

lsof_result_for_btsync.log

Link to comment
Share on other sites

@RomanZ

Thanks for your reply... I'm longing for you... :-)

 

12 hours ago, RomanZ said:

1. Put "0" value to "debug.txt" file. It should be in "/mnt/HD/HD_a2/Nas_Prog/BitTorrentSync/settings" for WD.

what you said is absolute path???  I could not change another path I prefer???

If not, could I use symbolic link for debug.txt ??

For example, I wanna make debug.txt (has 0) in /etc/btsync/, and then connect real file with symbolic link file using several commands as follows:
 

mkdir -p /etc/btsync /mnt/HD/HD_a2/Nas_Prog/BitTorrentSync/settings

echo 0 > /etc/btsync/debug.txt

ln -s /etc/btsync/debug.txt /mnt/HD/HD_a2/Nas_Prog/BitTorrentSync/settings/debug.txt

It's possible???

 

 

12 hours ago, RomanZ said:

2. Upgrade your Sync to 2.3.8 - there was a bug in whole 2.3 preventing NAS devices from sleeping.

How could I upgrade it??  please, let me know where I can download that..

Unfortunately, I know nothing about that....  :-(

 

I appreciate for your help....

Link to comment
Share on other sites

@jdh

1. Yes, it is absolute path. All the WDMyCloud devices I encountered had the same path, although I suspect that some devices may have the "HD_a2" component be replaced with something else. The debug.txt file should already exist if you found Sync's settings folder correctly. All you need to do is to change its content and restart Sync to ensure it is not writing any logs (and disturb dozing HDD ;) )

Sync is using regular POSIX API to access files, so I believe you can make symlink and place debug.txt in any place you want, but I see no big point as the dir we are looking for is the dir designated by WD to store Sync's settings.

2. You can grab new package here.

Link to comment
Share on other sites

@RomanZ

Thanks for your fast reply and advice... :)

 

2 hours ago, RomanZ said:

2. You can grab new package here.

I found the page that you addressed has some download links (point to getsync.com site) for WD nas with new version - EX* series, DL* series and Mirror Gen2...

But, there is not any link for my nas.... :(

My stuff is WD My Cloud single-bay product (the result of "uname -a" is Linux HomeDisk 3.2.26 #1 SMP Thu Jul 0 11:14:15 PDT 2015 wd-2.4-rel armv7l GNU/Linux)

Please.... I wanna use btsync with version 2.3.8 for my nas - WD My Cloud single-bay, generation 1

What should I do for it ????

 

Thanks for your help...

 

Link to comment
Share on other sites

@RomanZ

Hi, again~

 

I successfully downloaded and installed new version of btsync (the version is v2.3.8.560) from the download page of getsync.com..

And then,  tested again whether my nas goes to sleep deeply...

 

In summary, it's better than before.. but the result is not too happy to me just yet.... :(

Now, my nas device wakes up every hour.... (some log is below - /var/log/user.log)

Quote

2016-06-24T23:00:04.611198+09:00 di=n0d8wLJPZY notice logger: exit standby after 2929 (since 2016-06-24 22:11:15.673030001 +0900)
2016-06-25T00:00:04.612794+09:00 di=n0d8wLJPZY notice logger: exit standby after 2927 (since 2016-06-24 23:11:17.563030001 +0900)
2016-06-25T01:00:05.612189+09:00 di=n0d8wLJPZY notice logger: exit standby after 2928 (since 2016-06-25 00:11:17.693030001 +0900)
2016-06-25T02:00:07.619616+09:00 di=n0d8wLJPZY notice logger: exit standby after 2929 (since 2016-06-25 01:11:18.683030001 +0900)
2016-06-25T03:00:07.609208+09:00 di=n0d8wLJPZY notice logger: exit standby after 2927 (since 2016-06-25 02:11:20.583030001 +0900)
2016-06-25T04:00:09.629086+09:00 di=n0d8wLJPZY notice logger: exit standby after 2929 (since 2016-06-25 03:11:20.603030001 +0900)
2016-06-25T05:00:09.607265+09:00 di=n0d8wLJPZY notice logger: exit standby after 2927 (since 2016-06-25 04:11:22.613030001 +0900)
2016-06-25T06:00:11.632634+09:00 di=n0d8wLJPZY notice logger: exit standby after 2929 (since 2016-06-25 05:11:22.593030001 +0900

 

I have tried to look for some clues about current situation,  and found it...

Quote

-rw------- 1 btsync share 4420  Jun 25 05:59 sync.dat
-rw------- 1 btsync share 4420  Jun 25 04:59 sync.dat.old

 

That is, btsync makes backup file(sync.dat.old) for sync.dat,  and then saves current status of btsync to sync.dat  EVERY HOUR!!  

(My guessing is right???)

And my nas device was compelled to wake up frequently due to btsync's this behavior...

 

So I wonder how to redefine backup-and-save interval for sync.dat to larger value than current (1 hour)..

How could I do this??

Or could I set disable this operation??  I wanna save sync.dat only when the btsync is stopping

(Already I know the fact that btsync saves sync.dat before stopping... B|)

 

 

I'm joyfully looking forward to your reply...

Thanks....

 

Link to comment
Share on other sites

@RomanZ, @Helen

 

Thanks for your support...

 

I realized some mistake that I set wrong value for config_save_interval and so on...

Now, I defined enough larger value (8640000; 100 days B|) for config_save_interval...

 

Therefore, my nas has a deep sleep.... I'm so satisfied with it...

 

Again... I heartily appreciate your support.

Link to comment
Share on other sites

@jdh It's actually bad idea to set config_save_interval to 100 days. The config contains a lots of valuable data - users which were approved and declined by you, your folders, etc. If Sync is killed ungracefully or crashes - all this data could be lost and actually, will spawn lots of really strange and hard-to-debug issues.  I'd advise to set it to once per day (once per 2 days the rarest).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.