Compare commits

..

105 Commits

Author SHA1 Message Date
William Hubbs
467f91d870 release openrc-0.9.6 2011-11-25 15:39:59 -06: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
40576a32d3 release openrc-0.9.5 2011-11-23 08:31:55 -06:00
William Hubbs
483db945e1 Fix typo 2011-11-23 08:17:33 -06: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
76fec58633 pass the per-interface metric to resolvconf
Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
x-Gentoo-Bug: 364907
x-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?364907
2011-11-22 08:50:26 -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
453d13296d rc: usage: do not output non-printable short options in usage
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-19 02:43:25 -05:00
Mike Frysinger
c21c1f1e59 rc: usage: optimize help string alignment output a little
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-19 02:42:41 -05:00
Mike Frysinger
c7cc685458 rc: fix style around case_RC_COMMON_GETOPT
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-19 02:33:11 -05: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
9a3d6c7600 Add MKSTATICLIBS switch
The MKSTATICLIBS switch, which defaults to yes, controls whether or not
static libraries are built and installed.

Reported-by: Agostino Sarubbo <ago@autistici.org>
x-Gentoo-Bug: 378267
x-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=378267
2011-11-18 08:55:30 -06:00
William Hubbs
a5ba2f3264 CGroups: fix group initialization
Make sure cpuset.cpus and cpuset.mems exist in the parent group before
attempting to copy them to the new group.
2011-11-18 08:32:06 -06:00
William Hubbs
62f4438376 CGroups: finish initializing the CGroup
When a CGroup is created, we need to copy cpuset.cpus and cpuset.mems
from the new group's parent into the new group before we can attach any
processes to it.
2011-11-17 23:55:32 -06:00
William Hubbs
0bbb764f70 Change RC_CGROUP to lower case 2011-11-17 16:42:03 -06:00
Patrick Lauer
20df56f0b2 Add CGroup support
X-Gentoo-Bug: 390297
X-Gentoo-Bug: http://bugs.gentoo.org/show_bug.cgi?id=390297
2011-11-17 16:22:59 -06:00
William Hubbs
66e99b6d63 Fix compile warning 2011-11-17 16:06:18 -06:00
Alessio Ababilov
260b61e9d8 on_ac_power: Fix AC adapter presence recognition
On several machines, a file corresponding to AC adapter can be named
ADP1. The on_ac_power script  checked for AC*, which does not match
ADP1, so the script always considered the adapter to be off.

X-Gentoo-Bug: 380933
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=380933
2011-11-17 11:55:44 -06:00
William Hubbs
5b1aaf8cc8 add support for extra_stopped_commands 2011-11-16 13:56:55 -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
Mike Frysinger
3f2e9c4e1f mountinfo: Do not error out if realpath fails
Reported-By: Dennis Schridde <devurandom@gmx.net>
X-Gentoo-Bug: 383333
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=383333
2011-11-15 15:19:55 -06:00
William Hubbs
476034dd95 net.example: Fix the bridge configuration example
The example of how to configure the bridge was invalid. It showed
invalid timer settings along with turning off stp. This update shows how
to turn on stp and set the timer settings to the defaults.

Reported-by: Sergey S. Starikoff < Ikonta@yandex.ru>
X-Gentoo-Bug: 389209
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=389209
2011-11-14 12:32:41 -06:00
Mike Frysinger
37294b4e82 net example: fix up grammar
X-Gentoo-Bug: 390295
X-Gentoo-Bug-URL: https://bugs.gentoo.org/390295
Reported-by: Patrick Lauer <patrick@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-12 15:33:03 -05:00
Mike Frysinger
16661d02e9 ssd: fix building when SYS_ioprio_set is missing
Older glibc's might not provide this.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-09 00:09:58 -05:00
William Hubbs
f46626dcfc add auto detection for lxc
Reported-by: Francesco Riosa <francesco+gentoo_bugzilla@pnpitalia.it>
X-Gentoo-Bug: 384151
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=384151
2011-11-07 08:39:16 -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
27713e3a41 Make sure we load external scripts before using eerror
Reported-by: Jochen Schlick <josch06@gmail.com>
X-Gentoo-Bug: 388715
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=388715
2011-11-02 08:31:43 -05: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
Stef Simoens
f94e883633 Add macvlan support
X-Gentoo-Bug: 384029
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=384029
2011-10-26 11:28:39 -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
9c77502f96 Make variable references in Makefiles consistent
Some variable references were written as $(foo), but the majority were
written as ${foo}. This commit changes all of the variable references
to using braces.
2011-10-19 12:22:23 -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
Christian Ruppert
7644e027fd Release OpenRC-0.9.4
X-Gentoo-Bug: 382299
X-Gentoo-Bug-URL: https://bugs.gentoo.org/382299
2011-10-16 17:35:12 +02:00
Robin H. Johnson
3ad849c5d6 Bug #385971: fix net.example reference
Add in wildcards for reference to net.example, so that users can find it
regardless of version and dodoc compression settings.

X-Gentoo-Bug: 385971
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=385971
Reported-By: Serkan Kaba <serkan@gentoo.org>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-10-08 18:53:13 +00:00
Robin H. Johnson
f6c27abeb5 net/vlan: respect txqueuelen/mac/broadcast/mtu options during creation.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-10-07 21:47:46 +00: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
4b63929878 Shutdown VLAN's before the actual/parent interface
Make sure the VLAN interfaces as well as its rules will be removed prior
to the actual/parent interface.
The VLAN configs are gone in vlan_post_stop() already so we have to use
vlan_pre_stop() instead.

Reported-by: Bernd Bednarz <bernd.bednarz@avira.com>
X-Gentoo-Bug: 380603
X-Gentoo-Bug-URL: https://bugs.gentoo.org/380603
2011-09-21 13:26:47 +02:00
Christian Ruppert
29693ecb7a Refactoring of commit bf49e59e3e
Make sure the RPDB rules will be removed.
2011-09-21 03:57:09 +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
Yun Zheng Hu
bf49e59e3e Don't do anything if the interface doesn't exist
iproute2_post_stop() does now check if the network interface still exist.

Reported-by: Yun Zheng Hu <hu@fox-it.com>
X-Gentoo-Bug: 379575
X-Gentoo-Bug-URL: https://bugs.gentoo.org/379575
2011-09-19 00:04:19 +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
Mike Frysinger
95adeb85ba runscript: simplify livecd-functions.sh loading
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-18 15:25:51 -04:00
Gilles Oivier
0e4d169a40 Fix the Internal Field Seperator when using ethtool
ethtool.sh didn't reset the Internal Field Seperator (IFS) properly.
It now does, by storing the old IFS to OIFS, which will be used later
in the for loop.

It also fixes the "ethtool_ring_<if>" option.

Reported-by: Alois Schmid <alois.schmid@gmx.de>
X-Gentoo-Bug: 368525
X-Gentoo-Bug-URL: https://bugs.gentoo.org/368525
2011-09-18 14:42:39 +02:00
Christian Ruppert
72e31e753d Improve missing openvpn/usermode-utilities warning message
as OpenRC can be used on other distributions as well.
2011-09-17 01:13:11 +02:00
Stefan Knoblich
645bbf2e0f Parse broadcast arp responses via arping (iputils) properly
ARP replies may/do contain two MAC addresses when using iputils's
arping so we have to use the first one because it's always the "From"
address - which is what we want.

