[AUR] Docker spec for running Rserve in a sandbox
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.4 KiB

post_install() {
# Add rserve user and group.
getent group rserve 1>/dev/null 2>/dev/null \
|| groupadd -g 32749 -r rserve >/dev/null
getent passwd rserve 1>/dev/null 2>/dev/null \
|| useradd -u 32749 -m -d /home/rserve \
-s /bin/false -r -g rserve rserve >/dev/null
# Exec the chmod just like in the Makefile.
chmod 750 /home/rserve
# Add rsd user and group.
getent group rsd 1>/dev/null 2>/dev/null || groupadd -r rsd >/dev/null
getent passwd rsd 1>/dev/null 2>/dev/null || useradd -s /bin/false \
-r -g rsd rsd >/dev/null
# This is explained in the Arch Wiki. It seems that anyone belonging to the
# docker group has root capablities, so creating a separate user to run
# Docker is necessary in my opinion.
gpasswd -a rsd docker >/dev/null
chown -R rsd:rsd /usr/share/rserve-sandbox-docker
printf "\n\n%s\n\n" "To initialize and download all the necessary \
components you must run: \
sudo -u rsd rserve-sandbox-docker -i"
printf "%s\n\n" "You can then start and enable \
rserve-sandbox-docker.service to run the server."
}
post_remove() {
printf "\n\n%s\n" "To remove images and containters: \
rm -rf /var/lib/docker \
as described in \
<https://docs.docker.com/engine/installation/linux/archlinux/#/uninstallation>"
printf "%s\n\n" "You can also remove /home/rserve \
as well as rserve and rsd users and groups."
}