in component/libfuse/libfuse.go [283:347]
func (lf *Libfuse) Configure(_ bool) error {
log.Trace("Libfuse::Configure : %s", lf.Name())
// >> If you do not need any config parameters remove below code and return nil
conf := LibfuseOptions{IgnoreOpenFlags: true}
err := config.UnmarshalKey(lf.Name(), &conf)
if err != nil {
log.Err("Libfuse::Configure : config error [invalid config attributes]")
return fmt.Errorf("config error in %s [invalid config attributes]", lf.Name())
}
err = config.UnmarshalKey("lfuse", &conf)
if err != nil {
log.Err("Libfuse::Configure : config error [invalid config attributes: %s]", err.Error())
return fmt.Errorf("config error in lfuse [invalid config attributes]")
}
// Extract values from 'conf' and store them as you wish here
err = config.UnmarshalKey("mount-path", &conf.mountPath)
if err != nil {
log.Err("Libfuse::Configure : config error [unable to obtain mount-path]")
return err
}
err = config.UnmarshalKey("read-only", &conf.readOnly)
if err != nil {
log.Err("Libfuse::Configure : config error [unable to obtain read-only]")
return err
}
err = config.UnmarshalKey("allow-other", &conf.allowOther)
if err != nil {
log.Err("Libfuse::Configure : config error [unable to obtain allow-other]")
return err
}
err = config.UnmarshalKey("allow-root", &conf.allowRoot)
if err != nil {
log.Err("Libfuse::Configure : config error [unable to obtain allow-root]")
return err
}
err = config.UnmarshalKey("nonempty", &conf.nonEmptyMount)
if err != nil {
log.Err("Libfuse::Configure : config error [unable to obtain nonempty]")
return err
}
err = lf.Validate(&conf)
if err != nil {
log.Err("Libfuse::Configure : config error [invalid config settings]")
return fmt.Errorf("%s config error %s", lf.Name(), err.Error())
}
// Disable libfuse logs if the mount is not running in foreground.
// Currently as of 01-05-2025, we emit the libfuse logs only to the stdout.
if !common.ForegroundMount {
if lf.traceEnable {
lf.traceEnable = false
}
}
log.Crit("Libfuse::Configure : read-only %t, allow-other %t, allow-root %t, default-perm %d, entry-timeout %d, attr-time %d, negative-timeout %d, ignore-open-flags %t, nonempty %t, direct_io %t, max-fuse-threads %d, fuse-trace %t, extension %s, disable-writeback-cache %t, dirPermission %v, mountPath %v, umask %v",
lf.readOnly, lf.allowOther, lf.allowRoot, lf.filePermission, lf.entryExpiration, lf.attributeExpiration, lf.negativeTimeout, lf.ignoreOpenFlags, lf.nonEmptyMount, lf.directIO, lf.maxFuseThreads, lf.traceEnable, lf.extensionPath, lf.disableWritebackCache, lf.dirPermission, lf.mountPath, lf.umask)
return nil
}