Disclaimer added due to request.
**Please note that anytime you SSH into your device you can cause an issue**
With out further ado, the WD My Cloud is running a variant of Debain linux. Meaning that you can run su commands that may update packages or configurations, and or delete / modify important files. Nothing that a dd can’t fix however.
With that said. This guide will not do any of those things, unless you of course choose to downgrade the firmware. Again not a big deal if you are careful. This guide is like telling a standalone program to run at boot.
More details:
https://discourse.syncthing.net/t/nas-wd-my-cloud/884/4
This is a simple guide to get syncthing to startup as a service and run at boot:
Must be on firmware < 4.00?? Maybe not running on latest firmware.
http://www.scramworks.net/hacking-mycloud.html#mc1
Step 1:
I created a share on the My Cloud Shares called Tools
You can set this up via the web page UI. Navigate in the browser to the WD’s ip address.
Enable SSH in settings
Step 2:
First you need to have the ARM7 binary file saved on the WD Drive.
Download file https://github.com/syncthing/syncthing/releases
Extract the file twice (I used 7zip) you are looking for the file named syncthing
I saved the file to /shares/Tools/ (copy to folder via windows)
Step 3:
Using putty SSH login to WD
user: root
password: welc0me
Step 4:
cd /shares/Tools
chmod +x sycthing./syncthing
Step 5:
./syncthing
Wait for Syncthing to setup.
cd /root/.config/syncthing
Step 6:
nano config.xml
Modify the config file
gui enabled="true" tls="false"
address 192.168.1.25:8080 address
Or what ever IP you are using to connect to the WD UI.
I have set my device up to be a static IP at 192.168.1.25
Step 7:
Press Ctrl + x
Y to save
And Enter to save the file as named
Step 8:
You will need to move the file to the /etc/usr/local/bin
mv /shares/Tools/syncthing /etc/usr/local/bin
Step 9:
nano /etc/init.d/syncthing
Step 10:
Paste this script into the file :
https://discourse.syncthing.net/t/keeping-syncthing-running-systemd-regular-etc-init-d/402
#!/bin/sh
### BEGIN INIT INFO
# Provides: syncthing
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of syncthing.
# Description: Starts the syncthing daemon for all registered users.
### END INIT INFO
# Replace with users you want to run syncthing clients for
syncthing_USERS=""
DAEMON=/usr/local/bin/syncthing
startd() {
for stuser in $syncthing_USERS; do
HOMEDIR=$(getent passwd $stuser | awk -F: '{print $6}')
if [-f $config]; then
echo "Starting syncthiing for $stuser"
start-stop-daemon -b -o -c $stuser -S -u $stuser -x $DAEMON
else
echo "Couldn't start syncthing for $stuser (no $config found)"
fi
done
}
stopd() {
for stuser in $syncthing_USERS; do
dbpid=$(pgrep -fu $stuser $DAEMON)
if [! -z "$dbpid"]; then
echo "Stopping syncthing for $stuser"
start-stop-daemon -o -c $stuser -K -u $stuser -x $DAEMON
fi
done
}
status() {
for stuser in $syncthing_USERS; do
dbpid=$(pgrep -fu $stuser $DAEMON)
if [-z "$dbpid"]; then
echo "syncthing for USER $stuser: not running."
else
echo "syncthing for USER $stuser: running (pid $dbpid)"
fi
done
}
case "$1" in
start) startd
;;
stop) stopd
;;
restart|reload|force-reload) stopd && startd
;;
status) status
;;
*) echo "Usage: /etc/init.d/syncthing {start|stop|reload|force-reload|restart|status}"
exit 1
;;
esac
exit 0
Step 11:
ctrl + x – to exit
y – to save
enter – confirm file name
Step 12:
nano /etc/init.d/mystartup.sh
Step 13:
Copy and paste like before in the previous step
#! /bin/sh
# /etc/init.d/mystartup.sh
#
/etc/init.d/syncthing restart &
exit 0
Step 13:
ctrl + x – to exit
y – to save
enter – confirm file name
Step 14:
sudo chmod 755 /etc/init.d/mystartup.sh
Step 15:
sudo chmod 755 /etc/init.d/syncthing
Step 16:
sudo update-rc.d mystartup.sh defaults
Step 17:
I like to use reboot command in terminal, but it has caused a few issues. The better way is to reboot the device via the WD UI.