Commit Graph

694 Commits

Author SHA1 Message Date
William Hubbs
25c229cf83 sysfs.in: fix indentation 2014-07-14 15:58:50 -05:00
William Hubbs
57b9e601a9 init.d/local: bring functioning more in line with how sysctl works
- remove the has_executables variable since it isn't used.
- Convert the conditional calls to ewend/vewend to a single call to veend.
- Always call eend after all scripts are executed passing the appropriate
error code.

Because of this change, you will see only an overall status when
starting or stopping local unless you are using verbose mode.
2014-07-09 15:33:48 -05:00
Thomas D
c1de8c09bf Add support for verbose "local" service runscript
With this patch, the "local" service runscript will be verbose like the
"sysctl" service when 'rc_verbose="yes"' is set.

Example output successful start:

 * Stopping local ...
 *   Executing "/etc/local.d/00will-stop.stop" ...                  [ ok ]
 * Starting local ...
 *   Executing "/etc/local.d/00will-start.start" ...                [ ok ]
 *   Executing "/etc/local.d/01 test.start" ...                     [ ok ]

Example output with failing executables:

 * Stopping local ...
 *   Executing "/etc/local.d/00will-stop.stop" ...                  [ ok ]
 *   Executing "/etc/local.d/will-fail.stop" ...
mount: can't find foo in /etc/fstab
 *   Execution of "/etc/local.d/will-fail.stop" failed.             [ !! ]
 * Starting local ...
 *   Executing "/etc/local.d/00will-start.start" ...                [ ok ]
 *   Executing "/etc/local.d/01 test.start" ...                     [ ok ]
 *   Executing "/etc/local.d/will-fail2.start" ...
mount: can't find bar in /etc/fstab
 *   Execution of "/etc/local.d/will-fail2.start" failed.           [ !! ]
 *   Executing "/etc/local.d/will-fail.start" ...
mount: can't find foo in /etc/fstab
 *   Execution of "/etc/local.d/will-fail.start" failed.            [ !! ]

X-Gentoo-Bug: 489274
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489274
2014-07-05 13:12:30 -05:00
Kaarle Ritvanen
143f1c64c1 sysctl.Linux.in: remove -lxc from keywords
certain tunables can be set independently for each container

X-Gentoo-Bug: 516050
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516050
2014-07-04 08:33:55 -05:00
William Hubbs
56112a6f1f sysfs: Do not mount openrc cgroup if it is already mounted
We were not checking to see if /sys/fs/cgroup/openrc was already mounted
before we mounted it. This fixes that issue.
Thanks to Robin Johnson <robbat2@gentoo.org> for pointing this out.
2014-06-30 20:30:39 -05:00
Sven Vermeulen
6126700a07 SELinux filesystem is at /sys/fs/selinux
The SELinux filesystem has been moved to /sys/fs/selinux for quite some
time. We kept supporting /selinux for backwards compatibility, but it's
time to move forward on this.

X-Gentoo-Bug: 511718
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=511718
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2014-06-20 18:37:33 -05:00
Andrew Gregory
20d7b83150 tmpfiles.dev: remove --remove option
For compatibility with systemd.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-04-03 12:39:27 -05:00
Andrew Gregory
686ee62a79 tmpfiles: add support for --boot option
For compatibility with systemd-tmpfiles.

Fixes #17

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-03-27 11:36:41 -04:00
Mike Frysinger
4ee8e90ffe devfs: explicitly mount /dev/shm with mode=1777
The current code relies on the tmpfs mount defaulting to 1777
permissions.  If it doesn't, things break badly.

This can come up when tmpfs is disabled in the kernel and ramfs
is being used instead (the kernel will alias tmpfs to ramfs).
The default permissions for ramfs is 0755.
2014-01-23 12:01:53 -06:00
William Hubbs
561b53ef09 bootmisc: Remove console directories only if $RC_LIBEXECDIR is writable
X-Gentoo-Bug: 489368
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489368
2014-01-15 10:43:52 -06:00
William Hubbs
8352082eb6 devfs: add code to mount /dev
All Linux systems need /dev to be set up,so add code to devfs to do
this. The process devfs follows is below.

