Compare commits
9 Commits
openrc-0.1
...
openrc-0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c4582fbd7 | ||
|
|
ccb068c484 | ||
|
|
603a308c6a | ||
|
|
fba6bbb4b6 | ||
|
|
ded282f163 | ||
|
|
38ae822077 | ||
|
|
611ed42044 | ||
|
|
3f719bbb8b | ||
|
|
e37b84a37d |
@@ -1,3 +1,3 @@
|
||||
NAME= openrc
|
||||
VERSION= 0.11.5
|
||||
VERSION= 0.11.7
|
||||
PKG= ${NAME}-${VERSION}
|
||||
|
||||
@@ -1,20 +1,40 @@
|
||||
# Depending on how mounting your network file systems behaves when your
|
||||
# network interfaces are down, you may need to set the netmount script to
|
||||
# require specific network interfaces to be active. This file gives
|
||||
# examples of how to do this:
|
||||
# You will need to set the dependencies in the netmount script to match
|
||||
# the network configuration tools you are using. This should be done in
|
||||
# this file by following the examples below, and not by changing the
|
||||
# service script itself.
|
||||
#
|
||||
# If you are using newnet and configuring the interface with a static
|
||||
# address with the network script:
|
||||
# rc_need="network"
|
||||
# Each of these examples is meant to be used separately. So, for
|
||||
# example, do not set rc_need to something like "net.eth0 dhcpcd".
|
||||
#
|
||||
# If you are using newnet and configuring your interfaces with static
|
||||
# addresses with the network script, you should use this setting.
|
||||
#
|
||||
#rc_need="network"
|
||||
#
|
||||
# If you are using oldnet, you must list the specific net.* services you
|
||||
# need:
|
||||
# need.
|
||||
#
|
||||
# rc_need="net.eth0"
|
||||
# rc_need="net.eth1 net.eth2"
|
||||
# This example assumes all of your netmounts can be reached on
|
||||
# eth0.
|
||||
#
|
||||
#rc_need="net.eth0"
|
||||
#
|
||||
# This example assumes some of your netmounts are on eth1 and some
|
||||
# are on eth2.
|
||||
#
|
||||
#rc_need="net.eth1 net.eth2"
|
||||
#
|
||||
# If you are using a dynamic network management tool like
|
||||
# networkmanager, dhcpcd, etc, you should list that tool here.
|
||||
# networkmanager, dhcpcd in standalone mode, wicd, badvpn-ncd, etc, to
|
||||
# manage the network interfaces with the routes to your netmounts, you
|
||||
# should list that tool.
|
||||
#
|
||||
# rc_need="networkmanager"
|
||||
# rc_need="dhcpcd"
|
||||
#rc_need="networkmanager"
|
||||
#rc_need="dhcpcd"
|
||||
#rc_need="wicd"
|
||||
#
|
||||
# The default setting is designed to be backward compatible with our
|
||||
# current setup, but you are highly discouraged from using this. In
|
||||
# other words, please change it to be more suited to your system.
|
||||
#
|
||||
rc_need="net"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
rc_tty_number=12
|
||||
|
||||
# If you have cgroups turned on in your kernel, this switch controls
|
||||
# whether or not a group for each controler is mounted under
|
||||
# whether or not a group for each controller is mounted under
|
||||
# /sys/fs/cgroup.
|
||||
# Support for process management by cgroups is planned in the future,
|
||||
# so if you turn this off, be aware that you may not be able to use that
|
||||
|
||||
@@ -22,6 +22,9 @@ start()
|
||||
|
||||
if [ "$RC_UNAME" = Linux ]; then
|
||||
no_netdev="-O no_netdev"
|
||||
if mountinfo -q /usr; then
|
||||
touch $RC_SVCDIR/usr_premounted
|
||||
fi
|
||||
fi
|
||||
ebegin "Mounting local filesystems"
|
||||
mount -at "$types" $no_netdev
|
||||
@@ -48,7 +51,10 @@ stop()
|
||||
done
|
||||
|
||||
if [ "$RC_UNAME" = Linux ]; then
|
||||
no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*|/usr"
|
||||
no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*"
|
||||
if [ -e $rc_svcdir/usr_premounted ]; then
|
||||
no_umounts_r="$no_umounts_r|/usr"
|
||||
fi
|
||||
fi
|
||||
no_umounts_r="^($no_umounts_r)$"
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ if [ ! -d /run ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -L /run/openrc ]; then
|
||||
rm /run/openrc
|
||||
fi
|
||||
|
||||
if [ "$sys" = VSERVER ]; then
|
||||
rm -rf /run/*
|
||||
elif ! mountinfo -q /run; then
|
||||
@@ -84,5 +88,9 @@ if [ -e "$RC_LIBEXECDIR"/cache/deptree ]; then
|
||||
cp -p "$RC_LIBEXECDIR"/cache/* "$RC_SVCDIR" 2>/dev/null
|
||||
fi
|
||||
|
||||
if [ -e "$RC_LIBEXECDIR"/init.d ]; then
|
||||
rm -rf "$RC_LIBEXECDIR"/init.d
|
||||
fi
|
||||
|
||||
echo sysinit >"$RC_SVCDIR"/softlevel
|
||||
exit 0
|
||||
|
||||
@@ -9,41 +9,21 @@ if ! mountinfo -q -f tmpfs "@LIBEXECDIR@/init.d"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d "@PREFIX@/run" ]; then
|
||||
eerror "'@PREFIX@/run' is not a directory."
|
||||
eerror "This means the OpenRC dependency data cannot be migrated."
|
||||
eerror "Please create the '@PREFIX@/run' directory and reboot the system."
|
||||
exit 1
|
||||
if [ ! -d /run ]; then
|
||||
eerror "/run is not a directory."
|
||||
eerror "moving /run to /run.pre-openrc"
|
||||
mv /run /run.pre-openrc
|
||||
mkdir /run
|
||||
fi
|
||||
|
||||
if ! mountinfo -q -f tmpfs "@PREFIX@/run"; then
|
||||
for x in "@PREFIX@/run/."* "@PREFIX@/run/"*; do
|
||||
case "$x" in
|
||||
"@PREFIX@/run/."|"@PREFIX@/run/..")
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
if [ -e "$x" ]; then
|
||||
eerror "Your '@PREFIX@/run' directory contains files."
|
||||
eerror "Please reboot the system."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
rm -rf /run/openrc
|
||||
|
||||
mount -t tmpfs -o mode=0755,nosuid,nodev \
|
||||
tmpfs "@PREFIX@/run" 2> /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
eerror "Unable to mount a tmpfs on '@PREFIX@/run'."
|
||||
eerror "This means the OpenRC dependency data cannot be migrated."
|
||||
eerror "Please create the '@PREFIX@/run' directory and reboot the system."
|
||||
exit 1
|
||||
fi
|
||||
if ! mountinfo -q -f tmpfs /run; then
|
||||
ln -s "@LIBEXECDIR@"/init.d /run/openrc
|
||||
else
|
||||
cp -a "@LIBEXECDIR@/init.d" /run/openrc
|
||||
rc-update -u
|
||||
fi
|
||||
|
||||
rm -rf "@PREFIX@/run/openrc"
|
||||
cp -a "@LIBEXECDIR@/init.d" "@PREFIX@/run/openrc"
|
||||
rc-update -u
|
||||
rm -rf "@LIBEXECDIR@/init.d"
|
||||
umount "@LIBEXECDIR@/init.d"
|
||||
einfo "The OpenRC dependency data was migrated successfully."
|
||||
exit 0
|
||||
|
||||
@@ -40,7 +40,7 @@ __BEGIN_DECLS
|
||||
#if defined(PREFIX)
|
||||
#define RC_SVCDIR RC_LIBEXECDIR "/init.d"
|
||||
#elif defined(__linux__)
|
||||
#define RC_SVCDIR "@PREFIX@/run/openrc"
|
||||
#define RC_SVCDIR "/run/openrc"
|
||||
#else
|
||||
#define RC_SVCDIR RC_LIBEXECDIR "/init.d"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user