From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RXLYG-0000eC-6W for garchives@archives.gentoo.org; Sun, 04 Dec 2011 23:32:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9694A21C030; Sun, 4 Dec 2011 23:32:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 54E6121C030 for ; Sun, 4 Dec 2011 23:32:48 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 97D8F1B4007 for ; Sun, 4 Dec 2011 23:32:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D830480042 for ; Sun, 4 Dec 2011 23:32:46 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <5adb3930c7a875153c0b817b5c21596a3faaac29.WilliamH@gentoo> Subject: [gentoo-commits] proj/openrc:master commit in: runlevels/, init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/Makefile init.d/bootmisc.in init.d/migrate-run.in runlevels/Makefile X-VCS-Directories: runlevels/ init.d/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 5adb3930c7a875153c0b817b5c21596a3faaac29 Date: Sun, 4 Dec 2011 23:32:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 391ec2a1-2c76-43df-ac99-c37704a4b006 X-Archives-Hash: 6a2d2301e5b97fa1b452e670facddd18 commit: 5adb3930c7a875153c0b817b5c21596a3faaac29 Author: William Hubbs gentoo org> AuthorDate: Wed Nov 30 16:00:44 2011 +0000 Commit: William Hubbs gentoo org> CommitDate: Sat Dec 3 18:46:52 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3D5adb3930 Integrate migrate-run into bootmisc The migrate-run service was hanging when parallel startup was enabled because of its dependencies. This integrates the logic for this service into bootmisc, which will avoid the issues with parallel startup. I would like to thank Robin H. Johnson gentoo.org> for his input on this patch --- init.d/Makefile | 2 +- init.d/bootmisc.in | 37 +++++++++++++++++++++++++++++++++++-- init.d/migrate-run.in | 37 ------------------------------------- runlevels/Makefile | 2 +- 4 files changed, 37 insertions(+), 41 deletions(-) diff --git a/init.d/Makefile b/init.d/Makefile index c1eb647..8351f3c 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -22,7 +22,7 @@ SRCS-FreeBSD+=3D adjkerntz.in devd.in dumpon.in ipfw.in= mixer.in nscd.in \ NET_LO-Linux=3D net.lo SRCS-Linux=3D devfs.in dmesg.in hwclock.in consolefont.in keymaps.in \ killprocs.in modules.in mount-ro.in mtab.in numlock.in \ - procfs.in sysfs.in termencoding.in migrate-run.in + procfs.in sysfs.in termencoding.in =20 NET_LO-NetBSD=3D net.lo0 # Generic BSD scripts diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index 31fa0c8..96455ad 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -72,6 +72,26 @@ mkutmp() chmod 0664 "$1" } =20 +migrate_to_run() +{ + src=3D"$1" + dst=3D"$2" + if [ -L $src -a "$(readlink -f $src)" !=3D $dst ]; then + ewarn "$src does not point to $dst." + ewarn "Setting $src to point to $dst." + rm $src + elif [ ! -L $src -a -d $src ]; then + ebegin "Migrating $src to $dst" + cp -a $src/* $dst/ + rm -rf $src + eend $? + fi + # If $src doesn't exist at all, just run this + if [ ! -e $src ]; then + ln -s $dst $src + fi +} + start() { # Remove any added console dirs @@ -79,8 +99,16 @@ start() =20 local logw=3Dfalse runw=3Dfalse extra=3D # Ensure that our basic dirs exist - [ "$RC_UNAME" =3D Linux ] && extra=3D/var/lib/misc # Satisfy Linux FHS - for x in /var/log /var/run /tmp $extra; do + if [ "$RC_UNAME" =3D Linux ]; then + # Satisfy Linux FHS + extra=3D/var/lib/misc + if [ ! -d /run ]; then + extra=3D"/var/run $extra" + fi + else + extra=3D/var/run + fi + for x in /var/log /tmp $extra; do if ! [ -d $x ]; then if ! mkdir -p $x; then eend 1 "failed to create needed directory $x" @@ -89,6 +117,11 @@ start() fi done =20 + if [ "$RC_UNAME" =3D Linux -a -d /run ]; then + migrate_to_run /var/lock /run/lock + migrate_to_run /var/run /run + fi + if dir_writable /var/run; then ebegin "Creating user login records" local xtra=3D diff --git a/init.d/migrate-run.in b/init.d/migrate-run.in deleted file mode 100644 index 02a884d..0000000 --- a/init.d/migrate-run.in +++ /dev/null @@ -1,37 +0,0 @@ -#!@PREFIX@/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation -# Released under the 2-clause BSD license. - -description=3D"Migrate /var/run and /var/lock to /run" - -depend() -{ - before * - after localmount -} - -start() -{ - einfo "starting $RC_SVCNAME" - return 0 -} - -stop() -{ - einfo "completing /var/run and /var/lock migration." - if [ -d /run ]; then - if [ ! -L /var/lock ]; then - ebegin "Migrating /var/lock to /run" - rm -rf /var/lock - ln -s /run/lock /var/lock - eend 0 - fi - if [ ! -L /var/run ]; then - ebegin "Migrating /var/run to /run" - rm -rf /var/run - ln -s /run /var/run - eend 0 - fi - fi - return 0 -} diff --git a/runlevels/Makefile b/runlevels/Makefile index 1f599a9..c1a9f09 100644 --- a/runlevels/Makefile +++ b/runlevels/Makefile @@ -26,7 +26,7 @@ BOOT-FreeBSD=3D hostid net.lo0 newsyslog savecore syslo= gd # FreeBSD specific stuff BOOT-FreeBSD+=3D adjkerntz dumpon syscons =20 -BOOT-Linux=3D hwclock keymaps modules mtab net.lo procfs termencoding mi= grate-run +BOOT-Linux=3D hwclock keymaps modules mtab net.lo procfs termencoding SHUTDOWN-Linux=3D killprocs mount-ro SYSINIT-Linux=3D devfs dmesg =20