1. If static_dev is yes, nothing is done.
2. if /dev is an entry in fstab it is mounted or remounted based on that
entry.
3. If /dev is not in fstab, it attempts to mount /dev as a devtmpfs or
   tmpfs depending on which is defined in the kernel; devtmpfs is
   preferred.
4. If neither devtmpfs nor tmpfs is defined, it assumes the user wants
static /dev and prints a warning.

X-Gentoo-Bug: 492694
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=492694
2014-01-05 11:17:05 -06:00
William Hubbs
3470eda3f5 Rename runscript to openrc-run
This was requested by Debian, because the minicom software, which is
available on Debian and other distros, has a binary named runscript. We
are keeping a backward compatibility symlink for now, but this allows
Debian or any other distro to safely remove the symlink.

X-Gentoo-Bug: 494220
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494220
2013-12-29 22:57:31 -06:00
Petre Rodan
235f94c4c5 bootmisc.in: fix boot order
Bootmisc was running before the root file system was remounted rw in
some situations. This fixes that issue.

X-Gentoo-Bug: 493442
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493442
2013-12-08 12:42:31 -06:00
Andrew Gregory
d711663189 network.in: skip loopback device
The loopback interface is supposed to be handled by the loopback
service, but sys_interfaces includes it.  This causes network to try to
start it and means that network provides net even if lo is the only
interface configured.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-12-06 13:24:58 -06:00
William Hubbs
60d288a877 remove type command
The posix equivalent of the type command is "command -v", so now we use
that. Thanks to Jonathan Callen <jcallen@gentoo.org> for informing me
wrt the fix.
2013-12-02 02:08:40 -06:00
William Hubbs
579838d2e7 bootmisc: do not run clean_run on VSERVER systems
X-Gentoo-Bug: 489370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489370
2013-10-28 15:21:50 -05:00
William Hubbs
9238d94d64 loopback: do not run in a prefix or vserver
X-Gentoo-Bug: 489370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489370
2013-10-28 12:37:22 -05:00
William Hubbs
d2988dc7dd remove redundant sync calls
The localmount and mount-ro scripts were flushing pending disk writes by
calling sync twice in succession. This is no longer necessary; see the
bug report and blog post for reasons we were still doing this.

Reported-by: Patrick Lauer <patrick@gentoo.org>
X-Gentoo-Bug: 487382
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=487382
2013-10-18 16:32:51 -05:00
Alexander V Vershilov
66970394ab Add uml keyword to fsck service.
Fix relevant an issue mentioned by Toralf Förster.

X-Gentoo-Bug: 481096.
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=481096
2013-10-14 17:05:19 -05:00
William Hubbs
4b37d3b16f netmount: add -lxc keyword
Netmount should not run on lxc, thanks to Mark van Dijk <funtoo@internecto.net>.
2013-10-08 10:34:45 -05:00
Daniel Robbins
e6df76a377 FL-786: localmount: support filesystem mounting on openvz 2013-10-04 15:16:05 -05:00
William Hubbs
4ce3cb90a0 init.d: update ignore patterns
Remove net.lo* from the ignore pattern since these scripts are no longer
part of OpenRC and add loopback and tmpfiles.dev.
2013-09-01 16:30:18 -05:00
William Hubbs
838c9efb36 Remove gentoo's net.* scripts
It has been determined that it will be best for gentoo's net.* scripts
to be in a separate package to allow independent development.
This package will be called netifrc and maintained by Gentoo.
2013-08-13 16:33:41 -05:00
Fedja Beader
6b0ffd3103 Fix Permission Denied on reading dmesg in an LXC container 2013-08-06 00:27:30 +02:00
Alexander V Vershilov
1c94d793c0 devfs: Add -lxc keyword
Devfs is not needed for LXC, as LXC mounts all required fs on
it's own. Reported by specing.
2013-07-31 12:40:56 -05:00
William Hubbs
e942e88b8c swapfiles: do not try to unmount all tmpfs mounts
This is handled in the swap script, so it should not be done here as
well.

