Commit Graph

3011 Commits

Author SHA1 Message Date
Robin H. Johnson
a9f1ac2dfd net/bonding: Sanity-check sysfs usage
If sysfs is not available, you might still be able to create bond
interfaces, but only in very specific configurations, and you must have
the ifenslave binary instead to call ioctls.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-10-11 03:56:37 +00:00
Robin H. Johnson
27984c0d2d net/bonding: subsume functionality for NFS booting
If the kernel is NFS-booting, it is critical that we don't down the
slave interfaces when we activate the bond. To do so will break the root
filesystem when networking is temporarily lost.

Reported-by: Walter <walter@pratyeka.org>
X-Gentoo-Bug: 428604
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=428604
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-10-11 03:49:45 +00:00
Robin H. Johnson
9a9c2acd8d net/{bridge,iproute2}: Stricter iproute2 ip link syntax & promisc handling
The 'dev' argument is only optional for ethX devices, for others it is
mandatory, so we should always include it.

Also tweak when promisc mode is applied to bridges.

Patches submitted by Denis Kaganovich <mahatma@bspu.unibel.by>.

X-Gentoo-Bug: #431204
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=431204
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-10-10 00:10:52 +00:00
William Hubbs
b68d4b3580 checkpath: fix bool values
Use true/false for bool values instead of 0/1.

Reported-by: <vapier@gentoo.org>
2012-10-09 18:55:09 -05:00
William Hubbs
6f345abe91 checkpath: change the owner/group only when requested to do so
Fix checkpath so that it only changes the owner/group if -o is on the
command line.

Reported-by: <flameeyes@gentoo.org>
X-Gentoo-Bug: 437560
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=437560
2012-10-09 16:44:01 -05:00
Andrew Gregory
da842085ce Fix default runlevel symlink paths
runlevels/Makefile currently uses ${PREFIX} when creating the initial
runlevel symlinks, but the init files are installed to ${INITDIR},
which results in broken symlinks if ${SYSCONFDIR} is set to something
other than ${PREFIX}/etc

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-05 14:27:00 -05:00
Andrew Gregory
18bdbb6870 Remove non-standard reboot option from inittab
Gentoo adds a "-k" option to the reboot command in inittab. This is a
Gentoo-specific option, so it is being removed.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-05 14:24:50 -05:00
William Hubbs
361f5ce2b8 set the RC_UNAME environment variable when updating dependencies
This is needed because the network script uses this variable in the
depend() function but it wasn't exported when this was run.

Reported-by: <aaly90@gmail.com>
2012-10-04 22:01:33 -05:00
William Hubbs
ae9acfaed8 sysfs: add -lxc keyword
The sysfs filesystem should not be mounted inside a linux container.

Reported-by: permeakra@gmail.com
X-Gentoo-Bug: 425790
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=425790
2012-10-02 15:02:11 -05:00
William Hubbs
6770a6b1ce dmesg should not run in a linux container
reported-by: <Walter@pratyeka.org>
X-Gentoo-Bug: 436266
X-Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=436266
2012-10-02 11:06:31 -05:00
Robin H. Johnson
4ff71bd741 tmpfiles.d init.d scripts
Now that the tmpfiles.d code is more tested, actually call it from
init.d. It assumes that /run is already available when it runs.

Please note it runs TWICE.
- During sysinit, ideally just after /dev/shm is created, but before
  udev has started. After udev is also acceptable, but not ideal.
- During boot, ideally just after localmount has completed.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-26 15:42:37 -07:00
Robin H. Johnson
5c736ad63e sh/tmpfiles.sh: Improve dry-run mode.
Dry-run with more detail is more useful this way.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-26 15:14:04 -07:00
Robin H. Johnson
33c63ede78 init.d/devfs: Run after (u)dev-mount, before udev/mdev
Using the new dev-mount virtual, with udev-mount included until new udev
version is rolled out, we run devfs earlier now, before udev/mdev.
It only needs (u)dev-mount before it, so that /dev is mounted.

