Compare commits

..

6 Commits

Author SHA1 Message Date
William Hubbs
a9738a8508 release openrc-0.9.3 2011-09-08 15:09:45 -05:00
William Hubbs
5cb985b6cc Credits for previous commit
Reported-By: i.Dark_Templar <dark_templar@hotbox.ru>
X-Gentoo-Bug: 381783
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=381783
2011-09-08 13:28:43 -05:00
Christian Ruppert
e2f1464f47 Use the real/actual path when looking for mounts
/proc/mounts contains real/actual paths so we should do the same in mountinfo.
2011-09-08 19:20:20 +02:00
Christian Ruppert
5df9dc1af5 Remove unused variable 2011-09-08 18:42:05 +02:00
William Hubbs
b42ab3b2f4 Use checkpath to create /run/lock 2011-09-07 15:11:04 -05:00
William Hubbs
5ed4d084d9 Mount /run as early as possible
This commit moves the code that mounts /run to the earliest possible
position in openrc.
2011-09-06 21:00:08 -05:00
5 changed files with 24 additions and 27 deletions

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.9.2
VERSION= 0.9.3
PKG= ${NAME}-${VERSION}

View File

@@ -5,6 +5,24 @@
: ${CONSOLE:=/dev/console}
: ${RC_LIBEXECDIR:=@LIBEXECDIR@}
# Mount tmpfs on /run when directory exists.
# /run is a new directory for storing volatile runtime data.
# Read more about /run at https://lwn.net/Articles/436012
if [ -d /run ]; then
if mountinfo -q /run; then
einfo "/run is already mounted, skipping"
else
ebegin "Mounting /run"
if ! fstabinfo --mount /run; then
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
fi
eend $?
fi
checkpath -d -m 0775 -o root:uucp /run/lock
elif [ -e /run ]; then
einfo "Unable to mount /run since it is not a directory"
fi
if [ -e "$RC_LIBEXECDIR"/console/unicode ]; then
termencoding="%G"
kmode="-u"

View File

@@ -91,30 +91,6 @@ if $mountproc; then
eend $?
fi
# Mount tmpfs on /run when directory exists.
# /run is a new directory for storing volatile runtime data.
# Read more about /run at https://lwn.net/Articles/436012
if [ -d /run ]; then
if mountinfo -q /run; then
einfo "/run is already mounted, skipping"
else
ebegin "Mounting /run"
if ! fstabinfo --mount /run; then
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
fi
eend $?
fi
if [ ! -d /run/lock ]; then
mkdir /run/lock
fi
if [ -d /run/lock ]; then
chown root:uucp /run/lock
chmod 0775 /run/lock
fi
elif [ -e /run ]; then
einfo "Unable to mount /run since it is not a directory"
fi
# Try to mount xenfs as early as possible, otherwise rc_sys() will always
# return RC_SYS_XENU and will think that we are in a domU while it's not.
if grep -Eq "[[:space:]]+xenfs$" /proc/filesystems; then

View File

@@ -387,6 +387,7 @@ mountinfo(int argc, char **argv)
regex_t *skip_point_regex = NULL;
RC_STRINGLIST *nodes;
RC_STRING *s;
char real_path[PATH_MAX + 1];
int opt;
int result;
bool quiet;
@@ -457,7 +458,10 @@ mountinfo(int argc, char **argv)
if (argv[optind][0] != '/')
eerrorx("%s: `%s' is not a mount point",
argv[0], argv[optind]);
rc_stringlist_add(args.mounts, argv[optind++]);
if (realpath(argv[optind++], real_path) == NULL) {
eerrorx("%s: realpath() failed: %s", argv[0], strerror(errno));
}
rc_stringlist_add(args.mounts, real_path);
}
nodes = find_mounts(&args);
rc_stringlist_free(args.mounts);

View File

@@ -1103,7 +1103,6 @@ runscript(int argc, char **argv)
char *save = NULL;
char pidstr[10];
size_t l = 0, ll;
const char *file;
struct stat stbuf;
/* Show help if insufficient args */