X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 5790BDC58A4 for ; Wed, 15 Jul 2015 16:53:50 +0000 (UTC) Received: from apollo.thewebhostserver.com (apollomail.thewebhostserver.com [46.23.65.248]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 0B289DC055F for ; Wed, 15 Jul 2015 16:53:49 +0000 (UTC) Received: from [81.4.121.188] (port=51869 helo=localhost.localdomain) by apollo.thewebhostserver.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZFPwI-001m7s-AW; Wed, 15 Jul 2015 17:53:46 +0100 From: Stuart Cardall To: alpine-aports@lists.alpinelinux.org Cc: Stuart Cardall Subject: [alpine-aports] [PATCH 2/3] testing/runit: add init script & README.alpine Date: Wed, 15 Jul 2015 16:53:21 +0000 Message-Id: <1436979202-54739-3-git-send-email-developer@it-offshore.co.uk> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1436979202-54739-1-git-send-email-developer@it-offshore.co.uk> References: <1436979202-54739-1-git-send-email-developer@it-offshore.co.uk> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - apollo.thewebhostserver.com X-AntiAbuse: Original Domain - lists.alpinelinux.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - it-offshore.co.uk X-Get-Message-Sender-Via: apollo.thewebhostserver.com: authenticated_id: developer@it-offshore.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: this makes runit a bit simpler to use. It is great in LXC. --- testing/runit/APKBUILD | 22 ++++++++++++++++++---- testing/runit/README.alpine | 39 +++++++++++++++++++++++++++++++++++++++ testing/runit/runit.initd | 12 ++++++++++++ 3 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 testing/runit/README.alpine create mode 100644 testing/runit/runit.initd diff --git a/testing/runit/APKBUILD b/testing/runit/APKBUILD index 5872b0d..c484d6e 100644 --- a/testing/runit/APKBUILD +++ b/testing/runit/APKBUILD @@ -1,5 +1,5 @@ # Contributor: Natanael Copa -# Maintainer: +# Maintainer: Stuart Cardall pkgname=runit pkgver=2.1.2 pkgrel=0 @@ -14,6 +14,8 @@ 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 @@ -42,11 +44,23 @@ package() { 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 -dc4e4b469451497e37cb295136a9b23b run-service-dir.patch" +dc4e4b469451497e37cb295136a9b23b run-service-dir.patch +6ad1a147996f44854152dc8e650035ce README.alpine +5399d00c9d611116ae697437dfc48527 runit.initd" sha256sums="6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18 runit-2.1.2.tar.gz -4f4df10f35cd103d7cab27d34f4586f2099b4c5a4e007bdc8299196434744c77 run-service-dir.patch" +4f4df10f35cd103d7cab27d34f4586f2099b4c5a4e007bdc8299196434744c77 run-service-dir.patch +1869a548fda50efeebad59d7178fe6b4fafca8b16067213c258e7e1e21d56e3e README.alpine +5b1c05d674fbe863800c1d4ef03aaaa6b466d02297801ef759b126911c50f3a4 runit.initd" sha512sums="a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf runit-2.1.2.tar.gz -195102ea27119700d13279a4265e730ea4d682293b52b5a036481057100de9e7865f77f96d027f4d8e774901beaa7f1f3818e17451d359d1be31cc3759db9646 run-service-dir.patch" +195102ea27119700d13279a4265e730ea4d682293b52b5a036481057100de9e7865f77f96d027f4d8e774901beaa7f1f3818e17451d359d1be31cc3759db9646 run-service-dir.patch +f6a5ffa9ea9c0e6c76afd92412b5a14ad76695855808274b21c1c0009248019b77b780b4d3d0040c8c3cc4529fc58cdfebec6ea46a9c98ce40df6b4be9ea53bb README.alpine +6f2f2c861f931ce95de791c138e854f7e5ea22c67c81b9ddb146aec07caecdc4ea366075a5ad18372947c58b290fa5186f35345ec6c1451a4d702dd695da1251 runit.initd" diff --git a/testing/runit/README.alpine b/testing/runit/README.alpine new file mode 100644 index 0000000..fe9141c --- /dev/null +++ b/testing/runit/README.alpine @@ -0,0 +1,39 @@ +For service supervision with runit: + +(1) add scripts into /etc/sv//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/tinyssh/run | +--------------------------------------------------------------------------------- +#!/bin/sh +PORT=22 +mkdir -p /etc/tinyssh +/usr/sbin/tinysshd-makekey /etc/tinyssh/keys 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//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/testing/runit/runit.initd b/testing/runit/runit.initd new file mode 100644 index 0000000..59fd4a4 --- /dev/null +++ b/testing/runit/runit.initd @@ -0,0 +1,12 @@ +#!/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 +} -- 2.4.5 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---