TL;DRWhen a fuse filesystem is mounted via the mount command, the environment variables are not passed to the fuse script. Why?ContextI am trying to mount hdfs (hadoop file system) via fuse.This is easy on the command line:# Short example version:LD_LIBRARY_PATH=blah hadoop-fuse-dfs -onotrash  dfs://ambari:8020 /mnt/hdfsfuse# Actual version with full path for completenessLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/hadoop/yarn/local/filecache/11/mapreduce.tar.gz/hadoop/lib/native /usr/hdp/2.5.0.0-1245/hadoop/bin/hadoop-fuse-dfs -onotrash  dfs://ambari:8020 /mnt/hdfsfuseThis is all and well, but if I put the definition of the FS in /etc/fstab to then use the mount command, I end up with:fuse_dfs: error while loading shared libraries: libjvm.so: cannot open  shared object file: No such file or directoryLooking at the hadoop-fuse-dfs script and adding debug output, I see that LD_LIBRARY_PATH is seen as empty in this script (this is true both if I export LD_LIBRARY_PATH first or if I add it at the start of the command)  Systemhdp 2.5, centos 7QuestionShort of rewriting the mount script to hardcode LD_LIBRARY_PATH, how can I have environment variables in general passed via mount?
LD_LIBRARY_PATH lost when using mount command
centos;mount;environment variables;fuse;hadoop
You can write your own mount fuse helper, which then calls the real fuse script. In the simple case of an fstab entry like:dfs://ambari:8020  /mnt/hdfsfuse  fuse.mydfshelper  flag,flag,...then your script /usr/bin/mydfshelper is called with argsdfs://ambari:8020 /mnt/hdfsfuse -o flag,flag,...So you just need to write a one-line mydfshelper holding something like:#!/bin/bashLD_LIBRARY_PATH=blah hadoop-fuse-dfs -onotrash $@