Effect of HOME on libreoffice to convert to pdf as non-root user
Posted
by
user1032531
on Super User
See other posts from Super User
or by user1032531
Published on 2013-08-02T15:36:05Z
Indexed on
2013/08/02
15:42 UTC
Read the original article
Hit count: 523
I installed libreoffice-headless and can convert documents when logged on as root. I then tried doing so as another user, and it didn't show an error, but didn't convert the file. I then found that if I get rid of the HOME=/tmp/ayb
, it works with the other user. Doesn't HOME=/tmp/ayb
just allow files to default to this directory if not specified? (Sorry, I tried to search "Linux HOME", but as you probably expect, received a bunch of non-relevant results). If not, what is the purpose of specifying HOME
? Why does setting HOME
prevent it from converting on non-root users? Note that /tmp and /tmp/ayb or both 0777. Thank you
[root@desktop ~]# yum install libreoffice-headless
[root@desktop ~]# yum install libreoffice-writer
[root@desktop ~]# ls -l
total 48
-rwxrwxrwx. 1 NotionCommotion NotionCommotion 48128 Jul 30 02:38 document_34.doc
[root@desktop ~]# HOME=/tmp/ayb; /usr/bin/libreoffice --headless -convert-to pdf --outdir /tmp/ayb /tmp/ayb/document_34.doc
convert /tmp/ayb/document_34.doc -> /tmp/ayb/document_34.pdf using writer_pdf_Export
[root@desktop ~]# rm d*.pdf
rm: remove regular file `document_34.pdf'? y
[root@desktop ~]# /usr/bin/libreoffice --headless -convert-to pdf --outdir /tmp/ayb /tmp/ayb/document_34.doc
convert /tmp/ayb/document_34.doc -> /tmp/ayb/document_34.pdf using writer_pdf_Export
[root@desktop ~]# rm d*.pdf
rm: remove regular file `document_34.pdf'? y
[root@desktop ~]# su NotionCommotion
sh-4.1$ HOME=/tmp/ayb; /usr/bin/libreoffice --headless -convert-to pdf --outdir /tmp/ayb /tmp/ayb/document_34.doc
sh-4.1$ rm d*.pdf
rm: cannot remove `d*.pdf': No such file or directory
sh-4.1$ /usr/bin/libreoffice --headless -convert-to pdf --outdir /tmp/ayb /tmp/ayb/document_34.doc
sh-4.1$ rm d*.pdf
rm: cannot remove `d*.pdf': No such file or directory
sh-4.1$ exit
exit
[root@desktop ~]# su NotionCommotion
sh-4.1$ /usr/bin/libreoffice --headless -convert-to pdf --outdir /tmp/ayb /tmp/ayb/document_34.doc
convert /tmp/ayb/document_34.doc -> /tmp/ayb/document_34.pdf using writer_pdf_Export
sh-4.1$ rm d*.pdf
sh-4.1$ HOME=/tmp/ayb; /usr/bin/libreoffice --headless -convert-to pdf --outdir /tmp/ayb /tmp/ayb/document_34.doc
sh-4.1$ rm d*.pdf
rm: cannot remove `d*.pdf': No such file or directory
sh-4.1$ /usr/bin/libreoffice --headless -convert-to pdf --outdir /tmp/ayb /tmp/ayb/document_34.doc
sh-4.1$ rm d*.pdf
rm: cannot remove `d*.pdf': No such file or directory
sh-4.1$
© Super User or respective owner