Thanks to Stefan Knoblich <s.knoblich@axsentis.de> for the fixed pattern.

Reported-by: cl@exomail.to
X-Gentoo-Bug: 379181
X-Gentoo-Bug-URL: https://bugs.gentoo.org/379181
2011-09-17 00:16:10 +02:00
Christian Ruppert
539c4e5872 Print a warning if openvpn/tunctl are missing 2011-09-16 23:48:44 +02:00
Christian Ruppert
e14e78db16 Revert "Mount /run as early as possible"
This reverts commit 5ed4d084d9.
/run needs to be mounted after /proc.
2011-09-12 22:15:24 -05: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
a9738a8508 release openrc-0.9.3 2011-09-08 15:09:45 -05:00
William Hubbs
5cb985b6cc Credits for previous commit
Reported-By: i.Dark_Templar <dark_templar@hotbox.ru>
X-Gentoo-Bug: 381783
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=381783
2011-09-08 13:28:43 -05:00
Christian Ruppert
e2f1464f47 Use the real/actual path when looking for mounts
/proc/mounts contains real/actual paths so we should do the same in mountinfo.
2011-09-08 19:20:20 +02:00
Christian Ruppert
5df9dc1af5 Remove unused variable 2011-09-08 18:42:05 +02:00
William Hubbs
b42ab3b2f4 Use checkpath to create /run/lock 2011-09-07 15:11:04 -05:00
William Hubbs
5ed4d084d9 Mount /run as early as possible
This commit moves the code that mounts /run to the earliest possible
position in openrc.
2011-09-06 21:00:08 -05:00
William Hubbs
9be1a2a67b release openrc-0.9.2 2011-09-02 15:19:10 -05:00
Flex
6d5b452ef5 Do not ignore return code for custom script functions
X-Gentoo-Bug: 380317
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=380317
2011-09-02 11:32:30 -05: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
William Hubbs
70c159d47c release openrc-0.9.1 2011-09-01 17:19:20 -05:00
Diego
b71f3bd2fd Start-stop-daemon: remove call to pam_authenticate 2011-09-01 17:08:55 -05:00
William Hubbs
c5b14edda8 release openrc-0.9.0 2011-09-01 10:33:14 -05:00
William Hubbs
4ee62c7903 Libeinfo: do not suppress ewarn() messages
The ewarn() function was affected by the EINFO_QUIET environment
variable which lead to warning messages being suppressed. Warnings
should not be suppressed.

Reported-by: Hanno Boeck <hanno@gentoo.org>
X-Gentoo-Bug: 380073
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=380073
2011-08-22 12:39:26 -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
0c8bea2152 Improve processing of service directories and conf.d files
symbolic links should not be followed in an attempt to work out the name
of the service we are running. Also, @sysconfdir@/conf.d should be tried
as a backup directory for configuration files.

I would like to thank Robin Johnson for his input on this change.

X-Gentoo-Bug: 350910
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=350910
2011-07-31 10:00:48 -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
370e5c775a runscript: rename saveDir back to save to fix compile error 2011-07-26 16:58:42 -05:00
William Hubbs
df1f02ac84 Runscript: print deprecation warning for opts variable
Openrc uses the extra_commands and extra_started_commands variables to
list extra commands for services. Also, it supports the opts variable
which is used to assist migration from baselayout-1.

I am adding this warning to encourage switching from opts to
extra_commands/extra_started_commands.

I would like to remove support for opts eventually.
2011-07-26 12:19:59 -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
07694255a4 rename save and save2 for clarity
The names saveDir and saveLnk seem to better define how these variables
are used.
2011-07-20 14:38:55 -05:00
Robin H. Johnson
6fa6f9523f Rewrite iproute2 addr argument parsing.
This was originally to fix the fact that our code did not handle certain
orders of arguments in conversion, but it was easier to rewrite the
entire argument handling to support more options at the same time.

Now supports all options documented in the ip manpage, including the
IPv6-specific options that must be passed after the interface argument.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Reported-by: Tony Vroon <chainsaw@gentoo.org>
X-Gentoo-Bug: 366905
X-Gentoo-Bug-URL: https://bugs.gentoo.org/366905
2011-07-18 23:55:32 +00: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
William Hubbs
5541e5ba24 Add commit message information to style guide 2011-07-13 15:33:04 -05:00
Christian Ruppert
a74382d9cb Fix rc_service_value_get() to return multiple lines as well
As introduced in bug 372547 using service_get_value() in the init scripts
or using rc_service_value_get() directly will only return one line.
This patch fixes it by using the new rc_getfile() function, it returns even
multiple lines. We're still using a char *, so the lines will be appended
instead of added into new element.

X-Gentoo-Bug: 372547
X-Gentoo-Bug-URL: http://bugs.gentoo.org/372547
2011-07-13 21:32:13 +02:00
Mike Frysinger
fdaf1c65cd Add a new function, bool rc_getfile(const char *, char **, size_t *)
<snip>
Read the entire @file into the buffer and set @len to the
size of the buffer when finished. For C strings, this will
be strlen(buffer) + 1.
Don't forget to free the buffer afterwards!
</snip>

We also fix bug 374899 by adding this new function.

X-Gentoo-Bug: 374899
X-Gentoo-Bug-URL: http://bugs.gentoo.org/374899
2011-07-13 21:31:20 +02:00
Christian Ruppert
ef22868f36 Do not skip similar config options
OpenRC goes through the config and checks each option for duplicates.
Lets say we're on "rc_logger" currently and its the last option in the config
file and we previously defined rc_logger_path.

It now goes through all previous config options and compares those against the
current one "rc_logger" *but* it compares only the first N bytes, in this
case strlen("rc_logger"). So it strips the _path from "rc_logger_path" which
ends up into "rc_logger" and it compares that against the current one (also
		"rc_logger"), it would then simply override the previous definition.

This patch fixes this behaviour to always compare the full option / variable
names.
2011-07-09 23:15:16 +02: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
fe6cd23287 rc_log_path should be quoted 2011-07-06 18:38:52 -05:00
Christian Ruppert
05e3251467 Rename rc_logger_path to rc_log_path 2011-07-06 21:16:15 +02:00
William Hubbs
9a068c2500 The is_net_fs function should use extra_net_fs_list
This was pointed out to me by Morse on #gentoo-base, so I would like to
thank him for the patch.
2011-07-06 09:53:05 -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
Christian Ruppert
48dcc55b65 Document the new rc_logger_path option 2011-07-06 00:47:15 +02:00
Christian Ruppert
44dc7db4f8 Improve logging
Add "e" (O_CLOEXEC) to all fopen() calls.
Remove system() call and replace it by fopen() and friends.
This also fixes bug 368933

