Commit Graph

4356 Commits

Author SHA1 Message Date
Doug Barton
ea871df08c Clear up problems with /etc/rc.d/{abi|cleanvar|cleartmp} brought
to light by the PR.  Specifically, convert these three scripts
into good rc.d citizens, making sure that their functionality
is preserved, but the rc.d framework rules are not broken.

Add support for cleanvar as a regular rc.d script in the
default rc.conf, and document this in the man page.

Add a descriptive comment to rc.conf that regarding the
three emulation/compatibility services provided by abi
so users will not be confused by these services not having
their own startup scripts.

PR:		conf/84574
Submitted by:	Alexander Botero-Lowry
2005-12-19 10:57:00 +00:00
Ian Dowse
2e46a159cc Remove usbd(8) and all references to it. It is no longer necessary
since devd(8) now provides the same functionality.

Submitted by:	Anish Mistry
2005-12-15 01:04:51 +00:00
Xin LI
21aab1d809 Add /boot/firmware as iwi(4) now reads its firmware there.
Reminded by:	flz
2005-12-11 15:21:18 +00:00
Ian Dowse
558791fdb5 Move the remaining entries from usbd.conf to devd.conf. This now
makes usbd redundant.

PR:		conf/73799
Submitted by:	Anish Mistry
2005-12-11 00:18:28 +00:00
Doug Barton
af1f094777 Drop rcconf.sh now that it has been removed 2005-12-10 23:23:09 +00:00
Doug Barton
57e561c083 Remove rcconf.sh from /etc/rc.d, and instead load the configuration
as part of rc. Doing this, and the sourcing of rc.subr after we have
determined if we are booting diskless (and correspondingly run
rc.initdiskless if necessary) are safe, and actually allow fewer files
to be needed on the diskless box. This also allows variables from
the configuration to be available to rc itself, such as ...

Add a variable to rc.conf, early_late_divider, which designates the
script which separates the early and late stages of the boot process.
Default this to mountcritlocal, and add text to etc/defaults/rc.conf,
rc.conf(5) and diskless(8) which describes how and why one might want
to change this.

Reviewed by:	brooks
2005-12-10 20:21:46 +00:00
Doug Barton
0868a57db0 Silence a warning about empty directories in all the places it might
occur.

Reminded by: yar
2005-12-10 20:19:08 +00:00
Doug Barton
019cd8e648 Use of REQUIRE is better than BEFORE for most scripts, and very
few scripts should have no REQUIRE at all.
2005-12-10 19:49:03 +00:00
Ruslan Ermilov
02c29dd14d Files are installed with mode 444 by default. 2005-12-09 15:19:31 +00:00
Yaroslav Tykhiy
0ce3dc049a Since rc.subr is a library of functions, it should not use exit
every now and then.  It is up to the caller to choose a proper
action upon an error condition.  Therefore, use return, not exit,
except for some special cases.

Consistently return 1 to indicate an error.

Submitted by:	sem (initially)
Reviewed by:	freebsd-rc (silence)
MFC after:	2 weeks
2005-12-06 05:27:11 +00:00
Doug Barton
b37ccb58ef Change how *.sh scripts are handled. If the script is in /etc/rc.d,
source it into the shell. If not, handle it in a subshell the same
way that "real" rc.d-style scripts are handled. This will dramatically
ease the "process local scripts in the base rcorder" transition.

Add *.bak to the list of files in */rc.d that we ignore.
2005-12-05 07:04:15 +00:00
Brooks Davis
b09abb4b2c Don't bogusly depend on dhclient. It's now run either by
/etc/rc.d/netif or from devd rather than by the startup scripts.
2005-12-03 01:33:06 +00:00
Ruslan Ermilov
6affdd3055 "-o rw" is invalid and undocumented mount option that
is only present for fstab(5) compatibility, and is
otherwise ignored by mount(8) (not passed to mount_*
programs, and not passed to nmount(2)).

"-u -o rw" worked with an old mount(8) with mount_ufs.c
because "-o rw" was stripped and simple "-u" caused an
update of UFS from read-only to read-write, due to
inability of mount(2) to track changes in options
(MNT_RDONLY is either set or not).