X-Gentoo-Bug: 477534
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=477534
2013-07-26 12:15:29 -05:00
William Hubbs
35f2f1ec73 Introduce the tmpfiles.dev service
This service handles setting up the tmpfiles entries for the /dev
directory for Linux systems which needs to be run in the sysinit
runlevel.
2013-07-25 13:53:44 -05:00
Robin H. Johnson
02a7d3573d efivarfs: Support EFI variable access in 3.10 kernels.
In the 3.10 kernel, EFI variables are now provided by a dedicated
filesystem that needs to be mounted.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2013-06-24 15:42:56 -05:00
Eugeny Shkrigunov
10eabd4d92 fsck: fix typo
X-Gentoo-Bug: 467158
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=467158
2013-04-27 10:26:37 -05:00
William Hubbs
56f1752ce1 create loopback service
The loopback service handles the basic settings for the loopback
interface, regardless of the network manager you are using.
2013-04-08 12:46:51 -05:00
William Hubbs
19fa20832c localmount: add "no" in front of network file system types
On Linux, this was not an issue, but we may have been attempting to
mount network file systems twice on *bsd.

Reported-by: powerman-asdf@yandex.ru
x-Gentoo-Bug: 462210
x-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=462210
2013-03-22 14:50:27 -05:00
Yuta SATOH
f1ae8963c9 oldnet: convert netmask to decimal numbers in _netmask2cidr
Free BSD's ifconfig outputs a netmask in the form 0xffffff00, which
was translating to 0xff.0xff.0xff.0x00,. Now we convert this to decimal
numbers before we convert it to cidr notation.

Reported-by: 4glitch@gmail.com
X-Gentoo-Bug: 460268
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=460268
2013-03-08 15:30:36 -06:00
William Hubbs
3b05586a73 ipfw: change opts variable to extra_commands
Reported-by: 4glitch@gmail.com
X-Gentoo-Bug: 459694
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=459694
2013-03-06 12:48:20 -06:00
Andrew Gregory
8a44067838 Fix shebangs in services to point to the correct location of runscript
SBINDIR and BINDIR can be set independently of PREFIX.  This fixes
broken shebangs in service files when SBINDIR is set to something other
than PREFIX/sbin

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-23 20:30:39 -06:00
Andrew Gregory
89bb04a01a do not use SYSCONFDIR for binfmt.d
This makes binfmt.d consistent with tmpfiles.d and systemd which uses
hard coded paths for both.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-16 20:46:34 -06:00
Andrew Gregory
746bf5f783 consolefont: use setfont to save the current font
Using setfont directly to save the font prevents breakage
when a distro stores consolefonts in a location other than
/usr/share/consolefonts such as Arch which stores them in
/usr/share/kbd/consolefonts

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-16 19:51:15 -06:00
William Hubbs
1831e433a0 bootmisc: Skip cleaning /var/run or tmp directories if they are tmpfs
Reported-by: walter@pratyeka.org
X-Gentoo-Bug: 454338
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=454338
2013-02-16 02:06:26 -06:00
William Hubbs
86dbd757e9 keymaps: fix the use of loadkeys in the euro fix
The loadkeys man page states that if you don't pass a filename loadkeys
will read from stdin. However, this is not correct, so we now pass "-"
as the filename to explicitly request stdin.

