* [gentoo-commits] proj/openrc:master commit in: runlevels/, init.d/
@ 2011-11-23 13:36 William Hubbs
0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs @ 2011-11-23 13:36 UTC (permalink / raw
To: gentoo-commits
commit: 17a1529416441391e3b55cd22e5584b530424932
Author: William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 22 14:18:53 2011 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Nov 23 13:26:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=17a15294
Migrate /var/lock and /var/run to /run for linux systems
---
init.d/Makefile | 2 +-
init.d/migrate-run.in | 28 ++++++++++++++++++++++++++++
runlevels/Makefile | 2 +-
3 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/init.d/Makefile b/init.d/Makefile
index 8351f3c..c1eb647 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -22,7 +22,7 @@ SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
NET_LO-Linux= net.lo
SRCS-Linux= 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
+ procfs.in sysfs.in termencoding.in migrate-run.in
NET_LO-NetBSD= net.lo0
# Generic BSD scripts
diff --git a/init.d/migrate-run.in b/init.d/migrate-run.in
new file mode 100644
index 0000000..544acb0
--- /dev/null
+++ b/init.d/migrate-run.in
@@ -0,0 +1,28 @@
+#!@PREFIX@/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Released under the 2-clause BSD license.
+
+description="Migrate /var/run and /var/lock to /run"
+
+depend()
+{
+ before *
+ after localmount
+}
+
+start()
+{
+ return 0
+}
+
+stop()
+{
+ if [ -d /run -a ! -L /var/lock -a ! -L /var/run ]; then
+ ebegin "Migrating /var/lock and /var/run to /run"
+ rm -rf /var/lock /var/run
+ ln -s /var/lock /run/lock
+ ln -s /var/run /run
+ eend 0
+ fi
+ return 0
+}
diff --git a/runlevels/Makefile b/runlevels/Makefile
index c1a9f09..1f599a9 100644
--- a/runlevels/Makefile
+++ b/runlevels/Makefile
@@ -26,7 +26,7 @@ BOOT-FreeBSD= hostid net.lo0 newsyslog savecore syslogd
# FreeBSD specific stuff
BOOT-FreeBSD+= adjkerntz dumpon syscons
-BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding
+BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding migrate-run
SHUTDOWN-Linux= killprocs mount-ro
SYSINIT-Linux= devfs dmesg
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/openrc:master commit in: runlevels/, init.d/
@ 2011-12-04 23:32 William Hubbs
0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs @ 2011-12-04 23:32 UTC (permalink / raw
To: gentoo-commits
commit: 5adb3930c7a875153c0b817b5c21596a3faaac29
Author: William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 30 16:00:44 2011 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sat Dec 3 18:46:52 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5adb3930
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 <robbat2 <AT> 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+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
NET_LO-Linux= net.lo
SRCS-Linux= 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
NET_LO-NetBSD= 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"
}
+migrate_to_run()
+{
+ src="$1"
+ dst="$2"
+ if [ -L $src -a "$(readlink -f $src)" != $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()
local logw=false runw=false extra=
# Ensure that our basic dirs exist
- [ "$RC_UNAME" = Linux ] && extra=/var/lib/misc # Satisfy Linux FHS
- for x in /var/log /var/run /tmp $extra; do
+ if [ "$RC_UNAME" = Linux ]; then
+ # Satisfy Linux FHS
+ extra=/var/lib/misc
+ if [ ! -d /run ]; then
+ extra="/var/run $extra"
+ fi
+ else
+ extra=/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
+ if [ "$RC_UNAME" = 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=
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="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= hostid net.lo0 newsyslog savecore syslogd
# FreeBSD specific stuff
BOOT-FreeBSD+= adjkerntz dumpon syscons
-BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding migrate-run
+BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding
SHUTDOWN-Linux= killprocs mount-ro
SYSINIT-Linux= devfs dmesg
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/openrc:master commit in: runlevels/, init.d/
@ 2012-02-13 14:46 William Hubbs
0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs @ 2012-02-13 14:46 UTC (permalink / raw
To: gentoo-commits
commit: 79d6f109262ac936218332730b231a5b5897d612
Author: William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 18:37:46 2012 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Feb 13 14:35:29 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=79d6f109
Improve swap handling
Modify the swap script so it starts before and stops after localmount.
Also, on linux, this script should skip mounting swap on loopback.
Add a swapfiles script which runs after localmount and is designed to
activate additional swap space which could not be activated before
localmount was run. This includes loopback swap on linux and swapfiles
which are on local file systems that were not mounted when swap was
activated initially.
The start code does reactivate swap that is already active, but this is
not an error condition.
Reported-by: Giampaolo Tomassoni <giampaolo <AT> tomassoni.biz>
X-Gentoo-Bug: 401003
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401003
---
init.d/Makefile | 4 ++--
init.d/swap.in | 11 ++++++++++-
init.d/{swap.in => swapfiles.in} | 18 ++++++++++++++----
runlevels/Makefile | 2 +-
4 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/init.d/Makefile b/init.d/Makefile
index 8351f3c..863864f 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -1,7 +1,7 @@
DIR= ${INITDIR}
SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
- network.in root.in savecache.in staticroute.in swap.in swclock.in \
- sysctl.in urandom.in ${SRCS-${OS}}
+ network.in root.in savecache.in staticroute.in swap.in swapfiles.in \
+ swclock.in sysctl.in urandom.in ${SRCS-${OS}}
BIN= ${OBJS}
INSTALLAFTER= _installafter_net.lo
diff --git a/init.d/swap.in b/init.d/swap.in
index bd20ffe..bdc5dc7 100644
--- a/init.d/swap.in
+++ b/init.d/swap.in
@@ -4,7 +4,7 @@
depend()
{
- need localmount
+ before localmount
keyword -jail -openvz -prefix -vserver -lxc
}
@@ -12,6 +12,15 @@ start()
{
ebegin "Activating swap devices"
case "$RC_UNAME" in
+ Linux)
+ local dev
+ for dev in $(fstabinfo -b -t swap); do
+ case "$dev" in
+ /dev/loop*) ;;
+ *) swapon $dev 2>/dev/null;;
+ esac
+ done
+ ;;
NetBSD|OpenBSD) swapctl -A -t noblk >/dev/null;;
*) swapon -a >/dev/null;;
esac
diff --git a/init.d/swap.in b/init.d/swapfiles.in
similarity index 60%
copy from init.d/swap.in
copy to init.d/swapfiles.in
index bd20ffe..f46f3c8 100644
--- a/init.d/swap.in
+++ b/init.d/swapfiles.in
@@ -10,7 +10,7 @@ depend()
start()
{
- ebegin "Activating swap devices"
+ ebegin "Activating additional swap space"
case "$RC_UNAME" in
NetBSD|OpenBSD) swapctl -A -t noblk >/dev/null;;
*) swapon -a >/dev/null;;
@@ -20,16 +20,26 @@ start()
stop()
{
- ebegin "Deactivating swap devices"
+ ebegin "Deactivating additional swap space"
# Try to unmount all tmpfs filesystems not in use, else a deadlock may
# occur. As $RC_SVCDIR may also be tmpfs we cd to it to lock it
+ # fixme: Do we need this here since we are only unmounting swap files
+ # and loopback swap?
cd "$RC_SVCDIR"
umount -a -t tmpfs 2>/dev/null
case "$RC_UNAME" in
- NetBSD|OpenBSD) swapctl -U -t noblk >/dev/null;;
- *) swapoff -a >/dev/null;;
+ Linux)
+ while read filename type rest; do
+ case "$type" in
+ file) swapoff $filename >/dev/null;;
+ esac
+ case "$filename" in
+ /dev/loop*) swapoff $filename >/dev/null;;
+ esac
+ done < /proc/swaps
+ ;;
esac
eend 0
}
diff --git a/runlevels/Makefile b/runlevels/Makefile
index c1a9f09..1573572 100644
--- a/runlevels/Makefile
+++ b/runlevels/Makefile
@@ -1,5 +1,5 @@
BOOT= bootmisc fsck hostname localmount \
- root swap sysctl urandom ${BOOT-${OS}}
+ root swap swapfiles sysctl urandom ${BOOT-${OS}}
DEFAULT= local netmount
SHUTDOWN= savecache ${SHUTDOWN-${OS}}
SYSINIT= ${SYSINIT-${OS}}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/openrc:master commit in: runlevels/, init.d/
@ 2013-04-08 17:50 William Hubbs
0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs @ 2013-04-08 17:50 UTC (permalink / raw
To: gentoo-commits
commit: 56f1752ce1899c455b9e97ac73da9bd68fbab2b9
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Apr 8 17:46:51 2013 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Apr 8 17:46:51 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=56f1752c
create loopback service
The loopback service handles the basic settings for the loopback
interface, regardless of the network manager you are using.
---
init.d/Makefile | 4 ++--
init.d/loopback.in | 35 +++++++++++++++++++++++++++++++++++
init.d/network.in | 13 ++++---------
runlevels/Makefile | 2 +-
4 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/init.d/Makefile b/init.d/Makefile
index 04e09a7..e7e2d86 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -1,6 +1,6 @@
DIR= ${INITDIR}
-SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
- root.in savecache.in swap.in swapfiles.in \
+SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in loopback.in \
+ netmount.in root.in savecache.in swap.in swapfiles.in \
tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}}
BIN= ${OBJS}
diff --git a/init.d/loopback.in b/init.d/loopback.in
new file mode 100644
index 0000000..e5cc118
--- /dev/null
+++ b/init.d/loopback.in
@@ -0,0 +1,35 @@
+#!@SBINDIR@/runscript
+# Copyright (c) 2013 William Hubbs <w.d.hubbs@gmail.com>
+# Released under the 2-clause BSD license.
+
+description="Configures the loopback interface."
+
+depend()
+{
+ return 0
+}
+
+start()
+{
+ if [ "$RC_UNAME" = Linux ]; then
+ ebegin "Bringing up network interface lo"
+ if type ip > /dev/null 2>&1; then
+ ip addr add 127.0.0.1/8 dev lo brd + scope host
+ ip route add 127.0.0.0/8 dev lo scope host
+ ip link set lo up
+ else
+ ifconfig lo 127.0.0.1 netmask 255.0.0.0
+ route add -net 127.0.0.0 netmask 255.0.0.0 gw 127.0.0.1
+ fi
+ else
+ ebegin "Bringing up network interface lo0"
+ ifconfig lo0 127.0.0.1 netmask 255.0.0.0
+ route -q add -inet 127.0.0.0 -netmask 255.0.0.0 127.0.0.1
+ fi
+ eend $?
+}
+
+stop()
+{
+ return 0
+}
diff --git a/init.d/network.in b/init.d/network.in
index 898b0a8..5a87a84 100644
--- a/init.d/network.in
+++ b/init.d/network.in
@@ -223,15 +223,6 @@ start()
einfo "Starting network"
routeflush
- if [ "$RC_UNAME" = "Linux" ]; then
- ifconfig lo 127.0.0.1 netmask 255.0.0.0 || cr=1
- route add -net 127.0.0.0 netmask 255.0.0.0 \
- gw 127.0.0.1 reject 2>/dev/null
- else
- ifconfig lo0 127.0.0.1 netmask 255.0.0.0 || cr=1
- route -q add -inet 127.0.0.0 -netmask 255.0.0.0 \
- 127.0.0.1 -reject || cr=1
- fi
eindent
for int in $(interfaces); do
local func= cf=
@@ -330,6 +321,10 @@ stop()
routeflush
eindent
for int in $(reverse $(interfaces u)); do
+ case "$int" in
+ lo|lo0) continue ;;
+ *) ;;
+ esac
intv=$(shell_var "$int")
eval downcmd=\$ifdown_$intv
eval cmd=\$ip_$intv
diff --git a/runlevels/Makefile b/runlevels/Makefile
index 7bcf29f..6eb84ca 100644
--- a/runlevels/Makefile
+++ b/runlevels/Makefile
@@ -1,4 +1,4 @@
-BOOT= bootmisc fsck hostname localmount \
+BOOT= bootmisc fsck hostname localmount loopback \
root swap swapfiles sysctl urandom ${BOOT-${OS}}
DEFAULT= local netmount
SHUTDOWN= savecache ${SHUTDOWN-${OS}}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/openrc:master commit in: runlevels/, init.d/
@ 2013-07-25 19:04 William Hubbs
0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs @ 2013-07-25 19:04 UTC (permalink / raw
To: gentoo-commits
commit: 35f2f1ec73aa6754764d573ea3e1cce938b3ee9a
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Jul 25 17:33:03 2013 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 18:53:44 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=35f2f1ec
Introduce the tmpfiles.dev service
This service handles setting up the tmpfiles entries for the /dev
directory for Linux systems which needs to be run in the sysinit
runlevel.
---
init.d/Makefile | 2 +-
init.d/{tmpfiles.setup.in => tmpfiles.dev.in} | 9 ++++++---
init.d/tmpfiles.setup.in | 3 ++-
runlevels/Makefile | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/init.d/Makefile b/init.d/Makefile
index e7e2d86..fc55b3e 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -28,7 +28,7 @@ SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in encswap.in ipfw.in \
NET_LO-Linux= net.lo
SRCS-Linux= 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
+ procfs.in sysfs.in termencoding.in tmpfiles.dev.in
NET_LO-NetBSD= net.lo0
# Generic BSD scripts
diff --git a/init.d/tmpfiles.setup.in b/init.d/tmpfiles.dev.in
similarity index 51%
copy from init.d/tmpfiles.setup.in
copy to init.d/tmpfiles.dev.in
index 81bc369..477fafa 100644
--- a/init.d/tmpfiles.setup.in
+++ b/init.d/tmpfiles.dev.in
@@ -6,13 +6,16 @@ description="set up tmpfiles.d entries"
depend()
{
- need localmount
+ use dev-mount
+ before dev
+ keyword -prefix -vserver
}
start()
{
- ebegin "setting up tmpfiles.d entries"
- @LIBEXECDIR@/sh/tmpfiles.sh --create --remove ${tmpfiles_opts}
+ ebegin "setting up tmpfiles.d entries for /dev"
+ @LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create --remove \
+ ${tmpfiles_opts}
eend $?
return 0
}
diff --git a/init.d/tmpfiles.setup.in b/init.d/tmpfiles.setup.in
index 81bc369..fd9b015 100644
--- a/init.d/tmpfiles.setup.in
+++ b/init.d/tmpfiles.setup.in
@@ -12,7 +12,8 @@ depend()
start()
{
ebegin "setting up tmpfiles.d entries"
- @LIBEXECDIR@/sh/tmpfiles.sh --create --remove ${tmpfiles_opts}
+ @LIBEXECDIR@/sh/tmpfiles.sh --exclude-prefix=/dev --create --remove \
+ ${tmpfiles_opts}
eend $?
return 0
}
diff --git a/runlevels/Makefile b/runlevels/Makefile
index 6eb84ca..f691113 100644
--- a/runlevels/Makefile
+++ b/runlevels/Makefile
@@ -40,7 +40,7 @@ BOOT-FreeBSD+= adjkerntz dumpon syscons
BOOT-Linux+= hwclock keymaps modules mtab procfs termencoding tmpfiles.setup
SHUTDOWN-Linux= killprocs mount-ro
-SYSINIT-Linux= devfs dmesg sysfs
+SYSINIT-Linux= devfs dmesg sysfs tmpfiles.dev
# Generic BSD stuff
BOOT-NetBSD+= hostid newsyslog savecore syslogd
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-25 19:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 13:36 [gentoo-commits] proj/openrc:master commit in: runlevels/, init.d/ William Hubbs
-- strict thread matches above, loose matches on Subject: below --
2011-12-04 23:32 William Hubbs
2012-02-13 14:46 William Hubbs
2013-04-08 17:50 William Hubbs
2013-07-25 19:04 William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox