Bugfixes, dont stop if fs already mounted in jail
This commit is contained in:
parent
3dae685fc4
commit
1cb7c5fec7
13
cmd/start.go
13
cmd/start.go
@ -222,16 +222,21 @@ func jailZfsDatasets(jail *Jail) error {
|
||||
}
|
||||
|
||||
// Mount from inside jail if mountpoint is set
|
||||
cmd = fmt.Sprintf("zfs get -H -o value mountpoint %s/%s", jail.JID, jail.Zpool, d)
|
||||
cmd = fmt.Sprintf("zfs get -H -o value mountpoint %s/%s", jail.Zpool, d)
|
||||
out, err = executeCommand(cmd)
|
||||
if err != nil {
|
||||
return errors.New(fmt.Sprintf("Error getting zfs dataset %s mountpoint: %v: out", d, err, out))
|
||||
return errors.New(fmt.Sprintf("Error getting zfs dataset %s/%s mountpoint: %v: %s", jail.Zpool, d, err, out))
|
||||
}
|
||||
if len(out) > 0 && out != "-" && (false == strings.EqualFold(out, "none")) {
|
||||
cmd = fmt.Sprintf("zfs mount %s", jail.Zpool, d)
|
||||
//cmd = fmt.Sprintf("zfs mount %s/%s", jail.Zpool, d)
|
||||
cmd = fmt.Sprintf("zfs mount -a")
|
||||
out, err = executeCommandInJail(jail, cmd)
|
||||
if err != nil {
|
||||
return errors.New(fmt.Sprintf("Error mounting zfs dataset %s: %v: out", d, err, out))
|
||||
// If already mounted, continue processing
|
||||
if ! strings.HasSuffix(out, "filesystem already mounted\n") {
|
||||
//return errors.New(fmt.Sprintf("Error mounting zfs dataset %s/%s: %v: %s", jail.Zpool, d, err, out))
|
||||
return errors.New(fmt.Sprintf("Error executing \"zfs mount -a\" from inside jail: %v: %s", err, out))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user