This opens the way for tmpfiles.d, which needs to be sandwiched in the
middle.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-26 14:34:41 -07:00
Robin H. Johnson
ac47b6abfa runlevels: Include sysfs in the sysinit level.
net.* and module loading require sysfs now, and if udev is not in use,
it is not always loaded early enough, esp for net.lo. Force it to come
up during sysinit instead.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-26 14:29:47 -07:00
William Hubbs
7d8dca7b78 Add -lxc keyword to urandom script
Urandom should not run in lxc containers since it is provided by the
host.

Reported-by: <walter@pratyeka.org>
X-Gentoo-Bug: 436270
X-Gentoo-Bug-URL: http://bugs.gentoo.org/436270
2012-09-26 11:51:34 -05:00
William Hubbs
c08b1a6a32 small runscript man page cleanups 2012-09-25 12:09:45 -05:00
William Hubbs
5615fa78d6 Drop restart_pre/restart_post
By design, restart is hard coded to run stop followed by start along
with all of the pre/post functions associated with them. Restart doesn't
need its own pre/post functions since it is possible to make any
function in an init script behave differently for a restart command by
testing against the RC_CMD environment variable.
2012-09-25 10:22:47 -05:00
William Hubbs
f007988fba Clarify how to handle restart processing
The Gentoo developer manual covers how to handle restarts in init
scripts, but this was not officially covered in OpenRc's Documentation.
This commit adds an example to the runscript man page that shows how
this works.
2012-09-23 19:25:57 -05:00
William Hubbs
20ef3439ea fix Makefile indentation 2012-09-23 11:11:40 -05:00
Christian Ruppert
0406c6085b Add restart_pre/restart_post support, also document RC_CMD 2012-09-22 16:57:46 +02:00
William Hubbs
0a132cdca5 fix RC_SVCDIR on prefix systems
On prefix systems, RC_SVCDIR was being defined based on the host
operating system. This is not correct because there will not be a /run
directory in a prefix.
This commit moves RC_SVCDIR on prefix systems to the same location as on
non-Linux systems.
2012-09-20 16:04:48 -05:00
William Hubbs
a0fe1c5a60 netmount: do not handle NFS mounts
Since nfs and nfs4 file systems require extra daemons to be running on
the client to function properly, netmount should not try to handle these
file systems.

Reported-by: <devurandom@gmx.net>
X-Gentoo-Bug: 427996
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=427996
2012-09-15 12:08:09 -05:00
Christian Ruppert
6b1e806c8b Typo: emtpy -> empty
Reported-by: Walter <walter@pratyeka.org>
X-Gentoo-Bug: 430146
X-Gentoo-Bug-URL: https://bugs.gentoo.org/430146
2012-09-14 22:59:01 +02:00
Christian Ruppert
3cd293c515 Silence the right get_pid() call 2012-09-12 21:35:55 +02:00
Christian Ruppert
a06072b395 Silence get_pid(), OpenRC will give the process some time to create the PID file and the first get__pid() call may fail. 2012-09-12 21:00:20 +02:00
William Hubbs
3863c11be5 netmount: add checks for rpc.idmapd for nfs4 filesystems
Reported-by: <devurandom@gmx.net>
X-Gentoo-Bug: 427996
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=427996
2012-09-10 15:43:42 -05:00
William Hubbs
5092595835 add RC_PREFIX environment variable
This will be used by init scripts which want to be able to run in a
Gentoo Prefix installation. RC_PREFIX will contain the prefix offset.
2012-09-09 22:22:15 -05:00
William Hubbs
918d261658 dmesg: add -prefix keyword
Dmesg should not run on prefix systems.

Reported-by: <heroxbd@gentoo.org>
2012-09-09 20:40:38 -05:00
William Hubbs
a0877449f3 savecache: make sure $RC_LIBEXECDIR is writable
This is needed in case of a read-only root filesystem such as a diskless
client.

Reported-by: <walter@pratyeka.org>
X-Gentoo-Bug: 430382
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=430382
2012-09-07 19:18:51 -05:00
William Hubbs
444bdfbfc4 oldnet/iproute2.sh: fix carrier detection
We were not testing for carrier correctly when testing for ipv6
tentative addresses.

Reported-by: <ast@domdv.de>
X-Gentoo-Bug: 433012
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=433012
2012-09-07 14:29:56 -05:00
William Hubbs
8e4169e29e Fix UPREFIX for Gentoo Prefix installations
Make sure UPREFIX in our make files gets set correctly when
MKPREFIX=yes. In this situation, UPREFIX should be ${PREFIX}/usr.

