Commit Graph

443 Commits

Author SHA1 Message Date
Robin H. Johnson
4ec1edc1f8 Whitespace.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-11-07 00:32:09 +00:00
Robin H. Johnson
91e28ab775 init.d/hostname: Document checkbashism false positive.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-11-06 23:12:24 +00:00
Robin H. Johnson
87daa26ca7 init.d/mtab: Another instance of the same pattern matching case.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-11-06 23:02:56 +00:00
Robin H. Johnson
670589571e init.d/bootmisc: Another instance of the same pattern matching case.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-11-06 23:01:42 +00:00
Robin H. Johnson
f6c3896087 init.d/bootmisc: POSIX XSI shellism.
In a pathname expansion, specifically single-character match, the pure
POSIX specification uses '!' as the Negation character where a regular
expression would normally be '^'.

Regular expression: "a[^a]a"
Pathname expansion pattern: "a[!a]a"

Reference:
IEEE Std 1003.1, 2004 Edition
2. Shell Command Language
2.13 Pattern Matching Notation
2.13.1 Patterns Matching a Single Character

> The description of basic regular expression bracket expressions in the
> Base Definitions volume of IEEE Std 1003.1-2001, Section 9.3.5, RE
> Bracket Expression shall also apply to the pattern bracket expression,
> except that the exclamation mark character ( '!' ) shall replace the
> circumflex character ( '^' ) in its role in a "non-matching list" in
> the regular expression notation. A bracket expression starting with an
> unquoted circumflex character produces unspecified results.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-11-06 22:49:49 +00:00
William Hubbs
1a8cd5ff9d Tmpfiles: create and delete entries once in the boot runlevel.
Initially, we were creating tmpfiles entries in the sysinit runlevel and
again in the boot runlevel. Systemd runs the --create and --remove
options in one service called systemd-tmpfiles-setup after the local
file systems are mounted. Now we have a service called tmpfiles.setup
which emulates this.

This also closes the bug mentioned below, since we were originally
writing to files that were on read-only file systems and that were not
available.

Reported-by: <devurandom@gmx.net>
X-Gentoo-Bug: 439012
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439012
2012-10-31 17:33:14 -05:00
William Hubbs
5148047f89 netmount: drop need net from dependencies
Reported-by: <mattsch@gmail.com>
X-Gentoo-Bug: 439658
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439658
2012-10-25 16:33:56 -05:00
William Hubbs
8d17c634db oldnet: make the default carrier timeout 0
Some types of interfaces do not have a carrier, so it doesn't make sense
to automatically wait for one.

Reported-by: <rose@rz.uni-potsdam.de>
X-Gentoo-Bug: 438970
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=438970
2012-10-22 09:23:04 -05:00
William Hubbs
e8acdc6f85 tmfiles: change need dev to use dev.
This is being changed to use for the reason I stated in the previous
commit. There is no guarantee that someone is using a device manager.
2012-10-19 21:45:14 -05:00
William Hubbs
2a9de2df58 devfs: Remove references to specific device managers
There were references in the devfs script to mdev, udev and
udev-mount. These all provide the virtuals dev and dev-mount; that is
how we should refer to them.

I believe in the discussion I had with Tony and Robin about this, we
were going to change the "use" line to "need". However, after thinking
that over, I'm not comfortable doing so because someone could be running
a static /dev with no device manager.

Reported-by: <tokiclover@gmail.com>
X-Gentoo-Bug: 438932
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=438932
2012-10-19 20:53:46 -05:00
William Hubbs
2ee3e9d952 Fix bashism in tmpfilesd scripts
Reported-by: <pesa@gentoo.org>
2012-10-19 13:02:30 -05:00
William Hubbs
6d84a4aed8 Oldnet: the loopback interface does not need sysfs 2012-10-16 20:56:34 -05:00
William Hubbs
76f76eb19a Migrate /var/run and /var/lock to symlinks
Now that we have full support for tmpfiles.d in OpenRC, we can migrate
/var/run and /var/lock to symbolic links to /run and /run/lock
respectively.
2012-10-16 14:33:27 -05:00
Christian Ruppert
8d9db8d02c Add Vim modeline 2012-10-16 21:00:45 +02: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
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
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
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
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
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
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
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
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
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
3e2018f5e9 Revert "Deprecate the network and staticroute scripts"
This reverts commit 5994e55937.
There are situations where these scripts can be useful, so I am bringing
them back. Also, I want to start discussions about simplifying the
OpenRC network stack.
2012-07-08 19:51:36 -05:00
William Hubbs
3df0bd64cb cgroups: allow users to turn off creation of controller cgroups
This adds a switch to not create the one-cgroup-per-controller setup of
cgroups.

reported-by: davidweb@klaftenegger.de
X-Gentoo-Bug: 423317
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=423317
2012-07-03 13:49:58 -05:00
William Hubbs
b3d47d5861 termencoding should not run on lxc
reported-by: Alexey Shvetsov <alexxy@gentoo.org>
2012-05-27 10:03:24 -05:00
William Hubbs
ee1a698451 do not umount /usr on linux systems
We can't really umount /usr on linux systems because /usr is a special
case if it is a separate filesystem which is handled by an initramfs.

reported-by: tamiko+GENTOO@kyomu.43-1.org
X-Gentoo-Bug: 415523
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=415523
2012-05-13 19:00:39 -05:00
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