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:
parent
e0449cf17f
commit
67189fa683
@ -18,15 +18,15 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
soffice="/usr/bin/soffice"
|
soffice="/usr/bin/soffice"
|
||||||
|
home_java="/tmp"
|
||||||
|
|
||||||
if [ -f "$1.odt" ]
|
if [ -f "$1.odt" ]
|
||||||
then
|
then
|
||||||
nbprocess=$(pgrep -c soffice)
|
nbprocess=$(pgrep -c soffice)
|
||||||
if [ $nbprocess -ne 1 ] # If there is some soffice process running
|
if [ $nbprocess -ne 1 ] # If there is some soffice process running
|
||||||
then
|
then
|
||||||
cmd="$soffice --invisible --accept=socket,host=127.0.0.1,port=8100;urp; --nofirststartwizard --headless"
|
cmd="$soffice --invisible --accept=socket,host=127.0.0.1,port=8100;urp; --nofirststartwizard --headless -env:UserInstallation=file:///$home_java/"
|
||||||
$cmd &
|
export HOME=$home_java && cd $home_java && $cmd&
|
||||||
retcode=$?
|
retcode=$?
|
||||||
if [ $retcode -ne 0 ]
|
if [ $retcode -ne 0 ]
|
||||||
then
|
then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user