Commit Graph

450 Commits

Author SHA1 Message Date
William Hubbs
533813dda0 localmount: Only unmount local filesystems if we are shutting down
Make the stop function in localmount only unmount file systems when the
system is going down.

reported-by: Alexey Prokopchuk <alexpro@homelan.lg.ua>
X-Gentoo-Bug: 407167
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=407167
2012-03-25 18:38:13 -05:00
William Hubbs
6ac182c9ca sysctl: use @SYSCONFDIR@ in the scripts instead of hard coding /etc 2012-03-24 15:00:24 -05:00
William Hubbs
09327f429f Allow files in sysctl.d to override sysctl.conf
reported-by: Peter Gantner (a.k.a. nephros) <gentoo@nephros.org>
X-Gentoo-Bug: 406631
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=406631
2012-03-24 14:37:08 -05:00
Diego Elio Pettenò
8104618d10 init.d/sysctl.Linux: do not use sysctl -q
The -q option is not implemented by BusyBox, so instead of using that, make
it so that the standard error is caught, but standard output is thrown
away.

Note: the ordered behaviour of redirection is part of POSIX so we should be
on the safe side with this change, as first we duplicate the output
descriptor to be used as stderr, then we change the output descriptor to
point to NULL.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-03-24 13:19:41 -05:00
William Hubbs
3247184d86 Remove prefix support
I spoke with the prefix team sometime back and was told that they do not
have an interest in using OpenRC on prefix systems.
2012-02-21 07:27:16 -06:00
William Hubbs
e4146c0945 Revert "Revert "swap: go back to using swapon for Linux systems""
This reverts commit 06d6701785.
After researching this further, we do need this commit. The other issue
is a bug in fstabinfo which will also need to be fixed.
2012-02-20 18:59:17 -06:00
William Hubbs
9e3fc7f3f5 update ignore patterns 2012-02-20 17:07:43 -06:00
William Hubbs
06d6701785 Revert "swap: go back to using swapon for Linux systems"
This reverts commit 297720787f.

robbat2 tells me there is a better way to fix this.
2012-02-20 11:51:08 -06:00
William Hubbs
297720787f swap: go back to using swapon for Linux systems
There are several reasons for going back to this:

- fstabinfo doesn't work with labels in fstab
- when a device is passed to swapon individually, the swap priority from
  fstab is not honored.
- We also add the -e option to only activate available swap devices.

reported-by: Duncan <1i5t5.duncan@cox.net>
X-Gentoo-Bug: 405021
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=405021
2012-02-20 11:30:03 -06:00
William Hubbs
dd2b4a067a net: add deprecation warning for old style net dependency variables 2012-02-18 17:23:28 -06:00
William Hubbs
bc581530e5 Fix meaning of "provide net"
I was informed that "provide net" should mean that there is network
communication outside the local computer. In this case, the loopback
interface can't "provide net", but there needs to be a way for other
processes to know that the loopback interface is active.

To this end, this commit makes the loopback "provide lo" and all other
interfaces "provide net".
2012-02-18 13:48:11 -06:00
William Hubbs
04afaa3c03 hwclock: set the hardware clock on shutdown
Previously, the default on linux systems was to not set the hardware
clock to match the system clock during shutdown.
This changes that default to be consistent with *bsd and swclock.
2012-02-18 12:49:19 -06:00
William Hubbs
a21a2c3e32 hwclock: Clarify documentation
The clock_hctosys and clock_systohc settings really do not have anything
to do with running an ntp daemon, so remove that reference from the
documentation.