X-Gentoo-Bug: 368933
X-Gentoo-Bug-URL: https://bugs.gentoo.org/368933
2011-07-05 23:42:21 +02:00
Christian Ruppert
003d4ba15b Don't write into optarg, this also fixes a compiler warning. 2011-07-05 00:51:29 +02: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
William Hubbs
9076baa573 slight formatting change
Add a new line after "rc_runlevel()" for consistency.
2011-07-02 23:33:23 -05:00
Christian Ruppert
70a3a3cf39 Add --startas/-a back to the optstring
X-Gentoo-Bug: 373609
X-Gentoo-Bug-URL: https://bugs.gentoo.org/373609
2011-06-30 20:21:48 +02: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
Christian Ruppert
b6766c2544 Use RC_CONF instead of the hardcoded /etc/rc.conf 2011-06-28 18:45:39 +02:00
Mike Frysinger
c427d3c1fe net: ccwgroup: smooth up/down process
We need to bring the link up ourselves after we've properly configured
the device.  The common code tries to bring the link up itself, but it
does so before things are configured, and so it ends up failing.

When shutting down, we need to wait for the kernel to finish destroying
the interface.  Otherwise, when doing a restart, openrc is quick enough
to tell the kernel to destroy things, but then start trying to bring it
back up before the kernel has finished.

X-Gentoo-Bug: 367467
X-Gentoo-Bug-URL: http://bugs.gentoo.org/367467
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-28 00:02:11 -04:00
Joe Harvell
24ba795563 Only print the deprecation warning for --chuid/-c when using it
The deprecation warning has been printed when using the replecement functions as
well, bug 373243.
2011-06-27 23:20:47 +02:00
William Hubbs
e8413733c1 Revert "remove functions.sh symbolic link in init.d"
This reverts commit f4407ac83d.
2011-06-27 12:11:01 -05:00
William Hubbs
f4407ac83d remove functions.sh symbolic link in init.d 2011-06-27 11:56:12 -05:00
William Hubbs
512c69a106 update bug reporting information in README 2011-06-24 12:47:04 -05: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
224 changed files with 1051 additions and 797 deletions

View File

@@ -1,15 +1,10 @@
# OpenRC Makefile
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
include Makefile.inc
SUBDIR= conf.d etc init.d local.d man scripts sh src
# Build our old net foo or not
ifeq (${MKOLDNET},yes)
SUBDIR+= net doc
endif
SUBDIR= conf.d doc etc init.d local.d man net scripts sh src
# Build pkgconfig or not
MKPKGCONFIG?= yes

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.8.3
VERSION= 0.9.6
PKG= ${NAME}-${VERSION}

8
README
View File

@@ -14,9 +14,9 @@ MKPAM=pam
MKPKGCONFIG=no
MKRCSYS=prefix
MKSELINUX=yes
MKSTATICLIBS=no
MKTERMCAP=ncurses
MKTERMCAP=termcap
MKOLDNET=yes
PKG_PREFIX=/usr/pkg
LOCAL_PREFIX=/usr/local
PREFIX=/usr/local
@@ -70,9 +70,11 @@ of the system.
Reporting Bugs
--------------
Bugs should go to the Gentoo Bugzilla:
Since Gentoo Linux is hosting OpenRC development, Bugs should go to
the Gentoo Bugzilla:
http://bugs.gentoo.org/
You'll want the "Gentoo Linux" product and the "baselayout" component.
They should be filed under the "Gentoo Hosted Projects" product and
the "openrc" component.
History - by Roy Marples

View File

@@ -1,40 +0,0 @@
The following applies only to the newnet stack, which is not presently
maintained in OpenRC. The oldnet stack is maintained instead.
- Robin H. Johnson <robbat2@gentoo.org>, 2011/02/21
OpenRC Network Ideals
---------------------
The new style networking for OpenRC is very simplistic - provide a basic means
of configuring static interface address and routes whilst allowing the
possibility to run any command at any point.
In a nutshell, init.d/network is a wrapper around ifconfig(8) and
init.d/staticroute is wrapper around route(8).
In the Perfect World (TM) ifconfig should be able to configure everything
about the interface easily * . The BSD family almost get this right and Linux
epically fails.
* Only static configuration, including link setup.
For dynamic, static, IPv4LL, arping and per ssid IPv4 setup dhcpcd-5.x
provides your needs.
It fails because there are many tools to do the same job and often have
vastly different syntax where they could be similar. In other words, there
is no coherence.
OpenRC-0.4.x and older (inc Gentoo baselayout-1) had a collection of scripts
for each tool and allowed a script per interface. Over the years, this design
has proven very hard to maintain as each user has their own idea of how
things should work. Also, there were (and still are) race conditions.
So where do we go from here?
Well, it's possible to use the new network scripts using the tools
currently available. It's just harder as you have to know them and their
documentation can be lacking at times.
The correct end goal is a BSD style ifconfig tool.
I've started work on it, but the project has stalled somewhat.
It's display only right now and the source is not yet publicly available.
If you have the skills and share the vision then contact me privately and
we'll take it from there.

51
STYLE
View File

