Autoshutdown Disable SMBSTATUS Check

    • OMV 1.0
    • Autoshutdown Disable SMBSTATUS Check

      Hello,

      i know some users need the check for aktive SMB conections but is there a way to disable this?
      Talking about this:
      Samba connected (reported by smbstatus) -> no shutdown

      Autoshutdown is set to not shutdown if theres and ULDL Rate of more than 50 kB/s.
      Now if someone is watching a movie with the folder open in the background and they fall asleep like in the middle of the movie (*cough* Girlfriend *cough*)
      My NAS should shutdown if the movie is finished so the ULDL Rate is below 50 kB/s but it stays online because of the SMBstatus check.


      greetings
      Haytred
    • unfortunately thats not working. it checks Samba regardless of what i put into the portcheck.
      Ive set IP check to 253..254 and portcheck to 999 just to make sure.

      the Portcheck for 445 looks like this Found active connection on port 445 (SMB/CIFS) from 192.168.0.100
      with 999 in ports it wont show anything in the log but the smbstatus will still command the NAS to stay online
    • My system not suspend too, because smbcheck found some active connection on port 445 even if no other computer/ip is connectet to the network.
      Display Spoiler

      Source Code

      1. # This configuration file is auto-generated.
      2. # WARNING: Do not edit this file, your changes will be lost.
      3. ENABLE="true"
      4. CYCLES=6
      5. SLEEP=180
      6. RANGE="20,25"
      7. SHUTDOWNCOMMAND="pm-suspend-hybrid"
      8. CHECKCLOCKACTIVE="true"
      9. UPHOURS="7..22"
      10. NSOCKETNUMBERS="21,80,139,443,445,943,1194,3689,6991,9091,21199,49152"
      11. ULDLCHECK="true"
      12. ULDLRATE=20
      13. LOADAVERAGECHECK="true"
      14. LOADAVERAGE=15
      15. HDDIOCHECK="true"
      16. HDDIO_RATE=250
      17. SYSLOG="true"
      18. VERBOSE="false"
      19. FAKE="false"
      20. Apr 24 06:57:36 omv logger: autoshutdown[13777]: INFO: ' new supervision cycle started - check active hosts or processes'
      21. Apr 24 06:57:36 omv logger: autoshutdown[13777]: INFO: ' Checking the time: stay up or shutdown ...'
      22. Apr 24 06:57:36 omv logger: autoshutdown[13777]: INFO: ' System is in Shutdown-Range. Do further checks ...'
      23. Apr 24 06:57:36 omv logger: autoshutdown[13777]: INFO: ' retrieve list of active IPs for 'eth0' ...'
      24. Apr 24 06:57:37 omv logger: autoshutdown[13777]: INFO: ' No active IPs in the specified IP-Range found'
      25. Apr 24 06:57:37 omv logger: autoshutdown[13777]: INFO: ' Check Connections for 'eth0''
      26. Apr 24 06:57:37 omv logger: autoshutdown[13777]: INFO: ' _check_net_status(): Found active connection on port 445 (SMB/CIFS) from 192.168.1.20'
      27. Apr 24 06:57:37 omv logger: autoshutdown[13777]: INFO: ' Found 1 active socket(s) from Port(s): 21,80,139,443,445,943,1194,3689,6991,9091,21199,49152'
      28. Apr 24 06:57:37 omv logger: autoshutdown[13777]: INFO: ' sleep for 180s.'
      Display All

      I think its a samba/smbcheck bug that locked some file even after the smb connection is gone --> forum.ubuntuusers.de/topic/sam…s-verhindern-autosuspend/.

      The post was edited 1 time, last by LooR ().

    • if autoshutdown detects a connection, then there is a connection. You can check it with netstat -tulpen and smbstatus
      This two commands are used to detect connections
      "Glowing days. Don't cry because they are over. Smile because they happened." - Confucius

      Server: 1x 32GB SSD (system) - 5x 2TB Data - 1x 2TB Snapraid-Parity - latest OMV 1.x
      No Support through PM
      Tutorials --- Howto install OMV-Extras --- Upgrade/Update-Problems --- If autoshutdown doesn' -work
    • Are your PCs conntected from Windows to your server? Windows does not close connections sometimes. So don't blame this script or OMV.

      Never mind! Please post the output of
      smbstatus
      smbstatus -p
      smbstatus -v
      and I'll have a look.
      Thx
      "Glowing days. Don't cry because they are over. Smile because they happened." - Confucius

      Server: 1x 32GB SSD (system) - 5x 2TB Data - 1x 2TB Snapraid-Parity - latest OMV 1.x
      No Support through PM
      Tutorials --- Howto install OMV-Extras --- Upgrade/Update-Problems --- If autoshutdown doesn' -work
    • Have the same or very similar issue from long time with Windows 10

      Solo0815 wrote:

      Please post the output of

      smbstatus
      smbstatus -p
      smbstatus -v
      and I'll have a look.
      Thx
      Below my output,

      Brainfuck Source Code

      1. root@omv1T:/var/log# smbstatus
      2. Samba version 4.9.5-Debian
      3. PID Username Group Machine Protocol Version Encryption Signing
      4. ----------------------------------------------------------------------------------------------------------------------------------------
      5. 5642 user1 users 192.168.11.145 (ipv4:192.168.11.145:54273) SMB3_11 - partial(AES-128-CMAC)
      6. Service pid Machine Connected at Encryption Signing
      7. ---------------------------------------------------------------------------------------------
      8. IPC$ 5642 192.168.11.145 Sat Nov 23 13:10:46 2019 CET - -
      9. No locked files
      10. root@omv1T:/var/log# smbstatus -p
      11. Samba version 4.9.5-Debian
      12. PID Username Group Machine Protocol Version Encryption Signing
      13. ----------------------------------------------------------------------------------------------------------------------------------------
      14. 5642 user1 users 192.168.11.145 (ipv4:192.168.11.145:54273) SMB3_11 - partial(AES-128-CMAC)
      15. root@omv1T:/var/log# smbstatus -v
      16. using configfile = /etc/samba/smb.conf
      17. Samba version 4.9.5-Debian
      18. PID Username Group Machine Protocol Version Encryption Signing
      19. ----------------------------------------------------------------------------------------------------------------------------------------
      20. 5642 user1 users 192.168.11.145 (ipv4:192.168.11.145:54273) SMB3_11 - partial(AES-128-CMAC)
      21. Service pid Machine Connected at Encryption Signing
      22. ---------------------------------------------------------------------------------------------
      23. IPC$ 5642 192.168.11.145 Sat Nov 23 13:10:46 2019 CET - -
      24. No locked files
      25. root@omv1T:/var/log# ping 192.168.11.145
      26. PING 192.168.11.145 (192.168.11.145) 56(84) bytes of data.
      27. From 192.168.10.1 icmp_seq=1 Destination Host Unreachable
      28. From 192.168.10.1 icmp_seq=2 Destination Host Unreachable
      29. From 192.168.10.1 icmp_seq=3 Destination Host Unreachable
      30. From 192.168.10.1 icmp_seq=4 Destination Host Unreachable
      31. From 192.168.10.1 icmp_seq=5 Destination Host Unreachable
      32. From 192.168.10.1 icmp_seq=6 Destination Host Unreachable
      33. ^C
      34. --- 192.168.11.145 ping statistics ---
      35. 7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 80ms
      36. pipe 3
      37. root@omv1T:/var/log#
      Display All

      General SMB not close connection and keep it forever, because my laptop under 192.168.11.145 not working from long time. So I assume this is SAMBA issue, can you help with configure SAMABA to autodisconnect after some time?