code: func (p *Daemon) UnmarshalSnapshot(m map[string]interface{}) error {
  	var s daemonSnapshot
  	if err := mapstructure.Decode(m, &s); err != nil {
  		return err
  	}
  
  	p.lock.Lock()
  	defer p.lock.Unlock()
  
  	// Set the basic fields
  	p.ProxyToken = s.ProxyToken
  	p.ProxyID = s.ProxyID
  	p.Command = &exec.Cmd{
  		Path: s.CommandPath,
  		Args: s.CommandArgs,
  		Dir:  s.CommandDir,
  		Env:  s.CommandEnv,
  	}
  
  	// FindProcess on many systems returns no error even if the process
  	// is now dead. We perform an extra check that the process is alive.
  	proc, err := findProcess(s.Pid)
  	if err != nil {
  		return err
  	}
  
  	// "Start it"
  	stopCh := make(chan struct{})
  	exitedCh := make(chan struct{})
  	p.stopCh = stopCh
  	p.exitedCh = exitedCh
  	p.process = proc
  	go p.keepAlive(stopCh, exitedCh)
  
  	return nil
  }
docs: // UnmarshalSnapshot implements Proxy