Provide a home directory to java/soffice

By default www-data run as system user on /root directory, to prevent some error about right user we :
* move first to /tmp directory
* set /tmp as home www-data user

If needed admin sys can update *$home_java* to a valide www-data directory
This commit is contained in:
cam.lafit 2017-03-14 10:17:10 +01:00
parent e0449cf17f
commit 67189fa683

View File

@ -18,15 +18,15 @@ then
fi
soffice="/usr/bin/soffice"
home_java="/tmp"
if [ -f "$1.odt" ]
then
nbprocess=$(pgrep -c soffice)
if [ $nbprocess -ne 1 ] # If there is some soffice process running
then
cmd="$soffice --invisible --accept=socket,host=127.0.0.1,port=8100;urp; --nofirststartwizard --headless"
$cmd &
cmd="$soffice --invisible --accept=socket,host=127.0.0.1,port=8100;urp; --nofirststartwizard --headless -env:UserInstallation=file:///$home_java/"
export HOME=$home_java && cd $home_java && $cmd&
retcode=$?
if [ $retcode -ne 0 ]
then