Reported-by: Milos Ivanovic <milosivanovic@orcon.net.nz>
X-Gentoo-Bug: 401433
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401433
2012-02-17 14:53:37 -06:00
William Hubbs
a5509d6819 Enable binfmt_misc for openvz containers
Reported-by: Daniel Robbins <drobbins@funtoo.org>
X-Gentoo-Bug: 401875
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401875
2012-02-16 14:05:04 -06:00
William Hubbs
0c866e1a31 Replace hard coded reference to /etc with @SYSCONFDIR@
I found a reference to "/etc" in the procfs script. This changes that
reference to @SYSCONFDIR@.
2012-02-16 13:59:47 -06:00
William Hubbs
1c7d3165e4 Allow localmount to run in openvz containers
Reported-By: Daniel Robbins <drobbins@funtoo.org>
X-Gentoo-Bug: 401063
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401063
2012-02-13 12:15:55 -06:00
William Hubbs
a5ad5ba971 Swap: fix redirect
Swap should redirect stdout and stderr from swapon to null and not just
stderr.
2012-02-13 10:12:12 -06:00
William Hubbs
79d6f10926 Improve swap handling
Modify the swap script so it starts before and stops after localmount.
Also, on linux, this script should skip mounting swap on loopback.

Add a swapfiles script which runs after localmount and is designed to
activate additional swap space which could not be activated before
localmount was run. This includes loopback swap on linux and swapfiles
which are on local file systems that were not mounted when swap was
activated initially.

The start code does reactivate swap that is already active, but this is
not an error condition.

Reported-by: Giampaolo Tomassoni <giampaolo@tomassoni.biz>
X-Gentoo-Bug: 401003
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401003
2012-02-13 08:35:29 -06:00
William Hubbs
09c8c8ed9f Fix typo in swap script 2012-02-12 12:38:37 -06:00
William Hubbs
94661b1d22 termencoding: change "need root" to "use root"
This allows root to be removed from the boot runlevel which is needed
sometimes when the root fs is mounted read-only.

Reported-By: Maxim Kammerer <mk@dee.su>
X-Gentoo-Bug: 400921
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400921
2012-02-10 09:47:12 -06:00
William Hubbs
b9cc589882 root.in: split a long line for readability 2012-02-10 09:23:13 -06:00
Piotr Karbowski
497ff7ee41 Remount already mounted filesystems.
This was modified by William Hubbs to use the checkpath helper and to
improve readability.

Signed-off-by: William Hubbs <williamh@gentoo.org>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
(tested with genkernel /usr mount changes);
2012-02-09 07:27:56 +00:00
William Hubbs
0ff23f20e8 Revert "Net: do not bring down interfaces during shutdown"
This reverts commit 6d5a2d5f9e.
There are interfaces, such as adsl and ppp interfaces which need to be
brought down. Also, the WOL setting is a good case for bringingdown
interfaces.
2012-01-30 12:06:46 -06:00
Christian Ruppert
fb4aa20d05 Use "checkpath -W" instead of dir_writable() 2012-01-28 19:32:05 +01:00
William Hubbs
58e04035ed Cgroups: do not update mtab when mounting control groups
This is based on a patch submitted by the reporter; however, there was
another mount command which needed -n as well so it was added to the
patch.

Reported-by: Ben Kohler <bkohler@gmail.com>
X-Gentoo-Bug: 400967
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400967
2012-01-27 11:19:41 -06:00
William Hubbs
de5cee2c21 cgroups: make sure /sys/fs/cgroup is a mount point
We need to make sure this directory is a mount point before we add the
control groups.

Reported-by: Andrej Filipcic <andrej.filipcic@ijs.si>
X-Gentoo-Bug: 400903
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400903
2012-01-26 11:02:00 -06:00
Mike Frysinger
3ad501218d bootmisc: stop deleting /etc/nologin
Baselayout-1.x used to have a DELAYLOGIN option where it would setup
/etc/nologin automatically and then delete it later on.  OpenRC did
not keep that feature, and during the rewrites, ended up just punting
it all the time.  This isn't what we intended, so drop the rm.

X-Gentoo-Bug: 400837
X-Gentoo-Bug-URL: https://bugs.gentoo.org/400837
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-26 01:12:23 -05:00
William Hubbs
cacea4e7f3 Cgroups: activate the openrc control group release agent 2012-01-23 22:00:08 -06:00
William Hubbs
ce4c9b5397 Cgroups: create openrc control group
This creates the "openrc" control group with no subsystems attached. The
next step will be to add everything openrc starts to this group.
2012-01-23 21:46:33 -06:00
William Hubbs
6e2fbf6a0f Make checks for writable directory posix compliant
Reported-by: Maxim Kammerer <mk@de.su>
X-Gentoo-Bug: 398931
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=398931
2012-01-22 11:56:24 -06:00
Robin H. Johnson
380752f4e0 net: allow parameters to a single address config
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>
2012-01-13 15:57:22 -08:00
Robin H. Johnson
4255ba175b net: net.lo, lots of scripts
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>
2012-01-08 16:24:10 -08:00
William Hubbs
f2e404ab66 net.lo: Add the ability to find the full path of a binary
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.
2012-01-07 13:09:17 -06:00
William Hubbs
cd52fecc4e cgroups: turn on groups by default
The control groups we create are the ones recommended by the linux
kernel, so this should be on most of the time if cgroups are enabled in
the kernel.
2012-01-05 22:28:04 -06:00
William Hubbs
dbfcf23273 really disable /var/{lock,run} migration to /run
This needs to be disabled until we have tmpfiles.d support. The previous
method did not disable it correctly.
2012-01-05 06:55:08 -06:00
William Hubbs
6d5a2d5f9e Net: do not bring down interfaces during shutdown 2011-12-30 10:44:56 -06:00
William Hubbs
6c8e8e2a96 disable /run migration until we have /run in baselayout 2011-12-29 17:28:05 -06:00
William Hubbs
29da0c8bf0 cgroups: default the size of the tmpfs to 10 mb 2011-12-29 10:01:28 -06:00
William Hubbs
20f612080c net: use yesno to test up_before_preup 2011-12-27 17:59:39 -06:00
Robin H. Johnson
9a01f68515 net: Add up_before_preup variable for CAN devices
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>
2011-12-26 16:27:38 -08:00
William Hubbs
f6dc3d5ae9 cgroups: always mount the tmpfs on /sys/fs/cgroup
X-Gentoo-Bug:395079
X-Gentoo-Bug-URL:https://bugs.gentoo.org/show_bug.cgi?id=395079
2011-12-20 01:42:36 -06:00
Piotr Karbowski
3e2001f6a2 add rc_cgroup option to allow disabling of cgroup default setup
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
2011-12-20 01:14:08 -06:00
William Hubbs
ed4605bf9f cgroups: remove references to the "openrc" cgroup
Openrc will set up cgroups the way the kernel documentation recommends.
2011-12-19 21:54:53 -06:00
William Hubbs
461c69acdb cgroups: mount cgroups suggested by the kernel documentation
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.
2011-12-18 13:33:27 -06:00
William Hubbs
46b96eb80d Network: start interfaces after dbus
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
2011-12-12 19:46:03 -06:00
William Hubbs
5adb3930c7 Integrate migrate-run into bootmisc
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
2011-12-03 12:46:52 -06:00
William Hubbs
b628481701 migrate-run: fix ln calls and migrate directories separately
This is based on a patch submitted by AlphatPC@gmail.com.

Reported-by: AlphatPC@gmail.com
X-Gentoo-Bug: 391945
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=391945
2011-11-27 23:29:22 -06:00
William Hubbs
ab01a74405 Make migrate-run more verbose 2011-11-26 20:57:14 -06:00
Mike Frysinger
d8e739e19a urandom: move seed from /var/run to /var/lib
We want the seed to be preserved across reboots, so move it to /var/lib.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-26 13:21:54 -05:00
Mike Frysinger
3baca9a35c fsck: fix typo in fsck mount point support
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>
2011-11-26 03:21:21 -05:00
Mike Frysinger
cc45abb77b net.lo: fix typo in previous math commit
x-Gentoo-Bug: 391671
x-Gentoo-Bug-URL: http://bugs.gentoo.org/391671
Reported-by: Duncan <1i5t5.duncan@cox.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-23 13:17:20 -05:00
William Hubbs
17a1529416 Migrate /var/lock and /var/run to /run for linux systems 2011-11-23 07:26:05 -06:00
William Hubbs
815952a65a Revert "Revert "fsck: add the ability to specify mount points to check""
This reverts commit 5a3599df8a.

