summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrnmst/Franco Masotti2016-10-20 17:23:32 +0200
committerfrnmst/Franco Masotti2016-10-20 17:23:32 +0200
commitc1f5eeff9008cc40755decb5be9459354a8c6476 (patch)
tree681ef00b6c3b431aaec3d1228008988f0d56ea78
parent343add4746671ace27c6cd1f6637ed37c03d75c7 (diff)
downloadaur-c1f5eeff9008cc40755decb5be9459354a8c6476.tar.gz
Updated files from the dev branch.
-rw-r--r--.SRCINFO6
-rw-r--r--.install (renamed from .INSTALL)19
-rw-r--r--PKGBUILD31
-rw-r--r--rserve-sandbox-docker.conf25
-rw-r--r--rserve-sandbox-docker.service6
-rwxr-xr-xrun.sh19
6 files changed, 43 insertions, 63 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b8a5704d3cfe..53ce5164fc01 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,16 @@
pkgbase = rserve-sandbox-docker
pkgdesc = Docker spec for running Rserve in a sandbox
pkgver = r23.845f51c
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/frnmst/rserve-sandbox
- install = .INSTALL
+ install = .install
arch = x86_64
license = BSD
makedepends = git
makedepends = sed
depends = r
depends = docker
- source = git://github.com/frnmst/rserve-sandbox#branch=distro-package
+ source = git+https://github.com/frnmst/rserve-sandbox#branch=distro-package
md5sums = SKIP
pkgname = rserve-sandbox-docker
diff --git a/.INSTALL b/.install
index e146f6a99da6..f1eb6745ec43 100644
--- a/.INSTALL
+++ b/.install
@@ -16,20 +16,15 @@ post_install() {
# Docker is necessary in my opinion.
gpasswd -a rsd docker >/dev/null
- chown -R rsd:rsd /opt/rserve-sandbox-docker
+ chown -R rsd:rsd /usr/share/rserve-sandbox-docker
- echo ""
- echo ""
- echo "You can start and enable \
-rserve-sandbox-docker.service to run the server."
- echo ""
- echo ""
+ printf "\n\nYou can start and enable \
+rserve-sandbox-docker.service to run the server.\n\n"
}
pre_remove() {
- echo ""
- echo ""
- echo "UNIMPLEMENTED"
- echo ""
- echo ""
+ # Remove /home/rserve
+ # Remove rserve usr and grp
+ # Remove rsd usr and grp
+ :
}
diff --git a/PKGBUILD b/PKGBUILD
index 9e127cd2e50e..573f9b7b5e50 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: Franco Masotti <franco dot masotti at student dot unife dot it>
pkgname=rserve-sandbox-docker
pkgver=r23.845f51c
-pkgrel=1
+pkgrel=2
pkgdesc="Docker spec for running Rserve in a sandbox"
arch=('x86_64')
url="https://github.com/frnmst/rserve-sandbox"
@@ -11,12 +11,12 @@ depends=('r'
'docker')
makedepends=('git'
'sed')
-install=.INSTALL
-source=('git://github.com/frnmst/rserve-sandbox#branch=distro-package')
+install=.install
+source=('git+https://github.com/frnmst/rserve-sandbox#branch=distro-package')
md5sums=('SKIP')
pkgver () {
- cd ${srcdir}/rserve-sandbox
+ cd "${srcdir}"/rserve-sandbox
( set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
@@ -24,16 +24,15 @@ pkgver () {
}
package() {
- cd ${srcdir}
- install -d ${pkgdir}/opt/${pkgname}
- install -d ${pkgdir}/usr/bin
- install -D -m644 rserve-sandbox/Makefile ${pkgdir}/opt/${pkgname}/Makefile
- install -D -m644 rserve-sandbox/Dockerfile.in ${pkgdir}/opt/${pkgname}/Dockerfile.in
- install -D -m644 rserve-sandbox/Rserv.conf ${pkgdir}/opt/${pkgname}/Rserv.conf
- install -D -m644 rserve-sandbox/Rserv.sh ${pkgdir}/opt/${pkgname}/Rserv.sh
- install -D -m644 rserve-sandbox/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -D -m755 ${startdir}/run.sh ${pkgdir}/opt/${pkgname}/run.sh
- install -D -m644 ${startdir}/${pkgname}.service "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
- install -D -m644 ${startdir}/${pkgname}.conf "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
- ln -s /opt/${pkgname}/run.sh ${pkgdir}/usr/bin/${pkgname}
+ cd "${srcdir}"
+ install -d "${pkgdir}"/usr/share/"${pkgname}"
+ install -d "${pkgdir}"/usr/bin
+ install -D -m644 rserve-sandbox/Makefile "${pkgdir}"/usr/share/"${pkgname}"/Makefile
+ install -D -m644 rserve-sandbox/Dockerfile.in "${pkgdir}"/usr/share/${pkgname}/Dockerfile.in
+ install -D -m644 rserve-sandbox/Rserv.conf "${pkgdir}"/usr/share/${pkgname}/Rserv.conf
+ install -D -m644 rserve-sandbox/Rserv.sh "${pkgdir}"/usr/share/${pkgname}/Rserv.sh
+ install -D -m644 rserve-sandbox/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+ install -D -m755 ../run.sh "${pkgdir}"/usr/share/${pkgname}/run.sh
+ install -D -m644 ../${pkgname}.service "${pkgdir}"/usr/lib/systemd/system/"${pkgname}".service
+ ln -s /usr/share/"${pkgname}"/run.sh "${pkgdir}"/usr/bin/"${pkgname}"
}
diff --git a/rserve-sandbox-docker.conf b/rserve-sandbox-docker.conf
deleted file mode 100644
index 3eb79760cfb2..000000000000
--- a/rserve-sandbox-docker.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# rserve-sandbox-docker.conf
-#
-# Copyright (C) 2016 frnmst (Franco Masotti) <franco.masotti@student.unife.it>
-#
-# This file is part of cplint-installer.
-#
-# cplint-installer is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# cplint-installer is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with cplint-installer. If not, see <http://www.gnu.org/licenses/>.
-#
-#
-
-# To be placed in /usr/lib/tmpfiles.d/rserve-sandbox-docker.conf
-
-f /run/rserve-sandbox-docker.pid 0755 rsd rsd -
diff --git a/rserve-sandbox-docker.service b/rserve-sandbox-docker.service
index 9e5173a756ab..c0c1ae65da36 100644
--- a/rserve-sandbox-docker.service
+++ b/rserve-sandbox-docker.service
@@ -29,15 +29,13 @@ Requires=docker.service
After=docker.service
[Service]
-# Run ExecStartPre with root permissions.
-PermissionsStartOnly=true
-ExecStartPre=/usr/bin/systemd-tmpfiles --create rserve-sandbox-docker.conf
ExecStart=/usr/bin/rserve-sandbox-docker -s
ExecStop=/usr/bin/rserve-sandbox-docker -k
Type=forking
-PIDFile=/run/rserve-sandbox-docker.pid
+PIDFile=/run/rserve-sandbox-docker/rserve-sandbox-docker.pid
User=rsd
Group=rsd
+RuntimeDirectory=rserve-sandbox-docker
[Install]
Also=docker.service
diff --git a/run.sh b/run.sh
index b4e56810b964..f78b479a03e8 100755
--- a/run.sh
+++ b/run.sh
@@ -22,8 +22,8 @@
#
#
-pkg_dir="/opt/rserve-sandbox-docker"
-pid_file="/run/rserve-sandbox-docker.pid"
+pkg_dir="/usr/share/rserve-sandbox-docker"
+pid_file="/run/rserve-sandbox-docker/rserve-sandbox-docker.pid"
user="rsd"
group="rsd"
docker_image_name="rserve"
@@ -75,6 +75,19 @@ initialize()
fi
}
+killd()
+{
+ # kill action only if process exists.
+ if [ -f "$pid_file" ]; then
+ pid=$(cat "$pid_file")
+ ps -q $pid > /dev/null
+ if [ $? -eq 0 ]; then
+ make -C "$pkg_dir" stop
+ fi
+ fi
+}
+
+
startd()
{
local pid=""
@@ -145,7 +158,7 @@ killd()
pid=$(cat "$pid_file")
ps -q $pid > /dev/null
if [ $? -eq 0 ]; then
- kill -s SIGTERM $pid
+ kill -s TERM $pid
fi
fi
}