Commit Graph

405 Commits

Author SHA1 Message Date
Alexey Shvetsov
ca7d67021e Do not try to remount /run read only
On a diskless system, doing this causes the system to lock up during
shutdown.
2012-05-02 14:42:58 -05:00
Sergei Trofimovich
4943ddcb1c init.d/procfs: posix compatibility fix
I've noticed in at boot:
    # /etc/init.d/procfs restart
    procfs         | * WARNING: you are stopping a boot service
    procfs         |[: 308: unexpected operator

Which calls
    $ /bin/dash -c '[ "$RC_SYS" == "OPENVZ" ] && echo "ovz" || echo "nope"'
    [: 1: unexpected operator
    nope

Fixed by using '='.

X-Gentoo-Bug: 412237
x-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=412237
2012-04-16 13:45:59 -05:00
William Hubbs
be5de328e9 network scripts need sysfs on linux systems
Adjust the previous commit so that on linux systems the network scripts
need sysfs.
2012-04-03 20:01:23 -05:00
William Hubbs
0571a7e05b init.d/fsck: only check local file systems
On linux systems, fsck was not taking into account which filesystems
were local or remote. This commit adds the -t option, with an
appropriate value, to the fsck call so that remote file systems are not
checked.

reported-by: Vladimir Berezhnoy <non7top@gmail.com>
X-Gentoo-Bug: 408363
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=408363
2012-03-29 11:44:12 -05:00
William Hubbs
f9162438bc Add -lxc keyword to sysctl script for linux systems
Kernel parameters should not be set from inside a lxc guest.

Reported-by: Piotr Karbowski <piotr.karbowski@gmail.com>
2012-03-26 14:51:03 -05:00
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