-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installing TinyTeX globally for all users on Linux server / RStudio Server #415
Comments
Hmmm, the above messages are warnings about not being able to chmod, coming from
That shouldn't be a problem per se, and the copy operation should continue. The warning message is a bit confusing because it lists 420 which is octal 644 which is the expected permission mask. Setting the permissions didnt work probably because the directories dont have the write permission for group users. You could try to give more relaxed permissions to the admin users. |
@norbusan Thanks for your response!
Thanks, that clears things up.
The directories are all group-writable (thanks to The cause of the issue rather seems that the intermediate Directly after the above setup (i.e. before any non-root user performs a # ls -1lhd /opt/tinytex
drwxrwsr-x 8 root staff 4.0K May 10 19:22 /opt/tinytex
# ls -1lh /opt/tinytex
total 172K
drwxrwsr-x 3 root staff 4.0K May 10 03:12 bin
-rwxrwxr-x 1 root root 123K Mar 12 17:33 install-tl
-rw-rw-r-- 1 root staff 2.1K Sep 28 2006 LICENSE.CTAN
-rw-rw-r-- 1 root staff 5.2K Nov 20 2019 LICENSE.TL
-rw-rw-r-- 1 root staff 350 Mar 14 00:11 release-texlive.txt
-rw-rw-r-- 1 root staff 637 May 10 03:12 texmf.cnf
-rw-rw-r-- 1 root staff 728 May 10 03:12 texmfcnf.lua
drwxrwsr-x 2 root staff 4.0K May 10 19:22 texmf-config
drwxrwsr-x 14 root staff 4.0K May 10 19:22 texmf-dist
drwxrwsr-x 10 root staff 4.0K May 10 19:22 texmf-local
drwxrwsr-x 6 root staff 4.0K May 10 19:22 texmf-var
drwxrwsr-x 8 root staff 4.0K May 10 19:22 tlpkg
# ls -1lh /opt/tinytex/tlpkg
total 18M
drwxrwsr-x 2 root staff 4.0K May 10 03:12 backups
drwxrwsr-x 2 root staff 4.0K May 10 03:12 gpg
drwxrwsr-x 5 root staff 4.0K May 10 19:22 installer
drwxrwsr-x 2 root staff 4.0K May 10 03:12 TeXLive
-rw-rw-r-- 1 root staff 845 May 10 03:12 texlive.profile
-rw-rw-r-- 1 root staff 507K May 10 19:22 texlive.tlpdb
-rw-rw-r-- 1 root staff 18M May 10 19:22 texlive.tlpdb.main.257da4516b1137cfe4f33341414fe5c7
drwxrwsr-x 2 root staff 4.0K May 10 19:22 tlpobj
drwxrwsr-x 2 root staff 4.0K May 10 03:12 tlpostcode After a non-root user runs # ls -1lh /opt/tinytex/tlpkg
total 18M
drwxrwsr-x 2 root staff 4.0K May 10 03:12 backups
drwxrwsr-x 2 root staff 4.0K May 10 03:12 gpg
drwxrwsr-x 5 root staff 4.0K May 10 19:22 installer
drwxrwsr-x 2 root staff 4.0K May 10 03:12 TeXLive
-rw-rw-r-- 1 root staff 845 May 10 03:12 texlive.profile
-rw-rw-r-- 1 root staff 509K May 11 10:54 texlive.tlpdb
-rw-r--r-- 1 salim staff 18M May 11 10:54 texlive.tlpdb.main.b219efc301f2675f5cd4c9cba8c232f3
drwxrwsr-x 2 root staff 4.0K May 11 10:54 tlpobj
drwxrwsr-x 2 root staff 4.0K May 10 03:12 tlpostcode I.e., the newly created file |
But isn't that then an issue of the umask of the user running it? We (TeX Live) set as default mask 0666/0777 so there is no problem. The restriction is from the umask of the user. You must force the umask of users to allow group writable to make newly created files group writable. |
Thanks again, @norbusan! You were absolutely right about umask. The whole file mode creation mask subject was a big knowledge gap on my part. But I took the time to fill this gap with a bit of reading, and as it turns out, the corresponding Wikipedia article is pretty illuminating (as they often are). I must say the whole concept of umask feels very weird as a security tool (being able to set the masks per path instead of globally for a user would appear way more sensible to me; but I guess that's more in the realm of ACLs?), but I'm getting off the point. On my RStudio Server instance (based on Ubuntu 22.04), the default umask is What still remains is the issue about non-root users running And another (minor) issue still remains: When a non-root user runs
The weird thing is, this message does not appear when the same command is run by the root user (also having Switching the RStudio Server config option |
Well, setting an umask of 002 for all users is somehow dangerous, you don't want all your newly created files to be readable by every other group member in most cases. So yes, this is a case where classical unix permissions are not optimal, and ACLs should be used. I sm not sure you can achieve what you want to achieve solely with classical unix permissions. OTOH, I assume you are running on ext4 or some similar standard linux file system, then you can activate extended attributes and use |
BTW, if you do and succeed, it would be nice if you could document it somewhere so that we can incorporate it in the documentation, or refer to it. Thanks in advance. |
Well, readability isn't restricted with umask 022 (Ubuntu's default), either. The last digit would need to be But I don't think the change to allow giving write permission to groups by lowering the second digit from
I might look into that some other day. Currently I'm fine with the setup. Thanks for the hint, though. 🙂
You mean regarding ACLs? I'll post here if I find the time to experiment with that and achieve better results than with standard permissions. My current RStudio Server config (excl. sensitive stuff) is found in this GitLab repo. The TinyTeX installation stuff is found on lines 52–142 of the Dockerfile if anybody's interested. |
Goal
I want to install TinyTeX system-wide to be used by all users of an RStudio Server instance.
So far
To accomplish that goal, I've ran the following steps on a root terminal session on the RStudio Server:
With the above, non-root users (which are member of group
staff
) can read the shared TinyTeX installation as well as generate the necessary symlinks for the TeX executables viatlmgr path add
ortinytex::tlmgr_path(action = "add")
. Automatically installing additional TeX packages during knitting as well as manual installation viatlmgr install <PKG>
ortinytex::tlmgr_install()
also works for non-root users, but the latter prints some messages about failed permission changes to/opt/tinytex/tlpkg/texlive.tlpdb
likeThe same message is also printed when a non-root user removes a package via
tlmgr remove <PKG>
ortinytex::tlmgr_remove()
(since in both cases thetexlive.tlpdb
gets updated).The message is a bit cryptic to me sincechmod 420
is not what/opt/tinytex/tlpkg/texlive.tlpdb)
should have (and also not what it does have after the root user runs the same commands; instead it becomeschmod 644
).420
is the decimal representation of the octal644
mask, as @norbusan pointed out.The output of
tinytex::tlmgr_conf()
after the above is for any userOutput:
Remaining issues
Removing or installing additional TeX packages via the root account changes permissions of file
/opt/tinytex/tlpkg/texlive.tlpdb
to not be group-writable anymore, rendering it impossible for non-root users to performtlmgr install
ortlmgr remove
anymore. This is annoying but can be fixed by a simplechmod g+w /opt/tinytex/tlpkg/texlive.tlpdb
. The changed group-write permission is retained when that file is updated during installation of additional packages by non-root users (since the subsequent permission modification totexlive.tlpdb
fails in such case, see above) .Running
fmtutil-sys --all
(also viatinytex::tlmgr_update(run_fmtutil = TRUE)
) the first time as non-root user prints the following (error) messages:Subsequent runs don't emit these messages anymore and successfully copy the
.fmt
files (but they becomechmod 644
, i.e. not group-writable). I have no clue what exactly is going on here.Both of these issues seem to lie in the upstream TeX Live perl scripts and not in TinyTeX itself. Any ideas on how to fix them? The issues seem to be somewhat similar to #77 (which has eventually been fixed upstream).
Relevant documentation
By filing an issue to this repo, I promise that
xfun::session_info('tinytex')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/tinytex')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: