@Kryten thanks, that’s what I’ve done the same night before you posted this answer,
I also replaced the custom Samba start script of Antonin_Fischer with the one of @bumbak reply#103, and now My device is working 100% ok, no more restart. I supose this was linked to android program that check at regular intervals for running scripts/programs and relaunch WD custom scripts (we modified), entware via rc.unslung script was certainly restarted regularly.
I would really like to know more on Android standard boot, WDMCH custom boot scripts sequence, then be able to customise a little bit more “clean” the device…
Maybe create a more simple tuto to get a NAS quickly from this device…
Then… I spent some hours to look at the different logs that are more in this folder on my device:
/data/wd/diskVolume0/logs/upload/main
And found that usually the reset button script was invoked by the system to do a reset, don’t know why,
sh : type=1400 audit(0.0:1034): path="/system/bin/reset_button.sh" dev="sataa20" ino=259
and while inspecting the reset button script I discovered that there is way to physically shutdown the device (don’t know what is the custom manual/physical action to do on the button, maybe hit twice…)… in the official manual it is not explained how, only 3 possibility:
- 1 time: reset
- hold more than 30s: reset ownership to create new mycloud owner
- hold more than 60s: Factory reset (and data)
.
/system/bin/reset_button.sh
#log -p -i -t "reset_button" "$1 $2"
if [ "$1" == "short" ]; then
led_ctrl_client -s 7
log -p i -t "reset_button" "short press - reboot"
reboot
elif [ "$1" == "long" ]; then
log -p i -t "reset_button" "Perform Hardware Reset"
led_ctrl_client -s 7
notify_cloud -s reset_button -n 134
sleep 5
led_ctrl_client -s 20
elif [ "$1" == "factory" ]; then
log -p i -t "reset_button" "Perform Factory Reset"
notify_cloud -s reset_button -n 136
sleep 5
factory_reset.sh
elif [ "$1" == "shutdown" ]; then
set_clean_shutdown
led_ctrl_client -s 8
log -p i -t "reset_button" "shutdown ..."
But discovered lot of strange things I need to investigate:
The device can (or it does) send the logs to Western digital’s Amazon buckets
The script responsible of logs upload contains the bucket secret keys… I need to know how to use them !
/system/bin/setup_logs_config.sh
if [ -z "$AWS_BUCKET" ]
then
AWS_BUCKET="wd-portal-prod-fwcrashdump"
AWS_BUCKET=$(setprop debug.log.upload.aws_bucket "$AWS_BUCKET")
fi
if [ -z "$AWS_ACCESS_KEY_ID" ] || [ -z "$AWS_SECRET_ACCESS_KEY" ]
then
AWS_ACCESS_KEY_ID="AKIAJUO************"
AWS_SECRET_ACCESS_KEY="Qq9i+k30OuzjzUAA*********"
fi
Network/internet test you are right, looking at logs show the device verify local network, gateway and internet access to WD… by the way, in the official manual it’s written that device MUST be connected to Internet…
/data/wd/diskVolume0/logs/upload/main # cat *
2020-04-17T00:22:10.696Z 2758 9615 I ConnectivityService: checking ethernet link
2020-04-17T00:22:10.696Z 2758 9615 I ConnectivityService: checking gateway
2020-04-17T00:22:10.696Z 2758 9615 I ConnectivityService: ping gateway 192.168.#.#, count 0
2020-04-17T00:22:10.721Z 2758 9615 I ConnectivityService: ping staging.mycloud.com, count 0
2020-04-17T00:22:10.747Z 2758 9615 I ConnectivityService: diagnosisNet success.
**And a script that seems to be used to gather regular details about the device… do some network tests also… **
/system/bin/filebeat_start.sh
But it’s associated to a program, not a script, so no idea of what it really does…
"/system/bin/filebeat" (12 MO...)
results seems to be writen in specific file… /etc/filebeat.yml
how to get info on architecture/version of the system
# /system/bin/getprop ro.hardware
monarch
there is a web server content I would really like to be able to use
/system/data/www/htdocs/
index.html etc
and there is a wab server running with lighthttpd,
http://192.168.0.**:33284
But can’t see any files in here with standard internet browser
interesting help explaining the usage of some folders
/system/bin/move_upload_logs.sh
export HOME=/data
CONFIG_FOLDER=/wd_config
BASEPATH=/data/logs
TOMBSTONEBASEPATH=/data/tombstones
PSTOREBASEPATH=/sys/fs/pstore
OTABASEPATH=/data/wd/ota
FACTORYRESETBASEPATH=/wd_config
PLEXBASEPATH="/data/data/com.plexapp.mediaserver.smb/Plex Media Server/Logs"
UPLOADEDLOGSPATH=/data/wd/diskVolume0/uploadedLogs
SMARTCTLBASEPATH=/tmp
another script that shall be helpful… to get info on the device…
host_util.sh
function show_help
{
echo "WD Host Utility version $SCRIPT_VER"
echo "Usage: $SCRIPT_NAME [Options]"
echo "Options:"
echo "-sn - Show serail number"
echo "-mac - Show mac address"
echo "-time - Show time"
echo "-hdd [sn|cap|temp] - Show HDD [serail number|capacity|temperature]"
echo "-cpu - Show CPU usage"
echo "-version - Show platform OS version"
exit 0
}
All in All, the device is remotely configured from mycloud.com, and from your account you can donwload device logs (explaining why they built in a log export function), disable the option to send logs to western digital (thanks god, EU laws on personal data protection force them to put this kind of options), shutdown the device, restart, factory reset, etc… So, it’s a little bit “by design” that we have all those “strange” scripts… but I woul really like to understand more how their technical architeture is working to achieve all of that
And, finally not so surprised that the device reboots every 2 minutes if it countiniously fail to connect to mycloud (with your startup script), it is logic, device is broken from Western Digital point of view if it doesn not connect sucessfully to internet…
last question Kryten, regarding your /etc/hosts file what do you exactly have inside at the end, I would try.