In the case of a single line of configuration, where the address has
parameters, the parameters were being treated as seperate addresses.
Eg:
config_eth0="4321:0:1:2:3:4:567:89ab/64 nodad home preferred_lft 0"
Also document usage of parameters in the net example, and note that
multiple addresses on a single line cannot be mixed with parameters.
Newlines are required to seperate the addresses.
X-Gentoo-Bug: 398827
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=398827
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
The program function in depend blocks is now able to search paths by
itself. If passed multiple arguments or multiple calls, at least one of
the arguments passed must be a program or a shell builtin (eg ip built
into busybox). If a qualified path is specified, only that path will be
checked, otherwise it will be checked as a builtin, then $PATH will be
checked for the named binary (via type).
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Some of the networking tools, such as iproute2, can be stored in one of
several locations. This function gives us a standard way to find these
tools.
I would like to thankRobin Johnson <robbat2@gentoo.org> for his input on
this function.
Historically, we have tried to up interfaces before running preup, so
that the kernel setups up the device and makes things like ethtool work
(some hardware cannot be correct probed until then). However this ends
up breaking other hardware, so a variable has been introduced to allow
the up prior to preup to be disabled: up_before_preup_IFVAR=no
X-Gentoo-Bug: 389475
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=389475
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Currently, cgroups are still in development, so we are not setting them
up by default. However, this default will be changed in the future.
This commit message and patch were updated by
William Hubbs <williamh@gentoo.org>.
X-Gentoo-Bug: 395079
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=395079
The linux kernel documentation suggests mounting a separate cgroup
hierarchy for each subsystem you want to control/monitor. This changes
the cgroups mounting code to do this.
This is needed to allow auto-connect at boot.
Reported-by: David J Cozatt <ygdrasil@comcast.net>
X-Gentoo-Bug: 390955
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=390955
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@gentoo.org> for his
input on this patch
Previous commit e3b39a677b missed adding a "[" to one of the tests.
Reported-by: Torsten Veller <tove@gentoo.org>
x-Gentoo-Bug: 391941
x-Gentoo-Bug-URL: http://bugs.gentoo.org/391941
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Openrc will create a cgroup hierarchy called openrc which will have all
services it starts and all subsystems attached to it. If you need other
groups/hierarchies, please use libcgroup.
The kernel documentation states that a cgroup file system should not be
mounted here, but a tmpfs.
This also means that we should not create a group for each process, but
we should allow the user to specify which group a process should be
assigned to. The rc_cgroup variable will be used for this purpose.
For more information, see /usr/src/linux/Documentation/cgroups/cgroups.txt.
These scripts are not supported, and they have several major design
issues such as not being able to stop, start or allow a dependency on a
single interface.
The tree contained many operating system specific Makefiles which were
being included in other Makefiles. This commit removes those and adds
the code to the makefiles which included them using make's conditional
processing.
X-Gentoo-Bug: 387441
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=387441
A new helper function (_array_helper) since both, the _flatten_array and
_get_array function share partially the same code.
We also reduce multiple whitespace to a single space, remove leading newlines
as well as skipping "empty" lines.
This makes the data returned by _{flatten,get}_array much nicer than before.
It also fixes bug 366677 where net-tools having trouble with the whitespace
mentioned above. iproute2 was not affected.
Reported-by: Andrew Maltsev <am@ejelta.com>
X-Gentoo-Bug: 366677
X-Gentoo-Bug-URL: https://bugs.gentoo.org/366677
The dedicated nfs init.d script takes care of mounting this when
necessary, and we want it there since mounting it isn't terribly
useful if you can't actually start up the nfs daemons (which the
nfs-utils package provides).
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This is a KISS version. Let's see where we go from here in terms of
complexity. Maybe nowhere!
X-Gentoo-Bug: 382723
X-Gentoo-Bug-URL: https://bugs.gentoo.org/382723
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This patch fixes the regex pattern for /lib -> /lib(32|64)?
as well as the pattern for RC_SVCDIR if it contains /lib(32|64)?/.
This fixes bug 381783.
X-Gentoo-Bug: 381783
X-Gentoo-Bug-URL: https://bugs.gentoo.org/381783
Note by william hubbs:
I modified the patch to compare "null" and "noop" with $1 instead of
${config}.
Reported-by: Yun Zheng Hu <hu@fox-it.com>
X-Gentoo-Bug: 379577
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=379577
If $RC_SVCDIR/shutdowntime does not exist, we need a default reference
file. It is safe to use @PREFIX@/sbin/runscript for this purpose.
Reported-By: Robin H. Johnson <robbat2@gentoo.org>
X-Gentoo-Bug: 376249
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=376249
/etc/mtab can be a link to a file in /proc. If it is, we should not
attempt to update /etc/mtab.
The original test used "! -w" as part of the test. This does not
work since everything is writeable by root.
Thanks to Robin Johnson for the suggestion of using readlink -f and the
regular expression.
Reported-By: junkmailnotread@yahoo.com
X-Gentoo-Bug: 370037
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=370037
Currently, we allow the use of bash arrays for some configuration settings.
This is undocumented, so I want to remove the support from openrc.
The first phase of this removal will be this commit which adds warnings
to encourage people not to use bash arrays.
X-Gentoo-Bug: 374875
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=374875
The extra_net_fs_list variable was not being included as it should have
been for the net file systems because it was being expanded before it
was set by the user.
X-Gentoo-Bug: 374133
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=374133
The version iteration code missed certain combinations:
KV=1.2.3.4
skips: 1.2.3, 1
KV=1.2.3
skips: 1
Simplify the code to use a loop and build the list of versions directly
instead of unique variables per version component.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This allows options to be passed to killall5 by the killprocs script.
This was added so that certain processes will not be killed during
shutdown.
x-Gentoo-Bug: 371625
x-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=371625
If unknown keys are found, currently sysctl would add all of its valid
settings, but then leave itself marked as "stopped". Since this is not
really what we want, make unknown keys a non-fatal error.
Reported-by: Christian Ruppert <idl0r@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
LXC already provides a means to set the utsname/hostname of the system, so
avoid overriding the user's configuration through hostname here.
Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com>
This was added back due to a user request. It will always be on a line
of its ownbecause I'm considering adding more verbose info messages to
local that show when each service is run if local is run with the -v
option.
X-Gentoo-Bug: 363343
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=363343
The use of /proc/bus/usb to mount usbfs has been deprecated, but
the option is still available in the kernel. The new approach is
to use /sys. We should not modprobe usbcore if either /proc/bus/usb
or /sys/module/usbcore exist.
X-Gentoo-Bug: 363551
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=363551
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This is being done because these dependency changes caused a regression.
We will need to revisit the previously mentioned bug.
X-Gentoo-Bug: 363693
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=363693
For most situations, the loopback interface can depend on root instead
of localmount, so this patch makes that happen. It also adds comments to
the net.example files explaining when a user might want to change this
and giving an example.
I would like to thank Robin Johnson for the original patch and suggested
examples.
X-Gentoo-Bug: 292894
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=292894
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Add support for optional fallback_routes_* variables in the network scripts.
This is similar to the fallback_route_* support in baselayout-1.
However, if you do not have fallback_routes set for an interface but you
do have routes set, that setting will be used, so you do not need this
variable unless you want the fallback routes to be different from the
primary routes.
X-Gentoo-Bug: 250978
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=250978
It is possible for bootmisc to take longer than 60 seconds to complete
and services should not time out waiting for it.
X-Gentoo-Bug: 360405
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=360405
Make sure that the `cd` into the $dir actually happened. This we don't
have to worry about relative paths deleting stuff it shouldn't. This
step shouldn't fail, but who knows, and better to be sane than to wipe
out someone's valuables.
When wiping, automatically fall back to a dedicated `find` if the initial
`rm` failed on us. This should help with the speed issues related to the
later `find`.
Have the later find only search the top level allowing `rm` to walk the
directory contents. This means that -xdev no longer applies, but since
the earlier `rm` wasn't doing -xdev either and no one has complained thus
far, let's assume it isn't an issue. Also convert to the -exec...+ form
so that we don't have to worry about long argument lists, and add -- to
the `rm` that was previously missing. In practice, this shouldn't matter
as we've already deleted all those files, but better safe than sorry.
When cleaning, since we've already done a `cd` into the $dir, no point in
prefixing all the paths with $dir too. Go with the relative loving.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
X-Gentoo-Bug: 359831
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=359831
Since mount-ro needs to run unconditionally, we need to have savecache
report that it ran successfully when the system is shutting down.
X-Gentoo-Bug: 356393
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=356393
We need to set the timezone for the system clock even when we allow the
kernel to set the time.
X-Gentoo-Bug: 248131
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=248131
The main makefile, init.d/Makefile and src/librc/Makefile all contain
several shell calls which can be handled as make conditionals. This
switches them to conditionals.
This reworks the shell calls in the makefiles to use immediate
evaluation and should improve parallel building.
X-Gentoo-Bug: 289264
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=289264
This commit adds the clock_hctosys option which is used to skip setting
the system clock on boot and can be used with a modern linux kernel
which has the CONFIG_RTC_HCTOSYS option set to y.
I would like to thank Dimitris Mandalidis for the report and for the
patch to baselayout-1 on which my changes to openrc are based.
X-Gentoo-Bug: 248131
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=248131
This changes the local service so that it will run programs located in
@sysconfdir@/local.d instead of the local_start and local_stop functions
from @sysconfdir@/conf.d/local.
The advantage for the user is that these programs are not part
of the openrc package, so the user does not have to worry about them
being overwritten when openrc is upgraded.
X-Gentoo-Bug: 351465
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=351465
- delete the contents of the $RC_LIBEXECDIR/console directory but not
the directory itself.
- direct error output from the chmod call for /tmp to /dev/null.
The _netdev option in fstab on linux systems indicates
that a filesystem should only be mounted if the network is available.
This commit fixes netmount to support this.
We need to warn users that they should be using /etc/conf.d/local
instead of /etc/conf.d/local.start and /etc/conf.d/local.stop. This adds
those warnings.
This fixes having JFS as the root partition on battery power.
For most modern FS's this is a non op, or a very small op by default
so it should be fine.
Fixes Gentoo #291654.
the mtime of a file. It saves the shutdown time to this file also.
This is handy for systems without a working RTC chip.
Based on an idea by Michael A. Smith <michael@smith-li.com>.
Fixes Gentoo #272073.
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.
This simply assigns static addresses and an optional default route.
It's possible to add external commands as well, so to create a bonded interface.
Hopefully we can add a few examples to satisfy most of the old net.lo, which
is no longer installed into boot by default.
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.
Since we only use the result of the device scan to load modules, there is
no point in doing the scan if the kernel doesn't support modules in the
first place.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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.