"-u" no longer causes the transition from RO to RW,
now that mount(8) was converted to use nmount(2), so
an explicit change to RW is required.  Keep up with
this change, and use "-uw" to mount root read-write.
2005-12-02 21:33:43 +00:00
Doug Barton
97ec6eba65 Brooks pointed out a case where tmp needs to be run after
mountcritremote, so force it the other way instead.
2005-12-02 20:35:23 +00:00
Doug Barton
0f3ce2b32c Introduce startup scripts from the local_startup directories to
the base rcorder. This is accomplished by running rcorder twice,
first to get all the disks mounted (through mountcritremote),
then again to include the local_startup directories.

This dramatically changes the behavior of rc.d/localpkg, as
all "local" scripts that have the new rc.d semantics are now
run in the base rcorder, so only scripts that have not been
converted yet will run in rc.d/localpkg.

Make a similar change in rc.shutdown, and add some functions in
rc.subr to support these changes.

Bump __FreeBSD_version to reflect this change.
2005-12-02 20:06:07 +00:00
Doug Barton
0eeba503f6 Force this script to run before mountcritremote to avoid
non-deterministic behavior when introducing local_startup
scripts to rcorder.
2005-12-02 19:54:57 +00:00
Joseph Koshy
8334958a7f Add a -f configfile option to devd(8), based on a patch submitted by
Wojciech A. Koszek.

Submitted by:	Wojciech A. Koszek <dunstan@freebsd.czest.pl>
2005-11-24 14:39:41 +00:00
Doug Barton
a2362f35f6 Update the test for failed zone transfers to reflect BIND 9.3.1 semantics
Simplify the shell scripting a bit, and remove a useless grep | sed

The problem was pointed out by the PR, and I used part of the solution
suggested there, but the semantics changed again for 9.2.x -> 9.3.x.

PR:		conf/74228
Submitted by:	Jeremy Chadwick <freebsd@jdc.parodius.com>
2005-11-22 22:24:27 +00:00
Maksim Yevmenkin
f5937f20c1 Remove not needed redirection of kldstat -q output to /dev/null.
Noticed by:	pjd
MFC after:	3 days
2005-11-22 19:17:41 +00:00
Maksim Yevmenkin
e08872c40b Revise hcsecd(8) and sdpd(8) rc.d scripts one more time
- Use _prestart rc.d method to automatically kldload ng_btsocket(4) if needed;

- Rename "sdpd_user" to "sdpd_username" and "sdpd_group" to "sdpd_groupname"
  to avoid collision with "magic" variables;

Inspired by:	yar
MFC after:	3 days
2005-11-22 18:51:43 +00:00
Hajimu UMEMOTO
d1bb0919f0 don't match packets other than IPv4 against divert rule.
divert supports only IPv4.

Reported by:	SAITOU Toshihide <toshi__at__ruby.ocn.ne.jp>
Discussed with:	suz
MFC after:	1 day
2005-11-18 02:23:59 +00:00
Yaroslav Tykhiy
fd9791c1ea Avoid invoking the current script again when we need
to issue sub-commands, e.g., restart = stop + start.
By calling run_rc_command instead, we provide rc.d
scripts with full control over their configuration
variables.

For an example problem the former approach caused, see
http://lists.freebsd.org/pipermail/freebsd-rc/2005-October/000311.html

Reviewed by:	freebsd-rc
Tested by:	Dirk Engling erdgeist <at> erdgeist.org
MFC after:	2 weeks
2005-11-16 10:45:19 +00:00
Ruslan Ermilov
ebd3cef10b Diff reduction to RELENG_6. 2005-11-16 07:24:31 +00:00
Maksim Yevmenkin
14dba5fc90 Revise hcsecd(8) and sdpd(8) rc.d scripts.
- Have both scripts automatically kldload ng_btsocket(4). I did not want to
  do it, but its easier for users and it seems other scripts do similar things;

- Assign few variables after load_rc_config, so the /etc/rc.conf overrides
  actually work;

