code: func (s *State) OpenDB() error {
  	s.dbCond.L.Lock()
  	defer s.dbCond.L.Unlock()
  
  	if s.stateDB != nil {
  		return nil
  	}
  
  	// open/initialize db
  	if err := os.MkdirAll(filepath.Dir(s.stateFilePath), 0755); err != nil {
  		return fmt.Errorf("could not not mkdir for db: %s", err)
  	}
  	stateDB, err := bolt.Open(s.stateFilePath, 0600, &bolt.Options{Timeout: 5 * time.Second})
  	if err != nil {
  		return fmt.Errorf("could not open db: %s", err)
  	}
  	s.stateDB = stateDB
  	if err := s.stateDB.Update(func(tx *bolt.Tx) error {
  		// idempotently create buckets.  (errors ignored because they're all compile-time impossible args checks.)
  		tx.CreateBucketIfNotExists([]byte("jobs"))
  		tx.CreateBucketIfNotExists([]byte("gc-jobs"))
  		tx.CreateBucketIfNotExists([]byte("backend-jobs"))
  		tx.CreateBucketIfNotExists([]byte("backend-global"))
  		tx.CreateBucketIfNotExists([]byte("persistent-jobs"))
  		return nil
  	}); err != nil {
  		return fmt.Errorf("could not initialize host persistence db: %s", err)
  	}
  	return nil
  }
docs: // OpenDB opens and initialises the persistence DB, if not already open.