After review, I am bringing this back to the tree.
2011-11-22 12:56:29 -06:00
William Hubbs
d8bbeb184f CGroups: create the openrc cgroup hierarchy
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.
2011-11-20 14:07:46 -06:00
Mike Frysinger
ef1ff1b4f2 make shell math operations style more succulent
Convert the style:
	var=$((${var} + 1))
to:
	: $(( var += 1 ))

The latter is easier to read imo.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-19 02:25:36 -05:00
William Hubbs
0510c473d4 CGroups: /sys/fs/cgroups should be a tmpfs
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.
2011-11-18 17:58:37 -06:00
William Hubbs
5994e55937 Deprecate the network and staticroute scripts
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.
2011-11-16 13:29:52 -06:00
William Hubbs
5a3599df8a Revert "fsck: add the ability to specify mount points to check"
This reverts commit e3b39a677b.

I misunderstood and thought this was ready to go in the tree, but it was
on a remote branch only for a review.
2011-11-06 22:06:58 -06:00
Robin H. Johnson
e3b39a677b fsck: add the ability to specify mount points to check 2011-11-06 13:58:48 -06:00
William Hubbs
5066d40ac8 Use pattern rules instead of suffix rules
Rework the makefiles to use pattern rules instead of suffix rules.
This is the preferred way to write implicit rules according to the gnu
make manual.
2011-10-29 09:43:24 -05:00
Alexey Shvetsov
b1da4dcb99 Add support for automounting configfs and cgroupfs
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
2011-10-26 10:35:01 -05:00
Mike Frysinger
9a539ebbe1 further clean up OS differences in makefiles
No need for if() logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-20 14:32:37 -05:00
William Hubbs
ecf77254bb consolodate Makefiles
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
2011-10-18 03:23:00 -05:00
Mike Frysinger
9f95878bbd fix random typos
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-16 19:02:21 -04:00
William Hubbs
9175534752 Small style change 2011-10-02 12:21:17 -05:00
Christian Ruppert
c5fb64d61f Make dmesg log optional
Reported-by: Patrick <gentoo@feystorm.net>
X-Gentoo-Bug: 384485
X-Gentoo-Bug-URL: https://bugs.gentoo.org/384485
2011-09-27 18:15:08 +02:00
Christian Ruppert
930f4021b1 Add a new helper functions for _{flatten,get}_array
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
2011-09-21 00:21:43 +02:00
Mike Frysinger
fb485366e6 procfs: simplify the binfmt_misc mount check
Replace the `mountinfo` exec with a file test of the register file
which we rely on later anyways.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-18 16:01:28 -04:00
Mike Frysinger
f52dca6984 procfs: drop nfsd mounting
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>
2011-09-18 16:01:28 -04:00
Mike Frysinger
47d305d2af procfs: load config files from binfmt.d into /proc/sys/fs/binfmt_misc/register
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>
2011-09-18 16:01:26 -04:00
Christian Ruppert
2d180551ef Fix regex pattern for umounts during shutdown
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
2011-09-11 18:51:29 +02:00
William Hubbs
7a6dbedf38 Mtab: fix typo
Reported-By: Helmuth Schmelzer <des-colo@hotmail.com>
X-Gentoo-Bug: 381503
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=381503
2011-09-02 01:56:41 -05:00
Yun Zheng Hu
a029dee59b Do not print "null" or "noop" when configuring an interface
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
2011-08-20 14:10:07 -05:00
William Hubbs
2330978300 Do not update mtab if it is a symbolic link
Reported-by: <junkmailnotread@yahoo.com>
X-Gentoo-Bug: 370037
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=370037
2011-08-20 12:42:24 -05:00
William Hubbs
3688c85163 swclock: select a default reference file
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
2011-07-28 09:21:29 -05:00
William Hubbs
863ef36011 mtab: fix test for a link to a location in /proc
/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
2011-07-26 00:45:22 -05:00
William Hubbs
05c2d68192 Mtab: fix typo 2011-07-23 16:53:16 -05:00
William Hubbs
e3b02abd7a Add warnings for the use of bash arrays
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
2011-07-14 01:26:29 -05:00
Kirill Elagin
0c7032840b save and restore IFS correctly
X-Gentoo-Bug: 371141
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=371141
2011-07-07 12:23:58 -05:00
William Hubbs
e8e86b96dc fix issue with extra_net_fs_list
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
2011-07-05 18:41:33 -05:00
Mike Frysinger
49f1a8702b eat trailing whitespace
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-04 18:27:00 -04:00
Robin H. Johnson
be990b308a Bug 373808: init.d/modules skipped certain variable combinations
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>
2011-07-04 07:48:51 +00: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
Kirill Elagin
2050e67911 localmount: make OIFS and CIFS local in stop function
X-Gentoo-Bug: 371141
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=371141
2011-06-24 12:13:28 -05:00
William Hubbs
013e7fb9fc allow options to be passed to killall5
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
2011-06-23 21:52:44 -05:00
Mike Frysinger
8947c00204 sysctl: do not make unknown keys fatal
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>
2011-06-18 10:06:41 -05:00
Diego Elio Pettenò
a2c8e5ce50 Don't set hostname on containers.
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>
2011-06-02 11:34:13 -05:00
William Hubbs
8202e7dce4 add back the eend command in start/stop for local service
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
2011-04-21 13:02:49 -05:00
Lars Wendler
ede4d1cd60 Don't unmount /run on shutdown
This is needed so that udev will stop properly on shutdown.