MFC after:	1 week
2005-11-15 20:36:26 +00:00
Brooks Davis
cda39c0193 Add a new configuration variable, ipv4_addrs_<ifn>, which adds one or
more IPv4 address from a ranged list in CIRD notation:

ipv4_addrs_ed0="192.168.0.1/24 192.168.1.1-5/28"

In the process move alias processing into new ipv4_up/down functions to
more toward a less IPv4 centric world.

Submitted by:	Philipp Wuensche <cryx dash freebsd at h3q dot com>
2005-11-14 23:34:50 +00:00
Maksim Yevmenkin
e4638e53d8 Add section to start/stop Bluetooth USB devices (via ng_ubt(4))
Submitted by:	Panagiotis Astithas ( past at ebs dot gr )
Reviewed by:	brooks, imp
MFC after:	1 week
2005-11-12 03:42:56 +00:00
Ruslan Ermilov
0069d4d8b1 Traditionally expand tabs here. 2005-11-11 21:05:40 +00:00
Xin LI
d9276f685b Add dev/speaker into include/ tree 2005-11-11 17:38:10 +00:00
Maksim Yevmenkin
cdf98ad3e7 Start integrating Bluetooth into rc.d system.
Introduce /etc/rc.d/bluetooth script to start/stop Bluetooth devices. It
will be called from devd(8) in response to device arrival/departure events.
It is also possible to call it by hand to start/stop particular device
without unplugging it.

Introduce generic way to set configuration parameters for Bluetooth devices.
By default /etc/rc.d/bluetooth script has hardwired defaults compatible
with old rc.bluetooth from /usr/share/netgraph/bluetooth/examples. These
can be overridden using /etc/defaults/bluetooth.device.conf file (system
wide defaults). Finally, there could be another device specific override
file located in /etc/bluetooth/$device.conf (where $device is ubt0, btccc0
etc.)

The list of configuration parameters and their meaning described in the
/etc/defaults/bluetooth.device.conf file. Even though Bluetooth device
configuration files are not shell scripts, they must follow basic sh(1) syntax.

The bluetooth.device.conf(5) and handbook update will follow shortly.

Inspired by:	Panagiotis Astithas ( past at ebs dot gr )
Reviewed by:	brooks, yar
MFC after:	1 week
2005-11-10 19:09:22 +00:00
Ralf S. Engelschall
b89ad281dc Backout r1.11...
> >   There is no need to explicitly add "status" to $extra_commands in
> >   the /etc/rc.d/pf script as it is implicitly added by /etc/rc.subr's
> >   run_rc_command() because of the existing $pf_program.
> >
> >   Submitted by:   Christoph Schug <chris@schug.net>

...because as yar@ points out: "[...] you were relying on evil
side-effects of the variable being named *_program. hose side-effect
have been eliminated since rc.subr rev. 1.42. [...] The point is that
the default "status" method is for rc.d scripts that handle startup and
shutdown of conventional daemons, and not for custom tasks like the pf
case."

The change is still valid in RELENG_6 (and still doesn't have to be
backed out) as long as rc.subr:r1.42 is not MFC'ed to RELENG_6, too.
2005-11-10 10:40:15 +00:00
Robert Watson
f61914743d Fix minor white space nit introduced in 1.102: use spaces, not tabs. 2005-11-08 09:53:28 +00:00
Ralf S. Engelschall
9d14a9a235 There is no need to explicitly add "status" to $extra_commands in
the /etc/rc.d/pf script as it is implicitly added by /etc/rc.subr's
run_rc_command() because of the existing $pf_program.

Submitted by:	Christoph Schug <chris@schug.net>
MFC after:	1 week
2005-11-03 13:17:49 +00:00
Brooks Davis
a8e1134a6b Add items to unmount to the front of the list so they are unmounted in
reverse (thus allowing /conf to be unmounted).
2005-11-01 01:36:58 +00:00
Brooks Davis
ed5b9e57cd Switch from pax to tar for extracting cpio archives. pax requires a
writable /tmp (or TMPDIR) and thus is unsuitable for this job.

Tested by:	Joerg Pulz <Joerg dot Pulz at frm2 dot tum dot de>
PR:		conf/88293
2005-10-31 22:00:44 +00:00
Brooks Davis
1c3a359b41 The -x <format> option of pax is for creation of archives, not
extraction.