Reported-by: andi@grois.info
X-Gentoo-Bug: 457524
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=457524
2013-02-15 16:09:49 -06:00
William Hubbs
f30eec03ce devfs: Mount the posix message queue file system
Reported-by: reuben.m@gmail.com
X-Gentoo-Bug: 456998
X-Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=456998
2013-02-14 17:53:53 -06:00
William Hubbs
5bfebbecea Rename shutdown_network setting to keep_network
We were telling users that setting shutdown_network=YES would shut down
the network interfaces during shutdown, but this was exactly the
opposite of what we were doing. The default was YES, which was keeping
the interfaces active.

This keeps the default behavior, but renames the setting to keep_network
which more accurately describes its function, and instructs users to set
it to NO if they want the network interfaces to go down.
2013-02-11 09:45:14 -06:00
William Hubbs
1280b97749 oldnet: add support for shutdown_network from newnet
This setting, already in use in newnet, allows the user to control
whether network interfaces are stopped when the system shuts down. By
default, under newnet, they are not, so I am making oldnet have the same
default.

A side-affect of this is that in the default configuration this fixes
bugs like the one below.

Reported-by: jerryfleming2006@gmail.com
X-Gentoo-Bug: 259183
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=259183
2013-02-11 09:08:34 -06:00
William Hubbs
bbc6b96a40 oldnet: accomodate rkhunter false positive
rkhunter thinks OpenRC is a rootkit because of the hidefirstrout
variable. This has been renamed to hideFirstroute in order to get past
rkhunter.

I realize this is not an openrc bug. In this case though I do not have a
problem renaming the variable.

Reported-by: ago@gentoo.org
X-Gentoo-Bug: 339714
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=339714
2013-02-09 17:39:32 -06:00
William Hubbs
8a6c3391bd sysfs: mount the fusectl file system
Reported-by: vapier@gentoo.org
X-Gentoo-Bug: 453740
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=453740
2013-02-01 13:49:02 -06:00
William Hubbs
8be072628c remove cruft from /run directory
The /run directory is a mount point for a tmpfs and should not contain
any files or directories.  This cleans out the /run/openrc
symlink and any other files which were incorrectly placed in /run.
Thanks to Ian Stakenvicius for pointing out this solution.
2013-01-31 12:11:53 -06:00
Alexander Tsoy
2b0ff6f669 net.lo: add ipv6 net and host patterns
X-Gentoo-Bug: 442594
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=442594
2012-12-21 14:24:27 -06:00
Mihai Moldovan
a61fdd019e net.lo: allow address families to be set on routes
X-Gentoo-Bug: 447310
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?d=447310
2012-12-20 16:02:11 -06:00
Mike Frysinger
7557d62870 net.lo: sleep *after* carrier check
For devices that are always connected (e.g. ethernet cards), the current
carrier always wastes time by sleeping for 1 second.  This is because the
code sleeps first, then checks for carrier.  Invert the order so that we
return quickly for devices already active.  For devices which are not yet
up, there shouldn't be any real difference.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-12-18 00:24:02 -05:00
Mike Frysinger
2c60282ba9 fsck: simplify skiplist setup
Use printf rather than a manual for loop.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-12-18 00:24:02 -05:00
Steve L
8d61d03e27 localmount: quoting fixes
X-Gentoo-Bug: 446556
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=446556
2012-12-16 20:00:01 -06:00
William Hubbs
c5e163cffc typo fixes 2012-11-30 12:05:26 -06:00
William Hubbs
5cce37837b localmount: only skip unmounting /usr if it was premounted
Add a test when localmount is started to determine if /usr is mounted
from inside an initramfs for Linux systems. If it is not, we can unmount it when
localmount stops.

On *bsd systems, we always unmount /usr if it is separate.

Reported-by: ryao@gentoo.org
2012-11-29 10:19:20 -06:00
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
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
Ed Wildgoose
60d8d4f5bb do not delete addresses when stopping a ppp interface.
This is important in situations where ppp is being used in a demand
dialing setup.

