Samba unstable after some recent updates, doesn't stay operational, I keep having to restart samba service, then it works

I find that since a recent update, Samba file shares are unstable. The smbd and nmbd are up, but I can’t get any response from them.

Almost every time I go to use them, I end up finding that they don’t work, and have to shell into the router, restart the already-running samba service, and then Samba file shares work, but usually the next day I have to repeat the process for some reason.

1 Like

Mam NAS perk. Tuto závadu mam tiež. Asi po 20 minútach kopírovania súborov na omniu sú zdieľané adresáre neprístupne.
I have NAS perk. I also have this problem. After about 20 minutes of copying files to the omniu, the shared directories are inaccessible.

Náhodou som prišiel, ze stačí uvolniť pamäť a kopírovanie pokračuje ďalej. Tak teraz spúšťam každých 15 minút program na uvoľnenie ram z cronu:
By chance, I came up with the need to free up the memory and continue copying. So now I run a 15-minute program to release ram from cron:

https://www.kernel.org/doc/Documentation/sysctl/vm.txt


if [ "$STATUS_HD" == "1" ]; then
    echo -e "   HDDs ${sleepHD} nespia, tak uvolni cache!" >> $LOG
    /bin/sync
    sleep 1
    echo 3 > /proc/sys/vm/drop_caches
    #&& swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
else
    echo -e "   HDDs ${sleepHD} spia, nebudit!" >> $LOG
fi


Nie je to systémové riešenie ale je rýchlo aplikovateľné!
Pre šetrenie elektrickej energie troch HDD používam hd-idle a indikujem stav 3 HDD na ledke A (cez farby) a load systému na B ledke. Dúfam, že sa my podari vložiť súbory. Ešte som to nerobil :(!
It’s not a system solution but is fast to apply!
To conserve 3 HDDs, I use hd-idle and I indicate the status of 3 HDDs on A (through color) and load system on B led. I hope that we file your files. I did not do it yet :(!

Žiaľ nepodarilo sa my nahrať súbory na web:

  1. omnia-loadcpu-color init scrypt
    pre súbor omnia-loadcpu-color.sh
  2. clearcache.sh do crontabu
  3. Chcel som ich prilozit preto lebo omnia-loadcpu-color.sh je zavisly na subor omnia-loadcpu-color.sh.

Unfortunately we could not upload files to the web:

  1. Omnia-loadcpu-color init scrypt
    for omnia-loadcpu-color.sh
  2. clearcache.sh into crontabu
  3. I wanted to add them because omnia-loadcpu-color.sh is based on subor omnia-loadcpu-color.sh.

crontab

#clearcache ------------ kazdych 15 min
*/15    *       *       *       *       /root/tools/clearcache/clearcache.sh

Prečo strácať čas písaním scriptov, keď sú napísane. Ja môžem uploadnut len súbory pre obrázky. Poradí my niekto ako ich uložit na web?
Why waste time writing scripts when they are written. I can upload only image files. Do anyone tell us how to save them on the web?

Add files:

omnia-loadcpu-color

#!/bin/sh /etc/rc.common

START=98

USE_PROCD=1
NAME=omnia-loadcpu-color
PROG=/root/tools/loadcpu-color/omnia-loadcpu-color.sh

start_service() {
        procd_open_instance
        procd_set_param command "$PROG"
        procd_close_instance
}

stop() {
        service_stop "$PROG"
}

reload() {
        service_reload "$PROG"
}

omnia-loadcpu-color.sh

#!/bin/sh

#nacitam spolocne prikazy
if [ -f /root/tools/envir ]; then
    source /root/tools/envir
else
   "$(command -v logger)" -p "info" -t "/root/tools/envir" "envir file not exist"
   exit 1
fi

LOG=/tmp/${NAME_SCRIPT}.log
#find All hdd wich wil by tested in actual smartd.conf
HDPARM="$( command -v hdparm )"

sleepHD() {
 local i=0 R=0 G=0 B=0
  rainbow usr1 enable

  #test hdd in ALL_HDD='/dev/sda /dev/sdb /dev/sdc'
#if you only 2 HDDs then remove part #B
  for d in ${ALL_HDD}
  do
   STANDBY=`"${HDPARM}" -C ${d} | grep standby | wc -l`
   #STANDBY=`smartctl -i -n standby ${d} | grep STANDBY | wc -l`
   if [ "${STANDBY}" == "1" ]; then
     COLOR=0
   else
     COLOR=255
   fi
   #R
   if [ "${i}" == "0" ]; then
     R=${COLOR}
   fi
   #G
   if [ "${i}" == "1" ]; then
     G=${COLOR}
   fi
   #B
   if [ "${i}" == "2" ]; then
     B=${COLOR}
   fi

  #echo i:${i}, COLOR:${COLOR}
  let i=i+1
  done

  COLORH=`printf "%.2x%.2x%.2x" ${R} ${G} ${B}`
  echo sleepHD=${COLORH} >> $LOG
  rainbow usr1 $COLORH
}

calc(){
  awk "BEGIN { print "$*" }"
}

#Pocet cpu
#NOCPU=`grep processor /proc/cpuinfo | wc -l`
MAXLOADCPU=`grep 'model name' /proc/cpuinfo | wc -l`
#echo MAXLOADCPU=$MAXLOADCPU

#Mapovanie na max pocet farieb
MAPCOLOR=`calc 255/$MAXLOADCPU`
#echo MAPCOLOR=$MAPCOLOR

ledcpu() {
  rainbow usr2 enable
  LOADCPU=`cat /proc/loadavg | cut -d " " -f 1`
  #LOADCPU=0.01
  #pre TMUX
  echo loadcpu1m=$LOADCPU > $LOG

  COLOR=`calc $LOADCPU*$MAPCOLOR`
  #echo COLOR=$COLOR
  COLOR1=`echo $COLOR | cut -d. -f1`
  if [ $COLOR1 -gt 255 ] ; then
    #echo $COLOR1 je vacsie ako 255
    rainbow usr2 red
  else
    #echo $COLOR1 je mensie ako 255
    COLORH=`printf "%.2x00%.2x" $COLOR1 $COLOR1`
    #echo COLORH=$COLORH
    rainbow usr2 $COLORH
  fi
}

START=1
while [ $START ]; do
  ledcpu
  sleepHD
  sleep 5s
done

Not visible char ` in vars!