This will allow cpio archive support to work, at least in situations
where /tmp is writable.  Because pax requires a writable /tmp it is
unsuitable for this task, but replacing it will come in a later commit.

Submitted by:	Joerg Pulz <Joerg dot Pulz at frm2 dot tum dot de>
PR:		conf/88293
2005-10-31 21:07:14 +00:00
Yaroslav Tykhiy
82b765987d Transforming "ppp-user" into just "ppp", step 5:
Finally, delete the old, unfittingly named file "ppp-user".
2005-10-29 05:12:14 +00:00
Yaroslav Tykhiy
10b58447d5 Transforming "ppp-user" into just "ppp", step 4:
The legacy script "/etc/netstart" will start "ppp", not "ppp-user".
2005-10-29 05:08:00 +00:00
Yaroslav Tykhiy
66ba402cd0 Transforming "ppp-user" into just "ppp", step 3:
Install "ppp" (just repocopied) instead of "ppp-user".
2005-10-29 05:05:52 +00:00
Ruslan Ermilov
2ad08c56d8 Add some significant Ukrainian dates.
PR:		88076
Submitted by:	Andriy Gapon
2005-10-28 21:25:28 +00:00
Yaroslav Tykhiy
df19ed6a02 Use ${name} in pathnames where appropriate.
The sendmail script already was on this way,
but it didn't reach the end of it yet.
2005-10-28 16:55:38 +00:00
Yaroslav Tykhiy
b29890a328 Use:
command="/path/to/${name}"

since it's applicable here.  It's the current style of rc.d.

Pointed out by:	pjd
2005-10-28 16:10:56 +00:00
Yaroslav Tykhiy
23b50ea745 Transforming "ppp-user" into just "ppp", step 1:
The rcorder(8) condition PROVIDE'd by the script
and REQUIRE'd by the others becomes "ppp".

The ultimate goal of the transformation is to reduce
confusion resulting from the fact that $name has been
"ppp" already.

Discussed with: pjd, -rc
2005-10-28 16:07:52 +00:00
Yaroslav Tykhiy
6fa3ee6c30 Override $command with $foo_program only if $command
has been set in the first place.  This should reduce
unwanted side-effects in rc.d scripts that don't mean
to use $command and rc.subr(8) methods associated with
it at all.

Discussed with:	brooks
Reviewed by:	-rc (silence)
2005-10-26 04:32:31 +00:00
Yaroslav Tykhiy
5a3c72ce8f Document that `reload' is not provided by default
yet it can be enabled when applicable.
2005-10-26 04:12:34 +00:00
Maxim Konovalov
4b401243a4 o Grammar.
Submitted by:	Ulrich Spoerlein
MFC after:	1 week
2005-10-24 08:53:21 +00:00
Yaroslav Tykhiy
180e996dfc Don't be lazy, set the "command" variable even if
/etc/defaults/rc.conf will provide foo_program, too.
By specifying "command" we explicitly say that we're
going to rely on rc.subr(8) default methods, and
rc.subr(8) will take advantage of this soon.

The majority of our rc.d scripts already set "command"
if appropriate, so fix just the non-compliant handful.
2005-10-23 14:06:53 +00:00
Jung-uk Kim
c9ea633926 wpa_supplicant(8) requires -D option for ndis(4) now. 2005-10-19 22:26:47 +00:00
John Baldwin
2e169ae820 Allow the process name to be in square brackets ([]) in _find_processes().
PR:		conf/82430
Submitted by:	Pavel Volkov pol at iib dot ru
MFC after:	1 week
2005-10-17 19:01:53 +00:00
Ruslan Ermilov
84f59115ec Remove redundant include. 2005-10-14 15:26:23 +00:00
Pawel Jakub Dawidek
384c6482df First start rc.d/ipsec and then rc.d/mountcritremote, so we can mount
NFS file system over IPsec.

Suggested by:	Tomasz Pi³at <tomasz.pilat@axelspringer.pl>
2005-10-12 22:14:44 +00:00