@@ -32,3 +32,54 @@ void foo(int c)
return ret;
}
##################
# COMMIT MESSAGES #
##################
The following is an example of a correctly formatted git commit message
for this repository. Most of this information came from this blog post
[1], so I would like to thank the author.
### cut here ###
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the present tense: "Fix bug" and not "Fixed
bug." This convention matches up with commit messages generated by
commands like git merge and git revert.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded by a
single space, with blank lines in between, but conventions vary here
- Use a hanging indent
Reported-by: User Name <email>
X-[Distro]-Bug: BugID
X-[Distro]-Bug-URL: URL for the bug (on the distribution's web site typically)
### cut here ###
If you did not write the code and the patch does not include authorship
information in a format git can use, please use the --author option of the
git commit command to make the authorship correct.
The Reported-by tag is required if the person who reported the bug is
different from the author and committer.
The X-[Distro]-Bug/Bug-URL tags are required if this commit is related
to a bug reported to us by a specific distribution of linux or a
*BSD. Also, [Distro] should be replaced with the name of the
distribution, e.g. X-Gentoo-Bug.
[1] http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

View File

@@ -1,19 +1,23 @@
DIR= ${CONFDIR}
CONF= bootmisc fsck hostname localmount network staticroute urandom
CONF= bootmisc fsck hostname localmount network staticroute urandom \
${CONF-${OS}}
TARGETS+= network staticroute
CLEANFILES+= network staticroute
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
CONF-FreeBSD= ipfw moused powerd rarpd savecore syscons
CONF-Linux= consolefont dmesg hwclock keymaps killprocs modules
CONF-NetBSD= moused rarpd savecore
include ${MK}/scripts.mk
SOS?= BSD
network: network.in network${SFX}
cat $^ > $@
network: network.in network.${SOS}
cp $@.in $@
[ -e $@.${SOS} ] && cat $@.${SOS} >> $@ || true
staticroute: staticroute.${SOS}
cp $@.${SOS} $@
staticroute: staticroute${SFX}
cp $@${SFX} $@

View File

@@ -1 +0,0 @@
CONF+= ipfw moused powerd rarpd savecore syscons

View File

@@ -1,2 +0,0 @@
CONF+= consolefont dmesg hwclock keymaps modules
SOS= Linux

View File

@@ -1 +0,0 @@
CONF+= moused rarpd savecore

View File

@@ -4,3 +4,7 @@ clean_tmp_dirs="/tmp"
# Should we wipe the tmp paths completely or just selectively remove known
# locks / files / etc... ?
wipe_tmp="YES"
# Write the initial dmesg log into /var/log/dmesg after boot
# This may be useful if you need the kernel boot log afterwards
log_dmesg="YES"

View File

@@ -13,6 +13,13 @@
#fsck_passno=">1"
#fsck_passno="<2"
# If passno is not enough granularity, you can also specify mountpoints to
# check. This should NOT be used for the default non-multiplexed fsck, or your
# system might not be checked. Additionally, it is mutually exclusive with
# the fsck_passno setting.
#fsck_mnt=""
#fsck_mnt="/home"
# Most modern fs's don't require a full fsck on boot, but for those that do
# it may be advisable to skip this when running on battery.
# WARNING: Do not turn this off if you have any JFS partitions.

3
conf.d/killprocs Normal file
View File

@@ -0,0 +1,3 @@
# If you wish to pass any options to killall5 during shutdown,
# you should do so here.
killall5_opts=""

View File

@@ -1,8 +1,10 @@
# You can define a list modules for a specific kernel version,
# a released kernel version, a main kernel version or just a list.
# The most specific versioned variable will take precedence.
#modules_2_6_23_gentoo_r5="ieee1394 ohci1394"
#modules_2_6_23="tun ieee1394"
#modules_2_6="tun"
#modules_2="ipv6"
#modules="ohci1394"
# You can give modules a different name when they load - the new name
@@ -10,10 +12,12 @@
#modules="dummy:dummy1"
# Give the modules some arguments if needed, per version if necessary.
# Again, the most specific versioned variable will take precedence.
#module_ieee1394_args="debug"
#module_ieee1394_args_2_6_23_gentoo_r5="ieee1394 ohci1394"
#module_ieee1394_args_2_6_23="tun ieee1394"
#module_ieee1394_args_2_6="tun"
#module_ieee1394_args_2_6_23_gentoo_r5="debug2"
#module_ieee1394_args_2_6_23="debug3"
#module_ieee1394_args_2_6="debug4"
#module_ieee1394_args_2="debug5"
# You should consult your kernel documentation and configuration
# for a list of modules and their options.

View File

@@ -1,4 +1,4 @@
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d. To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# please review /usr/share/doc/openrc*/net.example* and save your configuration
# in /etc/conf.d/net (this file :]!).

View File

@@ -1,7 +1,11 @@
DIR= ${DOCDIR}/openrc
SRCS= net.example.in
INC= net.example
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
%.example.in: %.example${SFX}
${CP} $< $@
include ${MK}/scripts.mk

View File

@@ -1,5 +0,0 @@
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${CP} $< $@

View File

@@ -1,5 +0,0 @@
SRCS+= net.example.in
.SUFFIXES: .Linux.in
.Linux.in:
${CP} $< $@

View File

@@ -1,5 +0,0 @@
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${CP} $< $@

View File

@@ -350,7 +350,7 @@
# By default we don't wait for wpa_supplicant to associate and authenticate.
# If you need to change this behaviour then you don't know how our scripts work
# and setting this value could cause strange things to happen.
# If you would like to, so can specify how long in seconds.
# If you would like it to wait, you can specify how long in seconds.
#associate_timeout_eth0=60
# A value of 0 means wait forever.
@@ -581,6 +581,18 @@
# NOTE: depend functions only work in /etc/conf.d/net
# and not in profile configs such as /etc/conf.d/net.foo
# MAC-VLAN support
# The following configuration can be used to create a new interface 'macvlan0'
# linked to 'eth0'
#macvlan_macvlan0="eth0"
# MAC-VLAN mode (private, vepa, bridge, passtru)
#mode_macvlan0="private"
# IP address, MAC address, ... are configured as a normal interface
#config_macvlan0="192.168.20.20/24"
#mac_macvlan0="00:50:06:20:20:20"
#-----------------------------------------------------------------------------
# Bonding
# For link bonding/trunking on 2.4 kernels, or kernels without sysfs
@@ -827,9 +839,9 @@
# Below is an example of configuring the bridge
# Consult "man brctl" for more details
#brctl_br0="setfd 0
#sethello 0
#stp off"
#brctl_br0="setfd 15
#sethello 2
#stp on"
# You can also configure the bridge or bridge members via sysfs on 2.6 kernels
# or newer. See the kernel bridge documentation for a description of these

View File

@@ -1,17 +1,33 @@
DIR= ${SYSCONFDIR}
CONF= rc.conf
SRCS= rc.conf.in rc.in rc.shutdown.in
BIN= ${BIN-${OS}}
CONF= rc.conf ${BIN-${OS}}
CLEANFILES+= rc.conf
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
SED_EXTRA-FreeBSD= -e 's:@TERM@:cons25:g'
BIN-FreeBSD= rc rc.shutdown rc.devd
CONF-FreeBSD= devd.conf
SED_EXTRA-Linux= -e 's:@TERM@:wsvt25:g'
BIN-Linux=
CONF-Linux=
SED_EXTRA-NetBSD= -e 's:@TERM@:wsvt25:g'
BIN-NetBSD= rc rc.shutdown
CONF-NetBSD=
SED_EXTRA= ${SED_EXTRA-${OS}}
include ${MK}/scripts.mk
# We can't use "ifndef" here because that treats set-but-empty
# as not-set which is not what we want
MKRCSYS ?= automagicplease
ifeq ($(MKRCSYS),automagicplease)
ifeq (${MKRCSYS},automagicplease)
# If the user isn't picking a default, then have the
# config go with runtime automagic detection #357247
rc.conf: SED_EXTRA += -e '/^rc_sys=""/s:^:\#:'

View File

@@ -1,4 +0,0 @@
SED_EXTRA= -e 's:@TERM@:cons25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
CONF+= devd.conf
BIN+= rc rc.shutdown rc.devd

View File

@@ -1,2 +0,0 @@
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in

View File

@@ -1,3 +0,0 @@
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
BIN+= rc rc.shutdown

View File

@@ -47,6 +47,10 @@
# logging can take place and as such cannot log the sysinit runlevel.
#rc_logger="YES"
# Through rc_log_path you can specify a custom log file.
# The default value is: /var/log/rc.log
#rc_log_path="/var/log/rc.log"
# By default we filter the environment for our running scripts. To allow other
# variables through, add them here. Use a * to allow all variables through.
#rc_env_allow="VAR1 VAR2"

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
# Inform RC that we are in the background and hotplugged
export IN_BACKGROUND=yes

View File

@@ -1,6 +1,6 @@
#!@SHELL@
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
# If $TERM is not set then assume default of @TERM@
# This gives us a nice colour boot :)

View File

@@ -1,6 +1,6 @@
#!@SHELL@
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
# Handle interrupts
trap : SIGINT SIGQUIT

View File

@@ -7,5 +7,5 @@ MK= ../mk
SED_EXTRA+= -e 's:@VARBASE@:/var:g'
include ${MK}/os.mk
include ${MK}/scripts.mk
include Makefile.${OS}

View File

@@ -1 +0,0 @@
PKG_PREFIX?= /usr/local

View File

@@ -1 +0,0 @@
PKG_PREFIX?=/usr

View File

@@ -1 +0,0 @@
PKG_PREFIX?= /usr/pkg

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=@PKG_PREFIX@/sbin/avahi-dnsconfd
command_args="$avahi_dnsconfd_args -D"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=@PKG_PREFIX@/sbin/avahi-daemon
command_args="$avahid_args -D"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=@PKG_PREFIX@/bin/dbus-daemon
pidfile=@VARBASE@/run/dbus/pid

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/sbin/dhcpcd
pidfile=/var/run/dhcpcd.pid

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=@PKG_PREFIX@/sbin/dnsmasq
command_args=$dnsmasq_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=@PKG_PREFIX@/sbin/hald
pidfile=@VARBASE@/run/hald/hald.pid

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/named
command_args=$named_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
: ${ntpd_config:=/etc/ntp.conf}
: ${ntpd_drift:=/var/db/ntpd.drift}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
vpn=${RC_SVCNAME#*.}
name="OpenVPN"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=@PKG_PREFIX@/sbin/polkitd
pidfile=@VARBASE@/run/polkitd/polkitd.pid

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/sshd
command_args=$sshd_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/wpa_supplicant
: ${wpa_supplicant_conf:=/etc/wpa_supplicant.conf}

View File

@@ -1,25 +1,42 @@
DIR= ${INITDIR}
SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
network.in root.in savecache.in staticroute.in swap.in swclock.in \
sysctl.in urandom.in
sysctl.in urandom.in ${SRCS-${OS}}
BIN= ${OBJS}
# Build our old net foo or not
ifeq (${MKOLDNET},yes)
_OLDNET= net.lo
endif
_NET_LO= ${_OLDNET}
INSTALLAFTER= _installafter_${_NET_LO}
CLEANFILES+= ${_NET_LO}
TARGETS+= ${_NET_LO}
INSTALLAFTER= _installafter_net.lo
CLEANFILES+= net.lo
TARGETS+= net.lo
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
NET_LO-FreeBSD= net.lo0
# Generic BSD scripts
SRCS-FreeBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are FreeBSD specific
SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
powerd.in syscons.in
NET_LO-Linux= net.lo
SRCS-Linux= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in \
killprocs.in modules.in mount-ro.in mtab.in numlock.in \
procfs.in sysfs.in termencoding.in migrate-run.in
NET_LO-NetBSD= net.lo0
# Generic BSD scripts
SRCS-NetBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are NetBSD specific
SRCS-NetBSD+= devdb.in swap-blk.in ttys.in wscons.in
%.in: %${SFX}
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
include ${MK}/scripts.mk
_installafter_: realinstall
_installafter_net.lo: realinstall
${INSTALL} -m ${BINMODE} net.lo ${DESTDIR}/${INITDIR}/${NET_LO}
${INSTALL} -m ${BINMODE} net.lo ${DESTDIR}/${INITDIR}/${NET_LO-${OS}}

View File

@@ -1,13 +0,0 @@
NET_LO= net.lo0
# Generic BSD scripts
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are FreeBSD specific
SRCS+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
powerd.in syscons.in
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

View File

@@ -1,9 +0,0 @@
NET_LO= net.lo
SRCS+= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in killprocs.in \
modules.in mount-ro.in mtab.in numlock.in procfs.in sysfs.in \
termencoding.in
.SUFFIXES: .Linux.in
.Linux.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

View File

@@ -1,12 +0,0 @@
NET_LO= net.lo0
# Generic BSD scripts
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are NetBSD specific
SRCS+= devdb.in swap-blk.in ttys.in wscons.in
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
extra_commands="save"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend()
{
@@ -10,12 +10,13 @@ depend()
keyword -prefix -timeout
}
dir_writeable()
dir_writable()
{
mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$
}
: ${wipe_tmp:=${WIPE_TMP:-yes}}
: ${log_dmesg:=${LOG_DMESG:-yes}}
cleanup_tmp_dir()
{
@@ -24,7 +25,7 @@ cleanup_tmp_dir()
if ! [ -d "$dir" ]; then
mkdir -p "$dir" || return $?
fi
dir_writeable "$dir" || return 1
dir_writable "$dir" || return 1
chmod a+rwt "$dir" 2> /dev/null
cd "$dir" || return 1
if yesno $wipe_tmp; then
@@ -88,7 +89,7 @@ start()
fi
done
if dir_writeable /var/run; then
if dir_writable /var/run; then
ebegin "Creating user login records"
local xtra=
[ "$RC_UNAME" = NetBSD ] && xtra=x
@@ -130,7 +131,7 @@ start()
cleanup_tmp_dir "$tmp"
done
if dir_writeable /tmp; then
if dir_writable /tmp; then
# Make sure our X11 stuff have the correct permissions
# Omit the chown as bootmisc is run before network is up
# and users may be using lame LDAP auth #139411
@@ -142,11 +143,13 @@ start()
fi
fi
if $logw || dir_writeable /var/log; then
# Create an 'after-boot' dmesg log
if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ ]; then
dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg
if yesno $log_dmesg; then
if $logw || dir_writable /var/log; then
# Create an 'after-boot' dmesg log
if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ ]; then
dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg
fi
fi
fi

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Sets a font for the consoles."
@@ -49,7 +49,7 @@ start()
retval=1
break
fi
x=$(($x + 1))
: $(( x += 1 ))
done
eend $retval

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/sbin/devd
command_args=$devd_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Creates the dev database"
@@ -11,7 +11,7 @@ depend()
start()
{
ebegin "Bulding the dev database"
ebegin "Building the dev database"
if [ /var/run/dev.db -nt /dev ]; then
:
else

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Mount system critical filesystems in /dev."

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Set the dmesg level for a cleaner boot"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Configures a specific kernel dump device."
@@ -19,7 +19,7 @@ start() {
}
stop() {
ebegin "Deactiving kernel core dump device"
ebegin "Deactivating kernel core dump device"
dumpon off
eend $?
}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Check and repair filesystems according to /etc/fstab"
_IFS="
@@ -48,8 +48,13 @@ start()
if [ -n "$fsck_passno" ]; then
check_extra="[passno $fsck_passno] $check_extra"
if -n "$fsck_mnt" ]; then
eerror "Only 1 of fsck_passno and fsck_mnt must be set!"
return 1
fi
fi
ebegin "Checking local filesystems $check_extra"
# Append passno mounts
for p in $fsck_passno; do
local IFS="$_IFS"
case "$p" in
@@ -58,10 +63,16 @@ start()
set -- "$@" $(fstabinfo --passno "$p")
unset IFS
done
# Append custom mounts
for m in $fsck_mnt ; do
local IFS="$_IFS"
set -- "$@" "$m"
unset IFS
done
if [ "$RC_UNAME" = Linux ]; then
fsck_opts="$fsck_opts -C0 -T"
if [ -z "$fsck_passno" ]; then
if [ -z "$fsck_passno" -a -z "$fsck_mnt" ]; then
fsck_args=${fsck_args--A -p}
if echo 2>/dev/null >/.test.$$; then
rm -f /.test.$$
@@ -91,7 +102,7 @@ start()
_reboot
fi;;
8) ewend 1 "Operational error"; return 0;;
12) ewend 1 "fsck interupted";;
12) ewend 1 "fsck interrupted";;
*) eend 2 "Filesystems couldn't be fixed";;
esac
_abort || return 1

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
extra_commands="reset"
: ${hostid_file:=/etc/hostid}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Sets the hostname of the machine."

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
extra_commands="save show"
@@ -85,7 +85,7 @@ start()
if [ -e /etc/adjtime ] && yesno $clock_adjfile; then
_hwclock --adjust $utc_cmd
retval=$(($retval + $?))
: $(( retval += $? ))
fi
# If setting UTC, don't bother to run hwclock when first booting
@@ -99,7 +99,7 @@ start()
else
_hwclock --systz $utc_cmd $clock_args
fi
retval=$(($retval + $?))
: $(( retval += $? ))
fi
eend $retval "Failed to set the system clock"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
# This is based on /etc/rc.firewall and /etc/rc.firewall6 from FreeBSD
@@ -59,7 +59,7 @@ start() {
return 1
fi
# Use a statefull firewall
# Use a stateful firewall
ipfw add check-state
ipfw add pass tcp from me to any established
@@ -123,7 +123,7 @@ start() {
ipfw add deny udp from any to any 520 in
# Noise from webbrowsing.
# The statefull filter is a bit agressive, and will cause some
# The stateful filter is a bit aggressive, and will cause some
# connection teardowns to be logged.
ipfw add deny tcp from any 80,443 to any 1024-65535 in

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Applies a keymap for the consoles."
@@ -47,7 +47,7 @@ start()
n=1
while [ $n -le $ttyn ]; do
kbd_mode $kmode -C $ttydev$n
n=$(($n + 1))
: $(( n += 1 ))
done
eend 0

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Kill all processes so we can unmount disks cleanly."
@@ -12,11 +12,11 @@ depend()
start()
{
ebegin "Terminating remaining processes"
killall5 -15
killall5 -15 ${killall5_opts}
sleep 1
eend 0
ebegin "Killing remaining processes"
killall5 -9
killall5 -9 ${killall5_opts}
sleep 1
eend 0
}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Executes user programs in @SYSCONFDIR@/local.d"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Mounts disks and swap according to /etc/fstab."
@@ -16,7 +16,7 @@ start()
{
# Mount local filesystems in /etc/fstab.
local types="noproc" x= no_netdev=
for x in $net_fs_list; do
for x in $net_fs_list $extra_net_fs_list; do
types="${types},${x}"
done
@@ -34,19 +34,17 @@ start()
stop()
{
# We never unmount / or /dev or $RC_SVCDIR
local x= no_umounts_r="/|/dev|/dev/.*|${RC_SVCDIR}"
no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib|/libexec"
# Bug 381783
local rc_svcdir=$(echo $RC_SVCDIR | sed 's:/lib\(32\|64\)\?/:/lib(32|64)?/:g')
local x= no_umounts_r="/|/dev|/dev/.*|${rc_svcdir}"
no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib(32|64)?|/libexec"
# RC_NO_UMOUNTS is an env var that can be set by plugins
OIFS=$IFS SIFS=${IFS-y}
IFS=$IFS:
local IFS="$IFS:"
for x in $no_umounts $RC_NO_UMOUNTS; do
no_umounts_r="$no_umounts_r|$x"
done
if [ "$SIFS" = y ]; then
IFS=$OIFS
else
unset IFS
fi
if [ "$RC_UNAME" = Linux ]; then
no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*"
@@ -70,12 +68,12 @@ stop()
einfo "Unmounting filesystems"
eindent
local fs=
for x in $net_fs_list; do
for x in $net_fs_list $extra_net_fs_list; do
fs="$fs${fs:+|}$x"
done
[ -n "$fs" ] && fs="^($fs)$"
do_unmount umount --skip-point-regex "$no_umounts_r" \
${fs:+--skip-fstype-regex} $fs --nonetdev
"${fs:+--skip-fstype-regex}" $fs --nonetdev
eoutdent
return 0

28
init.d/migrate-run.in Normal file
View File

@@ -0,0 +1,28 @@
#!@PREFIX@/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Released under the 2-clause BSD license.
description="Migrate /var/run and /var/lock to /run"
depend()
{
before *
after localmount
}
start()
{
return 0
}
stop()
{
if [ -d /run -a ! -L /var/lock -a ! -L /var/run ]; then
ebegin "Migrating /var/lock and /var/run to /run"
rm -rf /var/lock /var/run
ln -s /var/lock /run/lock
ln -s /var/run /run
eend 0
fi
return 0
}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
extra_commands="restore"
@@ -21,7 +21,7 @@ restore()
mixer -f "$mixer" \
$(cat "/var/db/${mixer#/dev/}-state") >/dev/null
veend $?
: $((retval += $?))
: $(( retval += $? ))
fi
done
}
@@ -40,7 +40,7 @@ stop()
vebegin "$mixer"
mixer -f "$mixer" -s >/var/db/"${mixer#/dev/}"-state
veend $?
: $((retval += $?))
: $(( retval += $? ))
done
eoutdent
eend $retval

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Loads a user defined list of kernel modules."
@@ -16,18 +16,21 @@ start()
# support compiled in ...
[ ! -f /proc/modules ] && return 0
local KV=$(uname -r)
local KV_MAJOR=${KV%%.*}
local x=${KV#*.}
local KV_MINOR=${x%%.*}
x=${KV#*.*.}
local KV_MICRO=${x%%-*}
local KV x y kv_variant_list
KV=$(uname -r)
# full $KV
kv_variant_list="${KV}"
# remove any KV_EXTRA options to just get the full version
x=${KV%%-*}
# now slowly strip them
while [ -n "$x" ] && [ "$x" != "$y" ]; do
kv_variant_list="${kv_variant_list} $x"
y=$x
x=${x%.*}
done
local list= x= xx= y= args= mpargs= cnt=0 a=
for x in "$KV" \
$KV_MAJOR.$KV_MINOR.$KV_MICRO \
$KV_MAJOR.$KV_MINOR \
; do
for x in $kv_variant_list ; do
eval list=\$modules_$(shell_var "$x")
[ -n "$list" ] && break
done
@@ -45,10 +48,7 @@ start()
fi
aa=$(shell_var "$a")
xx=$(shell_var "$x")
for y in "$KV" \
$KV_MAJOR.$KV_MINOR.$KV_MICRO \
$KV_MAJOR.$KV_MINOR \
; do
for y in $kv_variant_list ; do
eval args=\$module_${aa}_args_$(shell_var "$y")
[ -n "${args}" ] && break
eval args=\$module_${xx}_args_$(shell_var "$y")
@@ -57,7 +57,7 @@ start()
[ -z "$args" ] && eval args=\$module_${aa}_args
[ -z "$args" ] && eval args=\$module_${xx}_args
eval modprobe -q "$mpargs" "$x" "$args"
eend $? "Failed to load $x" && cnt=$(($cnt + 1))
eend $? "Failed to load $x" && : $(( cnt += 1 ))
done
einfo "Autoloaded $cnt module(s)"
}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Re-mount filesytems read-only for a clean reboot."
@@ -19,28 +19,26 @@ start()
# We need the do_unmount function
. "$RC_LIBEXECDIR"/sh/rc-mount.sh
eindent
local m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|${RC_SVCDIR}" x= fs=
m="$m|/bin|/sbin|/lib|/libexec"
# Bug 381783
local rc_svcdir=$(echo $RC_SVCDIR | sed 's:/lib\(32\|64\)\?/:/lib(32|64)?/:g')
local m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|${rc_svcdir}" x= fs=
m="$m|/bin|/sbin|/lib(32|64)?|/libexec"
# RC_NO_UMOUNTS is an env var that can be set by plugins
local OIFS=$IFS SIFS=${IFS-y} IFS=$IFS
IFS=$IFS:
local IFS="$IFS:"
for x in $no_umounts $RC_NO_UMOUNTS; do
m="$m|$x"
done
if [ "$SIFS" = y ]; then
IFS=$OIFS
else
unset IFS
fi
m="^($m)$"
fs=
for x in $net_fs_list; do
for x in $net_fs_list $extra_net_fs_list; do
fs="$fs${fs:+|}$x"
done
[ -n "$fs" ] && fs="^($fs)$"
do_unmount "umount -r" \
--skip-point-regex "$m" \
${fs:+--skip-fstype-regex} $fs --nonetdev
"${fs:+--skip-fstype-regex}" $fs --nonetdev
eoutdent
eend $?
}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
mouse=${RC_SVCNAME##*.}
if [ -n "$mouse" -a "$mouse" != "moused" ]; then
@@ -54,7 +54,7 @@ start()
local ttyv=
for ttyv in /dev/ttyv*; do
vidcontrol < "$ttyv" -m on
: $((retval+= $?))
: $(( retval += $? ))
done
fi

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Update /etc/mtab to match what the kernel knows about"
@@ -12,9 +12,9 @@ depend()
start()
{
# /etc/mtab could be a symlink to /proc/mounts
if [ ! -w /etc/mtab -a -L /etc/mtab ]; then
eeinfo "Skipping mtab update (non writeable symlink)"
if [ -L /etc/mtab ]
then
einfo "Skipping mtab update (mtab is a symbolic link)"
return 0
fi

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
MODULESDIR="${RC_LIBEXECDIR}/net"
MODULESLIST="${RC_SVCDIR}/nettree"
@@ -42,12 +42,25 @@ depend()
}
# Support bash arrays - sigh
_array_helper()
{
local _a=
eval _a=\$$1
_a=$(echo "${_a}" | sed -e 's:^[[:space:]]*::' -e 's:[[:space:]]*$::' -e '/^$/d' -e 's:[[:space:]]\{1,\}: :g')
[ -n "${_a}" ] && printf "%s\n" "${_a}"
}
_get_array()
{
local _a=
if [ -n "${BASH}" ]; then
case "$(declare -p "$1" 2>/dev/null)" in
"declare -a "*)
ewarn "You are using a bash array for $1."
ewarn "This feature will be removed in the future."
ewarn "Please see net.example for the correct format for $1."
eval "set -- \"\${$1[@]}\""
for _a; do
printf "%s\n" "${_a}"
@@ -57,10 +70,7 @@ _get_array()
esac
fi
eval _a=\$$1
printf "%s" "${_a}"
printf "\n"
[ -n "${_a}" ]
_array_helper $1
}
# Flatten bash arrays to simple strings
@@ -69,6 +79,9 @@ _flatten_array()
if [ -n "${BASH}" ]; then
case "$(declare -p "$1" 2>/dev/null)" in
"declare -a "*)
ewarn "You are using a bash array for $1."
ewarn "This feature will be removed in the future."
ewarn "Please see net.example for the correct format for $1."
eval "set -- \"\${$1[@]}\""
for x; do
printf "'%s' " "$(printf "$x" | sed "s:':'\\\'':g")"
@@ -78,10 +91,7 @@ _flatten_array()
esac
fi
eval _a=\$$1
printf "%s" "${_a}"
printf "\n"
[ -n "${_a}" ]
_array_helper $1
}
_wait_for_carrier()
@@ -105,7 +115,7 @@ _wait_for_carrier()
eend 0
return 0
fi
timeout=$((${timeout} - 1))
: $(( timeout -= 1 ))
[ "${efunc}" = "einfon" ] && printf "."
done
@@ -134,9 +144,9 @@ _netmask2cidr()
local i= len=
local IFS=.
for i in $1; do
while [ ${i} != "0" ]; do
len=$((${len} + ${i} % 2))
i=$((${i} >> 1))
while [ ${i} -ne 0 ]; do
: $(( len += i % 2 ))
: $(( i >>= 1 ))
done
done
@@ -267,7 +277,7 @@ _gen_module_list()
echo "module_${i}_program_start='${PROGRAM_START}'" >> "${MODULESLIST}"
echo "module_${i}_program_stop='${PROGRAM_STOP}'" >> "${MODULESLIST}"
echo "module_${i}_provide='${PROVIDE}'" >> "${MODULESLIST}"
i=$((${i} + 1))
: $(( i += 1 ))
done
echo "module_${i}=" >> "${MODULESLIST}"
)
@@ -294,7 +304,7 @@ _load_modules()
local i=-1 x= mod= f= provides=
while true; do
i=$((${i} + 1))
: $(( i += 1 ))
eval mod=\$module_${i}
[ -z "${mod}" ] && break
[ -e "${MODULESDIR}/${mod}.sh" ] || continue
@@ -428,7 +438,7 @@ _load_config()
# so modules can influence it
for cmd; do
eval config_${config_index}="'${cmd}'"
config_index=$((${config_index} + 1))
: $(( config_index += 1 ))
done
# Terminate the list
eval config_${config_index}=
@@ -436,7 +446,7 @@ _load_config()
config_index=0
for cmd in ${fallback}; do
eval fallback_${config_index}="'${cmd}'"
config_index=$((${config_index} + 1))
: $(( config_index += 1 ))
done
# Terminate the list
eval fallback_${config_index}=
@@ -531,7 +541,7 @@ start()
if [ -n "${our_metric}" ]; then
metric=${our_metric}
elif [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ]; then
metric=$((${metric} + $(_ifindex)))
: $(( metric += $(_ifindex) ))
fi
while true; do
@@ -539,7 +549,9 @@ start()
[ -z "${config}" ] && break
set -- ${config}
ebegin "$1"
if [ "$1" != "null" -a "$1" != "noop" ]; then
ebegin "$1"
fi
eindent
case "$1" in
noop)
@@ -569,11 +581,11 @@ start()
eindent
eval config_${config_index}=\$config
unset fallback_${config_index}
config_index=$((${config_index} - 1))
: $(( config_index -= 1 ))
fi
fi
eoutdent
config_index=$((${config_index} + 1))
: $(( config_index += 1 ))
done
if ! ${oneworked}; then

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Mounts network shares according to /etc/fstab."
@@ -44,7 +44,7 @@ start()
[ -x @SYSCONFDIR@/init.d/rpcbind ] && pmap="rpcbind"
local x= fs= rc=
for x in $net_fs_list; do
for x in $net_fs_list $extra_net_fs_list; do
case "$x" in
nfs|nfs4)
# If the nfsmount script took care of the nfs
@@ -81,7 +81,7 @@ stop()
ebegin "Unmounting network filesystems"
. "$RC_LIBEXECDIR"/sh/rc-mount.sh
for x in $net_fs_list; do
for x in $net_fs_list $extra_net_fs_list; do
fs="$fs${fs:+,}$x"
done
if [ -n "$fs" ]; then
@@ -90,7 +90,7 @@ stop()
eindent
fs=
for x in $net_fs_list; do
for x in $net_fs_list $extra_net_fs_list; do
fs="$fs${fs:+|}$x"
done
[ -n "$fs" ] && fs="^($fs)$"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
# This script was inspired by the equivalent rc.d network from NetBSD.
@@ -219,6 +219,12 @@ start()
eend $?
fi
ewarn
ewarn "The $RC_SVCNAME script is deprecated and will be"
ewarn "removed in the future."
ewarn "Please use the net.* scripts to manage your network interfaces."
ewarn
einfo "Starting network"
routeflush
if [ "$RC_UNAME" = "Linux" ]; then
@@ -281,7 +287,7 @@ start()
tentative || break
[ $r = 5 ] && vebegin "Waiting for tentative addresses"
sleep 1
r=$(($r - 1))
: $(( r -= 1 ))
done
if [ $r != 5 ]; then
[ $r != 0 ]

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
required_files="/etc/newsyslog.conf"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/nscd
command_args=$nscd_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Turns numlock on for the consoles."
@@ -21,7 +21,7 @@ _setleds()
while [ $i -le $ttyn ]; do
setleds -D "$1"num < $dev$i || retval=1
i=$(($i + 1))
: $(( i += 1 ))
done
return $retval

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
name="Packet Filter"
: ${pf_conf:=${pf_rules:-/etc/pf.conf}}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/powerd
command_args=$powerd_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Mounts misc filesystems in /proc."
@@ -37,24 +37,24 @@ start()
fi
fi
# Setup Kernel Support for the NFS daemon status
if [ -d /proc/fs/nfsd ] && ! mountinfo -q /proc/fs/nfsd; then
if grep -qs nfsd /proc/filesystems; then
ebegin "Mounting NFS filesystem"
mount -t nfsd -o nodev,noexec,nosuid \
nfsd /proc/fs/nfsd
eend $?
fi
fi
# Setup Kernel Support for miscellaneous Binary Formats
if [ -d /proc/sys/fs/binfmt_misc ] \
&& ! mountinfo -q /proc/sys/fs/binfmt_misc; then
if [ -d /proc/sys/fs/binfmt_misc -a ! -e /proc/sys/fs/binfmt_misc/register ]; then
if grep -qs binfmt_misc /proc/filesystems; then
ebegin "Mounting misc binary format filesystem"
mount -t binfmt_misc -o nodev,noexec,nosuid \
binfmt_misc /proc/sys/fs/binfmt_misc
eend $?
if eend $? ; then
local fmts
ebegin "Loading custom binary format handlers"
fmts=$(grep -hsv -e '^[#;]' -e '^[[:space:]]*$' \
/run/binfmt.d/*.conf \
"/etc"/binfmt.d/*.conf \
""/usr/lib/binfmt.d/*.conf)
if [ -n "${fmts}" ]; then
echo "${fmts}" > /proc/sys/fs/binfmt_misc/register
fi
eend $?
fi
fi
fi

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/rarpd
command_args="-f $rarpd_args"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend()
{
@@ -33,7 +33,7 @@ start()
# Good to go!
"$svc" start && started="$started $svc"
: $((retval += $?))
: $(( retval += $? ))
done
service_set_value started "$started"
eend $retval "Some local rc services failed to start"
@@ -46,7 +46,7 @@ stop()
local svc= retval=0
for svc in $(rcorder $(service_get_value started) 2>/dev/null | sort -r); do
"$svc" stop
: $((retval += $?))
: $(( retval += $? ))
done
eend $retval "Some local rc services failed to stop"
return 0

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Mount the root fs read/write"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/rpcbind
command_args=$rpcbind_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Saves the caches OpenRC uses to non volatile storage"

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Saves a kernel dump."

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
# This script was inspired by the equivalent rc.d staticroute from NetBSD.
@@ -93,6 +93,11 @@ do_routes()
start()
{
ewarn
ewarn "The $RC_SVCNAME script is deprecated and will be"
ewarn "removed in the future."
ewarn "Please use the net.* scripts to manage your network interfaces."
ewarn
do_routes "Adding" "add"
}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend()
{

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend()
{

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Sets the local clock to the mtime of a given file."
@@ -16,7 +16,9 @@ depend()
start()
{
ebegin "Setting the local clock based on last shutdown time"
swclock --warn
if ! swclock 2> /dev/null; then
swclock --warn @PREFIX@/sbin/runscript
fi
eend $?
}

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend() {
need localmount

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend()
{

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend()
{

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Mount the sys filesystem."
@@ -50,6 +50,37 @@ mount_misc()
eend $?
fi
fi
# Setup Kernel Support for configfs
if [ -d /sys/kernel/config ] && ! mountinfo -q /sys/kernel/config; then
if grep -qs configfs /proc/filesystems; then
ebegin "Mounting config filesystem"
mount -n -t configfs -o nodev,noexec,nosuid \
configfs /sys/kernel/config
eend $?
fi
fi
# Setup Kernel Support for cgroup
if [ -d /sys/fs/cgroup ]; then
if grep -qs cgroup /proc/filesystems && \
! mountinfo -q /sys/fs/cgroup; then
ebegin "Mounting cgroup filesystem"
mount -n -t tmpfs -o nodev,noexec,nosuid \
cgroup /sys/fs/cgroup
eend $?
fi
if ! mountinfo -q /sys/fs/cgroup/openrc; then
ebegin "creating openrc control group"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup -o nodev,noexec,nosuid \
openrc /sys/fs/cgroup/openrc
echo 1 > /sys/fs/cgroup/openrc/notify_on_release
echo @LIBEXECDIR@/sh/cgroup-release-agent.sh \
> /sys/fs/cgroup/openrc/release_agent
eend
fi
fi
}
start()

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
command=/usr/sbin/syslogd
command_args=$syslogd_args

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2008-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
description="Configures terminal encoding."
@@ -31,7 +31,7 @@ start()
n=1
while [ ${n} -le "$ttyn" ]; do
printf "\033%s" "$termencoding" >$ttydev$n
n=$(($n + 1))
: $(( n += 1 ))
done
# Save the encoding for use immediately at boot

View File

@@ -1,6 +1,6 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# Released under the 2-clause BSD license.
depend()
{

Some files were not shown because too many files have changed in this diff Show More