Commit be4430c0 authored by Elijah Grubb's avatar Elijah Grubb

Merge branch 'alpine' into 'master'

Alpine Linux runit build implemented

See merge request !1
parents 763c8ead e1dc40aa
# 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"
subpackages=""
source="http://www.emulab.net/downloads/docker/runit-2.1.2.tar.gz
run-service-dir.patch
README.alpine
$pkgname.initd
"
builddir="$srcdir/admin/runit-$pkgver/src"
build() {
cd "$builddir"
echo "building..."
make
echo "done building..."
}
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
}
sha512sums="a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf runit-2.1.2.tar.gz
7107da162f7c13e1483f17bf04a844c23a8d1b81ef982c3d956a4c0e23b2a20e415850f0b95999b1eb1e04638284884948937377756ca080037bd6455e3301e8 run-service-dir.patch
88d1efcf366add7803ed026ec8e693b271c842d4e3d5a52587b7ead96266ee27b4ceb1b2696551243f0d9efa93199a07231d2b37186ce1535e9a6b9d90192909 README.alpine
a3e82785650dbb0a96454ae29635012022bd3a705318bdb56a4430a2f487f4aa17661fb1a87fce56ca535b6a526a618a7673ad66848d5fffb47f5795cdcbf18b runit.initd"
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.
--- ./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;
#!/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
if [ -x /sbin/socklog ]; then
provide logger
fi
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment