aboutsummaryrefslogtreecommitdiffstats
path: root/community/runit
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2016-08-18 20:46:53 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-21 22:24:04 +0200
commit5c9f3ca3e307be53b45beeed2ce1626f38008625 (patch)
tree919836fe454e953f46685adf8228b0401280d4b6 /community/runit
parent6a00a953ba02bab6440a2c784e7db37c6eaeace1 (diff)
downloadaports-5c9f3ca3e307be53b45beeed2ce1626f38008625.tar.bz2
aports-5c9f3ca3e307be53b45beeed2ce1626f38008625.tar.xz
testing/[various]: move to community
albatross-themes apk-post-messages autossh bitcoin btrbk entr ffmpegthumbnailer firejail firetools fwsnort gnome-colors imapsync inetutils-syslogd inotify-tools-inc isync junit ktsuss letsencrypt-nosudo libmbim libndp libqmi libteam mini-sendmail modemmanager namecoin networkmanager nginx-naxsi numix-themes nxapi opencl-headers opencl-icd-loader opus-tools perl-authen-ntlm perl-bit-vector perl-data-uniqid perl-file-copy-recursive perl-getopt-argvfile perl-io-tee perl-iptables-chainmgr perl-iptables-parse perl-module-scandeps perl-par-dist perl-par-packer perl-par perl-uri-escape psad py-crcmod py-graphviz py-lz4 py-opencl py-opengl-accelerate runit secpwgen secure-delete socklog spacefm tinyssh udevil virt-viewer virtualbricks whois wrk xpra zram-init
Diffstat (limited to 'community/runit')
-rw-r--r--community/runit/APKBUILD66
-rw-r--r--community/runit/README.alpine56
-rw-r--r--community/runit/run-service-dir.patch11
-rw-r--r--community/runit/runit.initd14
4 files changed, 147 insertions, 0 deletions
diff --git a/community/runit/APKBUILD b/community/runit/APKBUILD
new file mode 100644
index 0000000000..fea0f14f38
--- /dev/null
+++ b/community/runit/APKBUILD
@@ -0,0 +1,66 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
+pkgname=runit
+pkgver=2.1.2
+pkgrel=3
+pkgdesc="UNIX init scheme with service supervision"
+url="http://smarden.org/runit/"
+arch="all"
+license="BSD"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-doc"
+source="http://smarden.org/runit/runit-$pkgver.tar.gz
+ run-service-dir.patch
+ README.alpine
+ $pkgname.initd
+ "
+
+_builddir="$srcdir"/admin/runit-$pkgver/src
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ echo "$CC $CFLAGS" > conf-cc
+ echo "$CC $LDFLAGS" > conf-ld
+}
+
+build() {
+ cd "$_builddir"
+ make
+}
+
+package() {
+ cd "$_builddir"
+ install -d "$pkgdir"/sbin
+ for i in chpst runit runit-init runsv runsvchdir runsvdir sv svlogd utmpset; do
+ install -m755 "$i" "$pkgdir"/sbin/$i || return 1
+ done
+ install -d "$pkgdir"/usr/share/man/man8
+ cd .. && cp -rf man/* "$pkgdir"/usr/share/man/man8/
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/runitd || return 1
+ install -Dm644 "$srcdir"/README.alpine \
+ "$pkgdir"/usr/share/doc/$pkgname/README.alpine || return 1
+ mkdir -p "$pkgdir"/etc/service
+ mkdir -p "$pkgdir"/etc/sv
+}
+
+md5sums="6c985fbfe3a34608eb3c53dc719172c4 runit-2.1.2.tar.gz
+13b3d1e097d58c7fe78c8c2ae9c829ff run-service-dir.patch
+735265c11ac8653fe61615e5756af272 README.alpine
+df31f105e66ee755fd990ba7184884ed runit.initd"
+sha256sums="6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18 runit-2.1.2.tar.gz
+b051476a9cea0673cdd3f849c33555e364540f49436ab7d05f5aeee553d84ab7 run-service-dir.patch
+6a49cdf4c9fd8326d9e3fed3df8ff6fae47f60fd586b56d561e0b2d629ea949a README.alpine
+aed913227ba4035fe0a84423610817f551ea890d5c5d5a64399b504b2d6f7cc1 runit.initd"
+sha512sums="a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf runit-2.1.2.tar.gz
+7107da162f7c13e1483f17bf04a844c23a8d1b81ef982c3d956a4c0e23b2a20e415850f0b95999b1eb1e04638284884948937377756ca080037bd6455e3301e8 run-service-dir.patch
+88d1efcf366add7803ed026ec8e693b271c842d4e3d5a52587b7ead96266ee27b4ceb1b2696551243f0d9efa93199a07231d2b37186ce1535e9a6b9d90192909 README.alpine
+32487bec20e1313eae2e9f315b5b82c67c93c11f15b737f00469006f5fd7f2944ac91887e6ceefa2934fc02f83d4184af9db74acad381a4d9caf952f76621a60 runit.initd"
diff --git a/community/runit/README.alpine b/community/runit/README.alpine
new file mode 100644
index 0000000000..e6b04f03e2
--- /dev/null
+++ b/community/runit/README.alpine
@@ -0,0 +1,56 @@
+For service supervision with runit:
+
+(1) add scripts into /etc/sv/<service>/run
+
+------------------------------
+Example: /etc/sv/nginx/run |
+------------------------------
+#!/bin/sh
+mkdir -p /tmp/nginx
+exec /usr/sbin/nginx
+------------------------------
+Example: /etc/sv/ssh/run |
+------------------------------
+#!/bin/sh
+set -e
+ssh-keygen -A
+exec /usr/sbin/sshd -D
+------------------------------
+Example: /etc/sv/mysqld/run |
+------------------------------
+#!/bin/sh
+libs=/var/lib/mysql
+socket=/run/mysqld
+mkdir -p $socket
+chown mysql:mysql $socket
+chown -R mysql:mysql $libs
+exec chpst -u mysql:mysql mysqld --user=mysql 2>&1
+--------------------------------------------------
+Example: /etc/sv/pgsql/run |
+--------------------------------------------------
+#!/bin/sh
+. /etc/conf.d/postgresql
+chown -R postgres:postgres ${PGDATA}
+exec setuidgid postgres /usr/bin/postgres -D ${PGDATA} -o "$PGOPTS" 2>&1
+---------------------------------------------------------------------------------
+Example: /etc/sv/tinyssh/run |
+---------------------------------------------------------------------------------
+#!/bin/sh
+PORT=22
+mkdir -p /etc/tinyssh
+/usr/sbin/tinysshd-makekey /etc/tinyssh/sshkeys 2>/dev/null
+exec tcpserver -HRDl0 0.0.0.0 $PORT /usr/sbin/tinysshd -v -l /etc/tinyssh/sshkeys
+---------------------------------------------------------------------------------
+
+(2) set permissions:
+
+chmod 700 /etc/sv/<service>/run
+
+(3) symlink the script directory to the service directory:
+
+ln -s /etc/sv/nginx /etc/service/nginx
+
+==========================================================
+
+The socklog package by the same author can provide logging
+with built in log rotation & also be managed by runit.
diff --git a/community/runit/run-service-dir.patch b/community/runit/run-service-dir.patch
new file mode 100644
index 0000000000..eff50b0e0a
--- /dev/null
+++ b/community/runit/run-service-dir.patch
@@ -0,0 +1,11 @@
+--- ./sv.c.orig
++++ ./sv.c
+@@ -32,7 +32,7 @@
+ char *progname;
+ char *action;
+ char *acts;
+-char *varservice ="/service/";
++char *varservice ="/etc/service/";
+ char **service;
+ char **servicex;
+ unsigned int services;
diff --git a/community/runit/runit.initd b/community/runit/runit.initd
new file mode 100644
index 0000000000..2f3a0968dc
--- /dev/null
+++ b/community/runit/runit.initd
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+
+command="/sbin/runsvdir"
+command_args="/etc/service"
+pidfile="/run/${SVCNAME}.pid"
+command_background="true"
+description="starts and monitors a collection of runsv(8) processes"
+retry="SIGHUP/5"
+
+depend() {
+ need localmount
+ after firewall
+}
+