code: def check_shm():
          
          import stat
          shm_path = '/dev/shm'
          if os.name == 'posix' and os.path.exists(shm_path):
              # We get the access rights, and we check them
              mode = stat.S_IMODE(os.lstat(shm_path)[stat.ST_MODE])
              if not mode & stat.S_IWUSR or not mode & stat.S_IRUSR:
                  logger.critical("The directory %s is not writable or readable."
                                  "Please make it read writable: %s", shm_path, shm_path)
                  print("The directory %s is not writable or readable."
                        "Please make it read writable: %s" % (shm_path, shm_path))
                  sys.exit(2)
docs: Check /dev/shm right permissions
  
          :return: None