code: func (r *runtimeOCI) ReopenContainerLog(c *Container) error {
  	controlPath := filepath.Join(c.BundlePath(), "ctl")
  	controlFile, err := os.OpenFile(controlPath, os.O_WRONLY, 0)
  	if err != nil {
  		return fmt.Errorf("failed to open container ctl file: %v", err)
  	}
  	defer controlFile.Close()
  
  	watcher, err := fsnotify.NewWatcher()
  	if err != nil {
  		return fmt.Errorf("failed to create new watch: %v", err)
  	}
  	defer watcher.Close()
  
  	done := make(chan struct{})
  	errorCh := make(chan error)
  	go func() {
  		for {
  			select {
  			case event := <-watcher.Events:
  				logrus.Debugf("event: %v", event)
  				if event.Op&fsnotify.Create == fsnotify.Create || event.Op&fsnotify.Write == fsnotify.Write {
  					logrus.Debugf("file created %s", event.Name)
  					if event.Name == c.LogPath() {
  						logrus.Debugf("expected log file created")
  						close(done)
  						return
  					}
  				}
  			case err := <-watcher.Errors:
  				errorCh <- fmt.Errorf("watch error for container log reopen %v: %v", c.ID(), err)
  				return
  			}
  		}
  	}()
  	cLogDir := filepath.Dir(c.LogPath())
  	if err := watcher.Add(cLogDir); err != nil {
  		logrus.Errorf("watcher.Add(%q) failed: %s", cLogDir, err)
  		close(done)
  	}
  
  	if _, err = fmt.Fprintf(controlFile, "%d %d %d\n", 2, 0, 0); err != nil {
  		logrus.Debugf("Failed to write to control file to reopen log file: %v", err)
  	}
  
  	select {
  	case err := <-errorCh:
  		return err
  	case <-done:
  		break
  	}
  
  	return nil
  }
docs: // ReopenContainerLog reopens the log file of a container.