'/etc/init.d/S99sxminit restart' deletes all data

Hi,

I wanted to run syslogd in shared memory buffer mode.  So I modified /etc/init.d/S99sxminit

start() {
        echo -n "Starting 1NC init: "
        #enable syslogd
        /sbin/syslogd -m 0 -C 50
...

and did a ‘/etc/init.d/S99sxminit restart’

I was wondering why the hdd was pretty active after a while and was shocked when ‘ps ax’ brought me up this

6933 root 8672 S /usr/bin/php /proto/SxM_webui/admin/tools/auto_mount_
 6934 root 604 S sh -c /bin/rm -irf /shares/* >/dev/null 2>&1 
 6935 root 668 D /bin/rm -irf /shares/DellI8200 /shares/Download /shar

It already deleted more than 150G data. Some of it is gone for good. Thanks for that WD!! :angry:

It was done by ‘/proto/SxM_webui/admin/tools/auto_mount_for_ftp.php’ witch is used for mounting usershares to /shares. Before mounting it is removing leftovers in /shares. That is fine for the first start. But with restart, there is already everything mounted and the script doesn’t check for that but wipe out all users data.

Add this to /etc/init.d/S99sxminit line 73 to fix this

# mount with bind for FTP/HTTP
        if ["$(mount | grep -c /shares)" -eq 0]; then
          /usr/bin/php /proto/SxM_webui/admin/tools/auto_mount_for_ftp.php >/dev/null 2>&1
        fi
        /usr/sbin/settrustees >/dev/null 2>&1
        #mediaserver
        #scan usb printer
        #/usr/lib/cups/scan_printer.sh
...

regards,

Germar

WD MBWE whitelight Firmware 01.01.18

:dizzy_face: so WD!