Reported-by: <heroxdb@gentoo.org>
X-Gentoo-Bug: 415899
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=415899
2012-08-31 16:50:49 -05:00
William Hubbs
ea696b47c8 fix typo 2012-08-31 14:47:20 -05:00
William Hubbs
9e88d73aaa add MKPREFIX flag to build system
This allows building OpenRC for a Gentoo Prefix installation.
2012-08-31 10:40:47 -05:00
William Hubbs
1f01157354 do not provide a virtual for the loopback
The loopback interface is active on all systems, so there is no need to
provide a virtual for it.
2012-08-25 17:09:04 -05:00
William Hubbs
8f675d14e8 newnet: provide net if configuring more than the loopback interface 2012-08-24 10:30:04 -05:00
Christian Ruppert
9afdf50667 Do not silence errors 2012-08-19 00:26:38 +02:00
Christian Ruppert
8dc06e3259 Fix quiet usage
EINFO_QUIET will always been unset when we first do unsetenv("EINFO_QUIET") and
later query it again anyway..
2012-08-18 23:21:40 +02:00
Christian Ruppert
aa7e2cd1fe Use do_umount's return value instead of eoutdent's. 2012-08-18 22:37:38 +02:00
William Hubbs
07e848638c swapfiles: make sure /proc/swaps exists
If CONFIG_SWAP is turned off in the kernel, this file may not exist. In
that case, we should not try to read from it.

reported-by: <walter@pratyeka.org>
X-Gentoo-Bug: 430378
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=430378
2012-08-17 13:26:21 -05:00
Robin H. Johnson
c8703354e3 sh/tmpfiles: fix quoting for optional arguments
Some optional arguments were missing quotes in the tests, so produced
spurious warnings.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-08-16 18:45:23 +00:00
William Hubbs
e641b43849 Bring Back prefix support
We now have a team member who is interested in OpenRC on prefix, so I am
bringing it back to the main tree.
2012-07-26 10:54:48 -05:00
Robin H. Johnson
a6db2374fe Bug #427152: Port of VLAN code to sysfs/iproue2 from vconfig lost the ability to create different vlans with the same ID but different interfaces on a single system. Implement it now.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-07-20 10:20:19 -07:00
William Hubbs
2e3715bb69 remove unnecessary header line 2012-07-15 14:12:55 -05:00
William Hubbs
883ea31f80 small style changes to encswap
This drops some unnecessary continue statements and changes command
command substitution to use $() instead of ``.
2012-07-15 14:01:03 -05:00
Richard Yao
39abbed7cb Fix savecore init script to execute after dumpon, but before encswap
This ensures that any kernel crash dumps are available when savecore
runs. It also prevents encswap from corrupting them.
2012-07-15 14:01:03 -05:00
Richard Yao
0730ac61e8 Import encswap init script from FreeBSD
The FreeBSD encswap init script has been adapted to function in OpenRC. It
should function identically to its FreeBSD counterpart.
2012-07-15 13:57:57 -05:00
William Hubbs
006fbdce83 fix the upstream default network stack
The OpenRC upstream default network stack was changed, but there was no
reason to change it. Now since we have the MKNET build switch, it is
easy for the gentoo ebuild to install oldnet by default.

The upstream default is newnet.
2012-07-10 12:18:06 -05:00
William Hubbs
60d6847de5 add the MKNET variable to select a network stack
The MKNET variable can be used to select the network stack you want to
build and install with OpenRC.

The current default is the gentoo "oldnet" stack. If you want to install
the OpenRC newnet stack, use MKNET=newnet on the make command line.
2012-07-10 02:39:36 -05:00
William Hubbs
ecb4d7c3f2 Revert "add the appropriate network scripts to the boot runlevel"
This reverts commit add965706a.
This commit was broken so I need to revert it.
2012-07-09 21:08:58 -05:00
William Hubbs
84ad14b2e4 fix reference to dmesg man page
Correct the reference in conf.d/dmesg from dmesg(8) to dmesg(1).

reported-by: <toralf.foerster@gmx.de>
X-Gentoo-Bug: 425370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=425370
2012-07-09 09:25:24 -05:00