X-Gentoo-Bug: 359069
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=359069
2011-03-21 23:55:55 -05:00
William Hubbs
87302487d2 savecache should not fail if we are shutting down
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
2011-03-06 11:50:06 -06:00
Sebastian Thorarensen
bae0a693a9 Set unicode mode immediately at boot without consolefont
X-Gentoo-Bug: 354793
X-Gentoo-Bug-URL: http://bugs.gentoo.org/354793
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2011-02-14 18:54:35 -05:00
Mike Frysinger
35d38c3561 local: quote script names to handle spaces
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-02-14 12:06:58 -05:00
Mike Frysinger
11fcb0217e hwclock: fix typo from an earlier style commit
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-02-14 12:06:58 -05:00
Anthony G. Basile
c8b5078660 Fix bug #354805 2011-02-14 04:41:08 -05:00
William Hubbs
ebd79394a3 set timezone if RC_HCTOSYS is not set
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
2011-02-09 23:15:24 -06:00
William Hubbs
19037cbd83 remove unnecessary shell calls
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.
2011-02-04 17:46:57 -06:00
William Hubbs
cca7e9f7e1 use immediate evaluation for shell calls
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
2011-01-31 14:05:57 -06:00
William Hubbs
fa1fefb2bc add option to disable setting the system clock on boot for linux systems
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
2011-01-24 21:37:51 -06:00
William Hubbs
10ce67886d change local to run programs
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
2011-01-20 12:50:29 -06:00
Mike Frysinger
faa2df1159 more whitespace cleanup
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-17 04:49:12 -05:00
Chris Richards
92b6262ac7 Bug 349571 - SELinux fixes for bootmisc
- 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.
2011-01-06 18:20:53 -06:00
William Hubbs
b2e9b91852 bug #349443: remove -openvz keyword from sysctl service
Openvz supports sysctl settings which are different from the host
settings, so allow the sysctl service to run for openvz systems.
2010-12-28 13:54:19 -06:00
Robin H. Johnson
7f7baa6c3c Bug #266659: we really need to allow peer, pointtopoint in parsing config lines. 2010-12-11 18:29:34 -08:00
Robin H. Johnson
e431599d08 Add "after lvm modules" as Flameeyes reports that LVM is starting too late on his system in some cases. 2010-12-11 14:25:46 -08:00
William Hubbs
84750f5722 bug 232347: fix netmount to respect _netdev option
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.
2010-12-07 11:54:03 -06:00
William Hubbs
cdf07b5970 localmount should only use the -O option for linux systems
This fixes bug #347307.
2010-11-30 15:40:44 -06:00
William Hubbs
82b265016a send error output from chattr command to /dev/null
This is for bug #346659.
2010-11-26 14:54:30 -06:00
William Hubbs
9e5b9abf40 remove "use hostname" from sysctl for bsd systems 2010-11-16 10:03:05 -06:00
William Hubbs
ac37dc2764 do not mount local file systems with the _netdev option in fstab
This fixes #344947.
2010-11-15 12:01:48 -06:00
William Hubbs
6d9137d6c4 remove support for local.start and local.stop for bug #343709
The openrc ebuild now migrates these files to /etc/conf.d/local, so we
do not need to support them.
2010-11-10 10:55:28 -06:00
William Hubbs
2fa6bb0d48 add warnings about local.start and local.stop for bug #343709
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.
2010-11-05 13:42:33 -05:00
Diego Elio Pettenò
09bed967bf Allow cleaning up of pam_mktemp-based temporary directories.
This was blacklisted before, so the .private directories never had their
content cleaned up, even if WIPE_TMP was set to yes.
2010-10-31 16:18:38 -05:00
Jory A. Pratt
7653ef89b8 remove 'use hostname' bug 340991, Thanks Diego 2010-10-23 23:52:43 -05:00
Jory A. Pratt
14c95ae9a6 update consolefont/keymap to include -lxc in keywords 2010-08-10 08:21:08 -05:00
William Hubbs
d3ccbdb5a9 allow ip to be in /sbin or /bin
This makes it possible for the "ip" program in iproute2 to be installed
in /sbin or /bin.
2010-08-09 20:01:15 -05:00
William Hubbs
6f24d1cbd8 fix typo
I made a typo while manually transferring over Roy's last commit.  This
fixes that typo.
2010-07-10 15:31:16 -05:00
William Hubbs
6850566be0 remove extra route
This was taken from Roy Marples' git repository.
2010-07-07 19:42:56 -05:00
Roy Marples
67b538fd26 Fix tentative ip addresses 2010-03-24 20:25:42 +00:00
Roy Marples
0276c4f516 Release openrc-0.6.1 2010-03-22 20:02:12 +00:00
Mike Frysinger
ecf9ef49a7 random spelling fixes
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-01-08 22:02:51 +00:00
William Hubbs
2c0a71172d default route commands on Linux now require gw or via (iproute2). 2009-12-19 08:03:35 +00:00
Roy Marples
a165fbe384 Support inet6 routes. 2009-12-14 19:31:18 +00:00
Roy Marples
02c12c1cac Allow "dev eth0" to work for a default route. 2009-12-14 19:01:03 +00:00
Roy Marples
084f5e12eb Fix restart with iproute2 2009-12-14 14:21:30 +00:00
Roy Marples
3b9eaea8ec Don't add broadcast addresss to ipv6 2009-12-14 10:14:39 +00:00
Roy Marples
9476a2e721 Typo 2009-12-11 09:26:43 +00:00
Roy Marples
1d174cc60c Move on_ac_power to a shell script.
Fixes #204
2009-12-10 22:30:56 +00:00
William Hubbs
12af86395f Allow ip to add the default route.
Fixes #211.
2009-12-10 22:08:51 +00:00
Roy Marples
775d56b877 Document multiple routes, fixes #210. 2009-12-05 21:23:39 +00:00
Roy Marples
22e2a4f0a1 Add support for iproute2 in staticroute.
Fixes #208.
2009-12-05 20:05:43 +00:00
Roy Marples
89a2d76772 Rework around new kbd-1.15.1, Gentoo #289265. 2009-11-13 22:21:50 +00:00
Roy Marples
80d4ce3a11 Add a --warn option to just warn when reference file does not exist.
Fixes Gentoo #291894.
2009-11-13 21:31:09 +00:00
Roy Marples
d21177e5c7 Ensure we have a valid broadcast address. 2009-11-11 00:31:32 +00:00
Roy Marples
d29daf3952 fsck only checks battery when requested, which is not by default.
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.
2009-11-10 22:50:48 +00:00
Roy Marples
1d9ce8e9a1 Allow sysctl to read confs from /etc/sysctl.d
Fixes #203.
2009-11-10 22:40:35 +00:00
William Hubbs
bb96dc4e01 Fix iproute2 support.
Fixes Gentoo #289762.
2009-11-10 21:19:17 +00:00
Jan Psota
ebb49805fc Don't punt /var/log/wtmp if it exists, just create if it does not.
Fixes Gentoo #289849.
2009-11-10 20:09:44 +00:00
Roy Marples
95ee39ab1c Add support for Linux Containers, fixes #202.
Patch by bug reporter.
2009-11-04 19:21:24 +00:00
Roy Marples
3c8ea5896a Fix default domain 2009-10-25 00:03:20 +01:00
Roy Marples
d27655c908 Add domainname to the network script 2009-10-16 12:04:20 +01:00
Roy Marples
baeb59cd2e Add a new staticroute init script so that .... static routes can be configured!
Fixes Gentoo #288421.
2009-10-16 08:08:22 +01:00
Roy Marples
da08e3822f Ensure ip brings interface up when adding addresses.
Fixes Gentoo #288889
2009-10-15 20:17:51 +01:00
Roy Marples
ac7af85813 Provide clock 2009-10-13 21:06:35 +01:00
Roy Marples
a8f6a9b654 Add new utility and init script swclock that sets the system time based on
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.
2009-10-13 08:03:45 +01:00