summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-process/runit
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-process/runit')
-rw-r--r--sys-process/runit/Manifest2
-rwxr-xr-xsys-process/runit/files/110
-rwxr-xr-xsys-process/runit/files/26
-rw-r--r--sys-process/runit/files/2-2.1.26
-rwxr-xr-xsys-process/runit/files/314
-rw-r--r--sys-process/runit/files/3-2.1.214
-rwxr-xr-xsys-process/runit/files/ctrlaltdel9
-rwxr-xr-xsys-process/runit/files/finish.getty2
-rwxr-xr-xsys-process/runit/files/run.getty2
-rw-r--r--sys-process/runit/files/run.getty-2.1.22
-rw-r--r--sys-process/runit/metadata.xml10
-rw-r--r--sys-process/runit/runit-2.1.1-r1.ebuild73
-rw-r--r--sys-process/runit/runit-2.1.2.ebuild146
13 files changed, 296 insertions, 0 deletions
diff --git a/sys-process/runit/Manifest b/sys-process/runit/Manifest
new file mode 100644
index 000000000000..832e9b72b0b5
--- /dev/null
+++ b/sys-process/runit/Manifest
@@ -0,0 +1,2 @@
+DIST runit-2.1.1.tar.gz 109661 SHA256 ffcf2d27b32f59ac14f2d4b0772a3eb80d9342685a2042b7fbbc472c07cf2a2c SHA512 a927a757386653fdc40437884e3dc2d1dda6aaf5f1919f301fcf604e559836bd44e5fcb296d69e7f4260fd881475124c44996530de4948d35d8a102b206ca470 WHIRLPOOL ff378ace3c4e0829a435eec8a9e40da7df6e0e0b00ad8c821a169d2e88a38aee4608147316eec1cfc2e676780fefb4bab81e56e3fe7be80bbb6bd08656373208
+DIST runit-2.1.2.tar.gz 110916 SHA256 6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18 SHA512 a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf WHIRLPOOL c70ecafcdd874b08e6bd47a904903eae03884b71eca30306c6eb512fc72ee8c93a5b0badc4a954e248421157e07bf0620789a810901365c2eeac38107cd62747
diff --git a/sys-process/runit/files/1 b/sys-process/runit/files/1
new file mode 100755
index 000000000000..d6a5b4f64eeb
--- /dev/null
+++ b/sys-process/runit/files/1
@@ -0,0 +1,10 @@
+#!/bin/sh
+# system one time tasks
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+RUNLEVEL=S /sbin/rc sysinit
+RUNLEVEL=S /sbin/rc boot
+
+touch /etc/runit/stopit
+chmod 0 /etc/runit/stopit
diff --git a/sys-process/runit/files/2 b/sys-process/runit/files/2
new file mode 100755
index 000000000000..233ad006aac3
--- /dev/null
+++ b/sys-process/runit/files/2
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
+
+exec env - PATH=$PATH \
+runsvdir /var/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
diff --git a/sys-process/runit/files/2-2.1.2 b/sys-process/runit/files/2-2.1.2
new file mode 100644
index 000000000000..5d503709e220
--- /dev/null
+++ b/sys-process/runit/files/2-2.1.2
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
+
+exec env - PATH=$PATH \
+runsvdir /etc/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
diff --git a/sys-process/runit/files/3 b/sys-process/runit/files/3
new file mode 100755
index 000000000000..f143f5f46011
--- /dev/null
+++ b/sys-process/runit/files/3
@@ -0,0 +1,14 @@
+#!/bin/sh
+exec >/dev/console 2>&1
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+echo 'Waiting for getties to stop...'
+sv shutdown -w 10 /var/service/getty-*
+
+echo 'Waiting for services to stop...'
+sv shutdown -w 300 /var/service/*
+
+echo 'Shutdown...'
+test -x /etc/runit/reboot && LAST=6 || LAST=0
+test -x /etc/runit/reboot && RC=reboot || RC=shutdown
+RUNLEVEL=$LAST /sbin/rc $RC
diff --git a/sys-process/runit/files/3-2.1.2 b/sys-process/runit/files/3-2.1.2
new file mode 100644
index 000000000000..3dd5a486c19d
--- /dev/null
+++ b/sys-process/runit/files/3-2.1.2
@@ -0,0 +1,14 @@
+#!/bin/sh
+exec >/dev/console 2>&1
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+echo 'Waiting for getties to stop...'
+sv -w 10 force-shutdown /etc/service/getty-*
+
+echo 'Waiting for services to stop...'
+sv -w 300 force-shutdown /etc/service/*
+
+echo 'Shutdown...'
+test -x /etc/runit/reboot && LAST=6 || LAST=0
+test -x /etc/runit/reboot && RC=reboot || RC=shutdown
+RUNLEVEL=$LAST /sbin/rc $RC
diff --git a/sys-process/runit/files/ctrlaltdel b/sys-process/runit/files/ctrlaltdel
new file mode 100755
index 000000000000..668445738dfc
--- /dev/null
+++ b/sys-process/runit/files/ctrlaltdel
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin
+MSG="System is going down in 14 seconds..."
+
+# echo 'disabled.' ; exit
+touch /etc/runit/stopit
+chmod 100 /etc/runit/stopit && echo "$MSG" | wall
+/bin/sleep 14
diff --git a/sys-process/runit/files/finish.getty b/sys-process/runit/files/finish.getty
new file mode 100755
index 000000000000..c3d440a85e38
--- /dev/null
+++ b/sys-process/runit/files/finish.getty
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec utmpset -w TTY
diff --git a/sys-process/runit/files/run.getty b/sys-process/runit/files/run.getty
new file mode 100755
index 000000000000..ab6f9543fe97
--- /dev/null
+++ b/sys-process/runit/files/run.getty
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /sbin/agetty 38400 TTY linux
diff --git a/sys-process/runit/files/run.getty-2.1.2 b/sys-process/runit/files/run.getty-2.1.2
new file mode 100644
index 000000000000..33b2e7853275
--- /dev/null
+++ b/sys-process/runit/files/run.getty-2.1.2
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/chpst -P /sbin/agetty 38400 TTY linux
diff --git a/sys-process/runit/metadata.xml b/sys-process/runit/metadata.xml
new file mode 100644
index 000000000000..9f0135754bf7
--- /dev/null
+++ b/sys-process/runit/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>
+williamh@gentoo.org
+</email>
+</maintainer>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-process/runit/runit-2.1.1-r1.ebuild b/sys-process/runit/runit-2.1.1-r1.ebuild
new file mode 100644
index 000000000000..6e556c4703e0
--- /dev/null
+++ b/sys-process/runit/runit-2.1.1-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="A UNIX init scheme with service supervision"
+HOMEPAGE="http://smarden.org/runit/"
+SRC_URI="http://smarden.org/runit/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="static"
+
+S=${WORKDIR}/admin/${P}/src
+
+src_prepare() {
+ # we either build everything or nothing static
+ sed -i -e 's:-static: :' Makefile
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+}
+
+src_install() {
+ dodir /var
+ keepdir /etc/runit{,/runsvdir{,/default,/all}}
+ dosym default /etc/runit/runsvdir/current
+ dosym ../etc/runit/runsvdir/current /var/service
+ dosym ../etc/runit/2 /sbin/runsvdir-start
+
+ dobin $(<../package/commands) || die "dobin"
+ dodir /sbin
+ mv "${ED}"/usr/bin/{runit-init,runit,utmpset} "${ED}"/sbin/ || die "dosbin"
+
+ cd "${S}"/..
+ dodoc package/{CHANGES,README,THANKS,TODO}
+ dohtml doc/*.html
+ doman man/*.[18]
+
+ exeinto /etc/runit
+ doexe "${FILESDIR}"/{1,2,3,ctrlaltdel} || die
+ for tty in tty1 tty2 tty3 tty4 tty5 tty6; do
+ exeinto /etc/runit/runsvdir/all/getty-$tty/
+ for script in run finish; do
+ newexe "${FILESDIR}"/$script.getty $script
+ dosed "s:TTY:${tty}:g" /etc/runit/runsvdir/all/getty-$tty/$script
+ done
+ dosym ../all/getty-$tty /etc/runit/runsvdir/default/getty-$tty
+ done
+
+ # make sv command work
+ cd "${S}"
+ insinto /etc/env.d
+ cat <<-EOF > env.d
+ #/etc/env.d/20runit
+ SVDIR="/var/service/"
+ EOF
+ newins env.d 20runit
+}
+
+pkg_postinst() {
+ ewarn "/etc/profile was updated. Please run:"
+ ewarn "source /etc/profile"
+ ewarn "to make 'sv' work correctly on your currently open shells"
+}
diff --git a/sys-process/runit/runit-2.1.2.ebuild b/sys-process/runit/runit-2.1.2.ebuild
new file mode 100644
index 000000000000..6e28dc4ae098
--- /dev/null
+++ b/sys-process/runit/runit-2.1.2.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic versionator
+
+DESCRIPTION="A UNIX init scheme with service supervision"
+HOMEPAGE="http://smarden.org/runit/"
+SRC_URI="http://smarden.org/runit/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="static"
+
+S=${WORKDIR}/admin/${P}/src
+
+src_prepare() {
+ # we either build everything or nothing static
+ sed -i -e 's:-static: :' Makefile
+
+ # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726008
+ [[ ${COMPILER} == "diet" ]] &&
+ use ppc &&
+ filter-flags "-mpowerpc-gpopt"
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+}
+
+src_install() {
+ into /
+ dobin $(<../package/commands)
+ dodir /sbin
+ mv "${ED}"/bin/{runit-init,runit,utmpset} "${ED}"/sbin/ || die "dosbin"
+ dosym ../etc/runit/2 /sbin/runsvdir-start
+ into /usr
+
+ cd ..
+ dodoc package/{CHANGES,README,THANKS,TODO}
+ dohtml doc/*.html
+ doman man/*.[18]
+
+dodir /etc/runit
+ exeinto /etc/runit
+ doexe "${FILESDIR}"/{1,ctrlaltdel}
+ newexe "${FILESDIR}"/2-${PV} 2
+ newexe "${FILESDIR}"/3-${PV} 3
+
+ dodir /etc/sv
+ for tty in tty1 tty2 tty3 tty4 tty5 tty6; do
+ exeinto /etc/sv/getty-$tty/
+ newexe "${FILESDIR}"/finish.getty finish
+ newexe "${FILESDIR}"/run.getty-${PV} run
+ for script in finish run; do
+ sed -i -e "s:TTY:${tty}:g" "${ED}"/etc/sv/getty-$tty/$script
+ done
+ done
+
+ # make sv command work
+ cat <<-EOF > "${T}"/env.d
+ #/etc/env.d/20runit
+ SVDIR="/etc/service/"
+ EOF
+ insinto /etc/env.d
+ newins "${T}"/env.d 20runit
+}
+
+pkg_preinst() {
+ if has_version 'sys-process/runit' &&
+ has_version '<sys-process/runit-2.1.2' &&
+ [ -d "${EROOT}"etc/runit/runsvdir/all ]; then
+ if [ -e "${EROOT}"etc/sv ]; then
+ mv -f "${EROOT}"etc/sv "${EROOT}"etc/sv.bak || die
+ ewarn "${EROOT}etc/sv was moved to ${EROOT}etc/sv.bak"
+ fi
+ mv "${EROOT}"etc/runit/runsvdir/all "${EROOT}"etc/sv|| die
+ ln -sf "${EROOT}"etc/sv "${EROOT}"etc/runit/runsvdir/all || die
+ cp -a "${EROOT}"etc/runit/runsvdir "${T}" || die
+ touch "${T}"/make_var_service || die
+ fi
+}
+
+default_config() {
+ local sv="${EROOT}"etc/sv
+ local service="${EROOT}"etc/service
+ mkdir -p "${service}" || die
+ for x in tty1 tty2 tty3 tty4 tty5 tty6; do
+ ln -sf "${sv}"/getty-$x "${service}"/getty-$x || die
+ done
+ einfo "The links to services runit will supervise are installed"
+ einfo "in $service."
+ einfo "If you need multiple runlevels, please see the documentation"
+ einfo "for how to set them up."
+ einfo
+}
+
+migrate_from_211() {
+ # Create /etc/service and /var/service if requested
+ if [ -e "${T}"/make_var_service ]; then
+ ln -sf "${EROOT}"etc/runit/runsvdir/current "${EROOT}"etc/service || die
+ ln -sf "${EROOT}"etc/runit/runsvdir/current "${EROOT}"var/service || die
+ fi
+ if [ -d "${T}"/runsvdir ]; then
+ cp -a "${T}"/runsvdir "${EROOT}"etc/runit || die
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ if [ -z "$REPLACING_VERSIONS" ]; then
+ default_config
+ elif [ ! version_is_at_least 2.1.2 $REPLACING_VERSIONS ]; then
+ migrate_from_211
+ fi
+
+ ewarn "To make sure sv works correctly in your currently open"
+ ewarn "shells, please run the following command:"
+ ewarn
+ ewarn "source /etc/profile"
+ ewarn
+
+ if [ -L "${EROOT}"var/service ]; then
+ ewarn "Once this version of runit is active, please remove the"
+ ewarn "compatibility symbolic link at ${EROOT}var/service"
+ ewarn "The correct path now is ${EROOT}etc/service"
+ ewarn
+ fi
+
+ if [ -L "${EROOT}"etc/runit/runsvdir/all ]; then
+ ewarn "${EROOT}etc/runit/runsvdir/all has moved to"
+ iewarn "${EROOT}etc/sv."
+ ewarn "Any symbolic links under ${EROOT}etc/runit/runsvdir"
+ ewarn "which point to services through ../all should be updated to"
+ ewarn "point to them through ${EROOT}etc/sv."
+ ewarn "Once that is done, ${EROOT}etc/runit/runsvdir/all should be"
+ ewarn "removed."
+ ewarn
+ fi
+}