server_docs

1. Creating a user account

1.1. Send the following email to the user

Dear {user},

Thank you for your request for an account on the M&S department compute server. In the URL below is the documentation, please read it carefully and then send me an email to request an account (optionally with your desired username).

https://vankesteren.github.io/server_docs/userdocs

Kind regards,

{your name}

1.2. Create the actual account

After receiving the formal request for an account, it is time to create the account. We have some nice user-friendly scripts installed on the system to do this (adm stands for admin):

sudo adm user add <username> <password> <emailaddress>

1.3. Add the user to the teams page

We also have a teams page where we stay in contact, ask questions, and generally keep track of who is doing research with the server. Add the user to the page as well.

1.4. Email the user

Dear {user},

An account has been created for you on the department compute server.

Username: {username} Temporary password: {password}

Please update your password as soon as possible.

If you have any questions, do not hesitate to ask! I have added you to the department computer teams page.

Happy computing!

{your name}

1.5. Add/remove admin rights

If a user should be an admin, run the following

sudo adm user sudo add <username>

Also:

If you want to remove a sudoer, run

sudo adm user sudo remove <username>

Also:

2. Deleting a user account

Deleting a user account happens in two steps. First, we may (optionally) back up the user’s home directory

sudo adm user backup <username>

then you can use scp to download the compressed archive username.tar.gz in the working directory. Then, delete the file because it is probably huge.

Then, we will properly remove the user

sudo adm user remove <username>

This asks for confirmation before doing anything, so don’t worry too much :)

3. Server monitoring

It’s a good idea to regularly check for the usage of the server by different users.

3.1. Process monitoring

Generally, the command htop is used to check for server usage, processes open by different users, and more. From there, stuck processes can be killed.

sudo htop

(there are also alternatives like btop which will display all threads in a big enough terminal window)

3.2. Main storage monitoring

To ensure the /data disk is not filled up, you can check the overall usage and per-user usage using the following commands:

# human-readable free space on the disk
df -h /data

If the disk is full (which happens), you will get errors like

write error: no space left on device

and for the RStudio server, maybe even

Could not connect to the R session on Rstudio server. Error occurred during transmission (6)

You can check per-user disk usage with

# this may take some time
sudo adm disk usage

If any user is using outrageous amounts of data, tell them to download it via the “Backing up your data” section in the user docs and then delete it.

3.3. Temporary folder monitoring

Some packages in R create a lot of data in the /tmp directory. Since this is on the (small) main boot disk, this can crash out RStudio server (“white screen of death”). To check available space, run

sudo df -h /tmp

To check for particularly big Rtmp folders:

sudo du -hs /tmp/Rtmp*

Then delete a folder using

# example
sudo rm -r /tmp/Rtmp7jVKku

(Nuclear option, do not run while users are running stuff):

sudo find /tmp/Rtmp* -maxdepth 0 | xargs sudo rm -r

Known use-cases that have this problem are:

4. Managing RStudio sessions

The commandline application rstudio-server is used to manage sessions on the RStudio server, and to manage the availability of the server itself.

5. Fixing R package installation errors

R packages are built on the machine. This sometimes needs additional system dependencies or libraries. Most of the commonly required ones have been installed already as part of the server setup. However, it might be that a user needs to install a new package which is not yet supported.

If users install packages via pak::pak() as suggested in the user documentation and by each R terminal session (via the /opt/R/4.4.2/lib/R/etc/Rprofile.site file), then they will get nice warnings about which dependencies may need to be installed. The admin can then install things like so:

sudo apt install libharfbuzz-dev

When you do, please update the relevant software installation section in the server setup documentation as well, so if the machine needs to be set up again this error is avoided.

6. Updating R

(docs incomplete)

Don’t forget to update the R version in the userdocs.