Commit Graph

23 Commits

Author SHA1 Message Date
William Hubbs
a5b4fab732 fix handling of /run for vserver
Mount can't be used in vservers, but /run is still needed. So we create
the directory and clear it out instead of mounting a tmpfs in that
situation.

reported-by: <patrick@gentoo.org>
X-Gentoo-Bug: 423739
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=423739
2012-07-02 13:22:04 -05:00
William Hubbs
82d3918d7a move rc_svcdir to /run/openrc on Linux systems
If you are not using linux, this should not affect you.

If you are using linux, from this point forward, openrc requires the
/run directory to be a mounted tmpfs. If it is, you can run
@LIBEXECDIR@/sh/migrate-to-run.sh as root to migrate your dependency
tree and state information to the new location. If it is not, you must
create the /run directory as root with permissions 755 then reboot your
system.

reported-by: Maxim Kammerer <mk@dee.su>
X-Gentoo-Bug: 401059
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401059
2012-05-14 13:49:06 -05:00
William Hubbs
9e196a71ad clarify the message about /proc being already mounted
This message was being taken by some users as an error, so I have
removed the part about "skipping..." Hopefully this will make the
message less alarming.
2012-05-02 14:48:52 -05:00
Christian Ruppert
e14e78db16 Revert "Mount /run as early as possible"
This reverts commit 5ed4d084d9.
/run needs to be mounted after /proc.
2011-09-12 22:15:24 -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
Mike Frysinger
d0bc4f20ad drop useless "All rights reserved" notice
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-29 19:46:31 -04:00
Mike Frysinger
3d56124ed1 only warn about /run if it exists
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-16 18:49:21 -04:00
William Hubbs
b6409feaac fix permissions for /run/lock
If /run/lock is a directory, set the ownership and permissions for it,
whether or not we created the directory.
2011-04-19 10:56:14 -05:00
Amadeusz Żołnowski
64ef51ab09 Add support for /run directory
This is a new directory for storing volatile runtime data.
See https://lwn.net/Articles/436012

X-Gentoo-Bug: 363971
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=363971
2011-04-18 15:26:13 -05:00
William Hubbs
1d63e85794 rework test for mounted /proc
The previous test assumed that we could always rely on the minor fault
counter to change between reads of /proc/self/stat, but we found that
this is not the case.

The new test compares two reads of /proc/self/environ for which we have
set the same environment variable to two different values.
If the comparison shows the two reads have the same contents, we know
that /proc is not working.

I would like to thank Robin Johnson and Mike Frysinger for their input
for this patch.

X-Gentoo-Bug: 348416
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=348416
2011-03-24 19:14:16 -05:00
Robin H. Johnson
80853f5dbc sh/init: Detect a mounted /proc without sleeping
Previously we checked if /proc was alive by reading /proc/uptime twice
with a 1 second sleep between calls, so that it had time to update.
This got a complaint of an entire 1 second delay, so we improve the
check to be much faster without sleep. We cannot continue to use
/proc/uptime as it only has a 10ms resolution.

X-Gentoo-Bug: 348416
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=348416
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-18 01:29:09 +00:00
Mike Frysinger
faa2df1159 more whitespace cleanup
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-17 04:49:12 -05:00
Robin Johnson
80d5f7d27b fix selinux context for rc-svcdir (bug #347503) 2010-12-03 23:49:34 -06:00
Juan RP
59b08643f1 Mount xenfs early so OpenRC can detect it. 2010-02-26 09:34:43 +00:00
Roy Marples
ec38bbbdda If mounting tmpfs fails, try ramfs.
This is because buggy kernels always report tmpfs even when not present.
2009-11-20 00:04:32 +00:00
Roy Marples
c0fd1b49e4 Move non compiled libraries from /lib/rc to /libexec/rc
OpenRC version is now stored as plaintext in /libexec/rc/version

Plugins (cursplash, splashutils) will have to be re-compiled to pickup
the new directories. State data needs to be moved from /lib/rc/init.d
to /libexec/rc/init.d as well.
2009-05-23 20:38:12 +01:00
Roy Marples
658a220638 Add (c) to Copyright 2009-05-01 15:11:40 +01:00
Roy Marples
2b866f264f Stop using needless {} in vars 2009-04-26 21:13:26 +00:00
Roy Marples
0af7d5bc20 Add a new shutdown runlevel, Gentoo #224537.
Split halt.sh into halt, killprocs, romount and savecache services.
The reboot runlevel is removed but mapped to shutdown.
The halt script should be moved to the sysvinit package.
2008-11-03 15:31:01 +00:00
Roy Marples
d6da8e8c48 sysinit is now a real runlevel that handles things like udev, dmesg and
mounting various bits in /dev and /sys.
init.sh JUST mounts /lib/rc/init.d (and /proc for Linux systems)
To make development of this easier we now return an empty RC_STRINGLIST
instead of a NULL for empty things.

If you don't have a udev init script installed, don't reboot your box OR
roll back to an older OpenRC version.
2008-10-10 08:37:21 +00:00
Roy Marples
a3c8706618 Allow OpenVZ to mount /sys and device managers, #102 2008-08-19 15:27:15 +00:00
Roy Marples
dcdfdb442f Some systems are only detectable after /proc is mounted, so re-test if unknown. 2008-04-06 20:06:07 +00:00
Roy Marples
55858eca2e .sh.BSD.in is a better extension. 2008-03-26 14:02:59 +00:00