X-Gentoo-Bug: 363971
X-Gentoo-Bug-Url: http://bugs.gentoo.org/show_bug.cgi?id=363971
2011-04-18 15:26:19 -05:00
Anthony G. Basile
ac56ab7f6d Check for /sys/module/usbcore before modprobe usbcore
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>
2011-04-17 09:12:20 -04:00
William Hubbs
de0ded4ed0 revert changes for bug #292894
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
2011-04-15 19:21:20 -05:00
Sebastian Thorarensen
75722dac4e termencoding should run after bootmisc
This change is necessary so that the unicode flag is not erased by
bootmisc.

X-Gentoo-Bug: 363611
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=363611
2011-04-14 15:21:02 -05:00
William Hubbs
03cd55aa19 start loopback interface before mtab
X-Gentoo-Bug: 292894
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=292894
2011-04-11 15:33:41 -05:00
William Hubbs
85827d474c remove "after bootmisc" dependency from loopback interface 2011-04-10 17:24:44 -05:00
William Hubbs
8e925368b7 bring up the loopback interface earlier
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>
2011-04-10 16:10:47 -05:00
William Hubbs
15660dbbfc add fallback_routes support to network scripts
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
2011-04-09 13:54:01 -05:00
William Hubbs
c7c278dfd4 do not timeout waiting for bootmisc to complete
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
2011-04-08 14:01:13 -05:00
William Hubbs
46e67badd2 fix typo in staticroute
X-Gentoo-Bug: 362205
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=362205
2011-04-07 07:19:53 -05:00
Mike Frysinger
7c1a2defb6 bootmisc: clean up tmpdir cleaning
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
2011-03-25 11:25:25 -05:00
William Hubbs
25049d3e80 termencoding needs root to be mounted read/write
X-Gentoo-Bug: 360215
X-Gentoo-Bug-URL: http://bugs.gentoo.org/360215
2011-03-23 22:41:03 -05:00