public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2014-08-22 19:21 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2014-08-22 19:21 UTC (permalink / raw
  To: gentoo-commits

commit:     785b61e8725f26b7d7c66b00e6e87597dd7bd735
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Fri Aug 22 17:41:55 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Aug 22 19:19:03 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=785b61e8

cgroups: fix cgroup subsystem mounting

Originally, we aborted all of the cgroup setup if /sys/fs/cgroup/openrc
was already mounted. This  caused an issue in lxc containers, so we
should always allow the subsystems to be mounted.

X-Gentoo-Bug: 520606
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=520606

---
 init.d/sysfs.in | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 2156670..67485c2 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -100,14 +100,15 @@ mount_misc()
 mount_cgroups()
 {
 	mountinfo -q /sys/fs/cgroup || return 0
-	mountinfo -q /sys/fs/cgroup/openrc || return 0
-
-	local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
-	mkdir /sys/fs/cgroup/openrc
-	mount -n -t cgroup \
-		-o none,${sysfs_opts},name=openrc,release_agent="$agent" \
-		openrc /sys/fs/cgroup/openrc
-	echo 1 > /sys/fs/cgroup/openrc/notify_on_release
+
+	if ! mountinfo -q /sys/fs/cgroup/openrc; then
+		local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
+		mkdir /sys/fs/cgroup/openrc
+		mount -n -t cgroup \
+			-o none,${sysfs_opts},name=openrc,release_agent="$agent" \
+			openrc /sys/fs/cgroup/openrc
+		echo 1 > /sys/fs/cgroup/openrc/notify_on_release
+	fi
 
 	yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
 	while read name hier groups enabled rest; do


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2014-10-16 17:41 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2014-10-16 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     61fd8b29961650a0132b9cfece80bdf7d16cd05c
Author:     Joe M <joe9mail <AT> gmail <DOT> com>
AuthorDate: Fri Aug 29 14:10:58 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Oct 13 20:39:56 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=61fd8b29

savecache: check permissions on the correct directory

---
 init.d/savecache.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init.d/savecache.in b/init.d/savecache.in
index 9040732..dde02dd 100644
--- a/init.d/savecache.in
+++ b/init.d/savecache.in
@@ -13,8 +13,8 @@ start()
 			return 1
 		fi
 	fi
-	if ! checkpath -W "$RC_LIBEXECDIR"; then
-		ewarn "WARNING: ${RC_LIBEXECDIR} is not writable!"
+	if ! checkpath -W "$RC_LIBEXECDIR"/cache; then
+		ewarn "WARNING: ${RC_LIBEXECDIR}/cache is not writable!"
 		if ! yesno "${RC_GOINGDOWN}"; then
 			ewarn "Unable to save deptree cache"
 			return 1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2014-10-16 17:41 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2014-10-16 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     e8043fe378a410dfa78b1e14162a94cc859a5f69
Author:     Rick Farina (ZeroChaos) <sidhayn <AT> gmail <DOT> com>
AuthorDate: Mon Oct  6 16:15:44 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Oct 13 20:41:03 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=e8043fe3

localmount: unmount aufs branches

---
 init.d/localmount.in | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/init.d/localmount.in b/init.d/localmount.in
index bf3dd0f..1335aa9 100644
--- a/init.d/localmount.in
+++ b/init.d/localmount.in
@@ -63,6 +63,31 @@ stop()
 
 	. "$RC_LIBEXECDIR"/sh/rc-mount.sh
 
+	if [ "$RC_UNAME" = Linux ] && [ -d /sys/fs/aufs ] ; then
+		#if / is aufs we remount it noxino during shutdown
+		if mountinfo -q -f '^aufs$' / ; then
+			mount -o remount,noxino,rw /
+			sync
+		fi
+
+		local aufs_branch aufs_mount_dir aufs_mount_point aufs_si_dir aufs_si_id
+		for aufs_si_dir in /sys/fs/aufs/*; do
+			aufs_mount_dir=${aufs_si_dir#/sys/fs/aufs/}
+			aufs_si_id="$(printf "%s" $aufs_mount_dir | sed 's/_/=/g')"
+			aufs_mount_point="$(mountinfo -o ${aufs_si_id})"
+			for x in $aufs_si_dir/br[0-9][0-9][0-9]; do
+				aufs_branch=$(sed 's/=.*//g' $x)
+				eindent
+				if ! mount -o "remount,del:$aufs_branch" "$aufs_mount_point" > /dev/null 2>&1; then
+					ewarn "Failed to remove branch $aufs_branch from aufs \
+						$aufs_mount_point"
+				fi
+				eoutdent
+				sync
+			done
+		done
+	fi
+
 	# Umount loop devices
 	einfo "Unmounting loop devices"
 	eindent


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2014-10-20 21:05 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2014-10-20 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     a76e5a827c23616760e8aab8870239b66c9fda59
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Wed Oct  1 22:14:25 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Oct 20 21:03:27 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a76e5a82

add back nfs and nfs4 file systems

Fix gentoo bug #427996 correctly.
We should attempt to mount the file systems, but not try to start the
daemons. The previous fix removed mounting the file systems as well as
starting the daemons.

X-Gentoo-Bug: 508574
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=508574

---
 init.d/netmount.in | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/init.d/netmount.in b/init.d/netmount.in
index 39ab0bc..f6145f0 100644
--- a/init.d/netmount.in
+++ b/init.d/netmount.in
@@ -2,10 +2,7 @@
 # Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
 # Released under the 2-clause BSD license.
 
-description="Mounts network shares, other than NFS, according to /etc/fstab."
-# We skip all NFS shares in this script because they require extra
-# daemons to be running on the client in order to work correctly.
-# It is best to allow nfs-utils to handle all nfs shares.
+description="Mounts network shares according to /etc/fstab."
 
 depend()
 {
@@ -19,11 +16,6 @@ start()
 {
 	local x= fs= rc=
 	for x in $net_fs_list $extra_net_fs_list; do
-		case "$x" in
-			nfs|nfs4)
-			continue
-			;;
-		esac
 		fs="$fs${fs:+,}$x"
 	done
 
@@ -46,14 +38,7 @@ stop()
 	. "$RC_LIBEXECDIR"/sh/rc-mount.sh
 
 	for x in $net_fs_list $extra_net_fs_list; do
-		case "$x" in
-			nfs|nfs4)
-				continue
-				;;
-			*)
-				fs="$fs${fs:+,}$x"
-				;;
-		esac
+		fs="$fs${fs:+,}$x"
 	done
 	if [ -n "$fs" ]; then
 		umount -at $fs || eerror "Failed to simply unmount filesystems"


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2014-11-07 17:34 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2014-11-07 17:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c9f6e2a6c8ca4e258f1b577010586668759b361a
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Nov  6 20:38:17 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Nov  6 20:44:01 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c9f6e2a6

netmount: unmount nfs file systems

---
 init.d/netmount.in | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/init.d/netmount.in b/init.d/netmount.in
index f6145f0..4ea0c4c 100644
--- a/init.d/netmount.in
+++ b/init.d/netmount.in
@@ -47,14 +47,7 @@ stop()
 	eindent
 	fs=
 	for x in $net_fs_list $extra_net_fs_list; do
-		case "$x" in
-			nfs|nfs4)
-				continue
-				;;
-			*)
-				fs="$fs${fs:+|}$x"
-				;;
-		esac
+		fs="$fs${fs:+|}$x"
 	done
 	[ -n "$fs" ] && fs="^($fs)$"
 	do_unmount umount ${fs:+--fstype-regex} $fs --netdev


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2014-11-20 17:08 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2014-11-20 17:08 UTC (permalink / raw
  To: gentoo-commits

commit:     6b85d4288c9409f8870396b8026862463e732bf8
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Nov 20 16:55:53 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Nov 20 17:07:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6b85d428

devfs: optionally add missing symbolic links

If symbolic links for /dev/{fd,stdin,stdout,stderr,core} do not exist
once /dev is mounted, we should create them.

---
 init.d/devfs.in | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/init.d/devfs.in b/init.d/devfs.in
index bcdbdcd..5af68f9 100644
--- a/init.d/devfs.in
+++ b/init.d/devfs.in
@@ -69,7 +69,14 @@ seed_dev()
 	# so udev can add its start-message to dmesg
 	[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
 
-	# Mount required stuff as user may not have then in /etc/fstab
+	# extra symbolic links not provided by default
+	[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
+	[ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
+	[ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
+	[ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
+	[ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
+
+	# Mount required directories as user may not have them in /etc/fstab
 	for x in \
 		"mqueue /dev/mqueue 1777 ,nodev mqueue" \
 		"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2014-11-24  4:03 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2014-11-24  4:03 UTC (permalink / raw
  To: gentoo-commits

commit:     2eb0ea9afbba584fc4c5ee0feefa9ae6a3d3278d
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Sun Nov 23 16:28:21 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 24 03:59:01 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2eb0ea9a

Make sysfs behave like netmount and localmount

sysfs now mounts all related sysfs file systems and returns success,
like netmount and localmount.

Also, we now check to make sure the cgroups are not mounted before we
mount them.

X-Gentoo-Bug: 530138
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=530138

---
 init.d/sysfs.in | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 67485c2..bc0d9d3 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -113,7 +113,8 @@ mount_cgroups()
 	yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
 	while read name hier groups enabled rest; do
 		case "${enabled}" in
-			1)	mkdir /sys/fs/cgroup/${name}
+			1)	mountinfo -q /sys/fs/cgroup/${name} && continue
+				mkdir /sys/fs/cgroup/${name}
 				mount -n -t cgroup -o ${sysfs_opts},${name} \
 					${name} /sys/fs/cgroup/${name}
 				;;
@@ -129,25 +130,13 @@ restorecon_sys()
 		restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
 		eend $?
 	fi
-
-	return 0
 }
 
 start()
 {
-	local retval
 	mount_sys
-	retval=$?
-	if [ $retval -eq 0 ]; then
-		mount_misc
-		retval=$?
-	fi
-	if [ $retval -eq 0 ]; then
-		mount_cgroups
-		retval=$?
-	fi
-
+	mount_misc
+	mount_cgroups
 	restorecon_sys
-
-	return $retval
+	return 0
 }


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2015-01-18 15:43 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2015-01-18 15:43 UTC (permalink / raw
  To: gentoo-commits

commit:     1a2f45a4c540c5ff29b8615e7241c60f36637608
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Sun Jan 18 15:12:58 2015 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sun Jan 18 15:32:49 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=1a2f45a4

tmpfiles.dev: pass --boot to tmpfiles.sh so kmod works properly

---
 init.d/tmpfiles.dev.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init.d/tmpfiles.dev.in b/init.d/tmpfiles.dev.in
index 3566928..c809bf9 100644
--- a/init.d/tmpfiles.dev.in
+++ b/init.d/tmpfiles.dev.in
@@ -14,7 +14,7 @@ depend()
 start()
 {
 	ebegin "setting up tmpfiles.d entries for /dev"
-	@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create ${tmpfiles_opts}
+	@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create --boot ${tmpfiles_opts}
 	eend $?
 	return 0
 }


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2015-02-05  4:12 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2015-02-05  4:12 UTC (permalink / raw
  To: gentoo-commits

commit:     bb4c14999c569781c7289269949b205955f376bb
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Feb  3 16:53:48 2015 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Feb  5 03:59:50 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=bb4c1499

Add nfsclient to netmount use dependencies

X-Gentoo-Bug: 537996
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=537996

---
 init.d/netmount.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init.d/netmount.in b/init.d/netmount.in
index 4ea0c4c..7c1b122 100644
--- a/init.d/netmount.in
+++ b/init.d/netmount.in
@@ -7,7 +7,7 @@ description="Mounts network shares according to /etc/fstab."
 depend()
 {
 	config /etc/fstab
-	use afc-client amd autofs openvpn
+	use afc-client amd nfsclient autofs openvpn
 	use dns
 	keyword -jail -prefix -vserver -lxc
 }


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2015-02-18 18:59 William Hubbs
  0 siblings, 0 replies; 11+ messages in thread
From: William Hubbs @ 2015-02-18 18:59 UTC (permalink / raw
  To: gentoo-commits

commit:     d5dfc6d529115a3216e70491173468e8edfb1d63
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Sun Jan 25 22:23:47 2015 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Feb 18 16:41:27 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d5dfc6d5

local: fix redirections

The local service now redirects stdout and stderr for the scripts it
runs to /dev/null unless it is run in verbose mode.

X-Gentoo-Bug: 537444
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=537444

---
 init.d/local.in | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/init.d/local.in b/init.d/local.in
index 180735d..63f8598 100644
--- a/init.d/local.in
+++ b/init.d/local.in
@@ -14,12 +14,13 @@ start()
 {
 	ebegin "Starting local"
 
-	local file has_errors=0 retval
+	local file has_errors=0 redirect retval
+	yesno $rc_verbose || redirect='> /dev/null 2>&1'
 	eindent
 	for file in @SYSCONFDIR@/local.d/*.start; do
 		if [ -x "${file}" ]; then
 			vebegin "Executing \"${file}\""
-			"${file}" 2>&1 >/dev/null
+			"${file}" $redirect
 			retval=$?
 			if [ ${retval} -ne 0 ]; then
 				has_errors=1
@@ -52,12 +53,13 @@ stop()
 {
 	ebegin "Stopping local"
 
-	local file has_errors=0 retval
+	local file has_errors=0 redirect retval
+	yesno $rc_verbose || redirect='> /dev/null 2>&1'
 	eindent
 	for file in @SYSCONFDIR@/local.d/*.stop; do
 		if [ -x "${file}" ]; then
 			vebegin "Executing \"${file}\""
-			"${file}" 2>&1 >/dev/null
+			"${file}" $redirect
 			retval=$?
 			if [ ${retval} -ne 0 ]; then
 				has_errors=1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
@ 2015-02-27  2:33 Robin H. Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Robin H. Johnson @ 2015-02-27  2:33 UTC (permalink / raw
  To: gentoo-commits

commit:     4d49bd051d64a69ddf647708af4845783c0cd249
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 27 01:58:22 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Feb 27 02:32:25 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=4d49bd05

bootmisc: clean_run safety improvements.

If /tmp or / are read-only, the clean_run function can fail in some very
bad ways.

1. dir=$(mktemp -d) returns an EMPTY string on error.
2. "mount -o bind / $dir", and don't check the result of that,
3. "rm -rf $dir/run/*", which removes the REAL /run contents
4. box gets very weird from this point forward

Signed-Off-By: Robin H. Johnson <robbat2 <AT> gentoo.org>
Signed-Off-By: Chip Parker <infowolfe <AT> gmail.com>
Reported-by: Chip Parker <infowolfe <AT> gmail.com>
Tested-by: Chip Parker <infowolfe <AT> gmail.com>

---
 init.d/bootmisc.in | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in
index 2ec075f..2f3feee 100644
--- a/init.d/bootmisc.in
+++ b/init.d/bootmisc.in
@@ -119,11 +119,36 @@ clean_run()
 {
 	[ "$RC_SYS" = VSERVER -o "$RC_SYS" = LXC ] && return 0
 	local dir
+	# If / is stll read-only due to a problem, this will fail!
+	mountinfo -q --options-regex '^rw(,|$)' /
+	if [ $? -ne 0 ]; then
+		eerror "/ is not writable; unable to clean up underlying /run"
+		return 1
+	fi
+	# Get the mountpoint used by /tmp (it might be /tmp or /)
+	tmpmnt=`/usr/bin/stat -c '%m' /tmp`
+	mountinfo -q --options-regex '^rw(,|$)' $tmpmnt
+	if [ -n "$tmpmnt" -a $? -ne 0 ]; then
+		eerror "/tmp is not writable; unable to clean up underlying /run"
+		return 1
+	fi
+	# Now we know that we can modify /tmp and /
+	# if mktemp -d fails, it returns an EMPTY string
+	# STDERR: mktemp: failed to create directory via template ‘/tmp/tmp.XXXXXXXXXX’: Read-only file system
+	# STDOUT: ''
+	rc=0
 	dir=$(mktemp -d)
-	mount --bind / $dir
-	rm -rf $dir/run/*
-	umount $dir
-	rm -rf $dir
+	if [ -n "$dir" -a -d $dir -a -w $dir ]; then
+		mount --bind / $dir && rm -rf $dir/run/* || rc=1
+		umount $dir
+		rm -rf $dir
+	else
+		rc=1
+	fi
+	if [ $rc -ne 0 ]; then
+		eerror "Could not clean up underlying /run on /"
+		return 1
+	fi
 }
 
 start()


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-27  2:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 17:34 [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/ William Hubbs
  -- strict thread matches above, loose matches on Subject: below --
2015-02-27  2:33 Robin H. Johnson
2015-02-18 18:59 William Hubbs
2015-02-05  4:12 William Hubbs
2015-01-18 15:43 William Hubbs
2014-11-24  4:03 William Hubbs
2014-11-20 17:08 William Hubbs
2014-10-20 21:05 William Hubbs
2014-10-16 17:41 William Hubbs
2014-10-16 17:41 William Hubbs
2014-08-22 19:21 William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox