Commit Graph

19 Commits

Author SHA1 Message Date
lukem 2c25ae21eb Implement load_rc_config(), which takes the config name as an argument.
Currently this just loads /etc/rc.conf, but this will make it easier
for us and users to modify the config mechanism without modifying all
of /etc/rc.d/*.
2000-05-13 08:23:45 +00:00
lukem eabbaa2f0c implement three new variables for run_rc_command:
- ${name}_chdir	directory to cd to before running ${command}
    - ${name}_nice	nice level to run ${command} at
    - ${name}_user	user to run ${command} as

based on [misc/9954] by Dave Sainty <dave@dtsp.co.nz>, except that it works :)
2000-05-13 03:07:17 +00:00
lukem c8ddd6124a - prefix some more local variables with `_' (when you have a convention,
stick to it :-)
- simplify run_rc_script (no need to support fast* or force* here...)
- clarify some comments
2000-04-30 13:16:47 +00:00
lukem 0c2e1a2b7e change run_rc_command() to take the list of extra commands supported
from a variable ($extra_commands) as opposed to from $2-* on the
argument list. it's cleaner; and allows for the possibility of
multiple command arguments being passed to run_rc_command() in the
future.
2000-04-30 12:19:07 +00:00
lukem 0c5f67f0ac in check_pidfile and check_process, also match "(" + `basename prog` + ")" .
noted by veego@
2000-04-28 01:40:09 +00:00
lukem 0716b4f382 don't bother checking rc_configured each time run_rc_command executes; once in /etc/rc is enough 2000-04-26 15:06:46 +00:00
lukem caa2beb10e revert previous; the fast-start functionality already existed, and
works at multi-user boot. (starting /etc/rc after single user boot
doesn't exhibit this fast start behaviour).
2000-04-22 03:01:22 +00:00
simonb 5e6480feca Add an "rc_fastboot" variable check in rc.subr, that if set adds
"fast" to the start of the run_rc_command arg.

/etc/rc calls each rc.d script with rc_fastboot=yes so that rc.subr
aware scripts to use "faststart" to skip the process running check.
2000-04-19 04:26:22 +00:00
lukem 6096ea59cd * add:
check_pidfile	parse a pidfile for a pid, checking that the
			process is running, and print the matching pid
    check_process	print a list of running pids that match the procname
    run_rc_command	kitchen sink function to simplify creation of
			rc.d scripts
    run_rc_script	invoke an rc.d script appropriately
    rc_usage		print a usage string for an rc.d script
    err			similar to err(3)
    warn		similar to warn(3)
* add copyright
* remove islocalfs(); nothing uses it
2000-03-10 11:39:27 +00:00
drochner db20439533 repair diskless startup: "netstart" needs "sysctl" and "awk" now, thus
"/usr" must be mounted. mount_critical_filesystems() didn't mount it,
even if listed in "critical_filesystems", if it is nfs.
Solution: introduce another rc.conf variable
"critical_filesystems_beforenet" which contains filesystems to be mounted
before "netstart".
Perhaps "netstart" should be split up, but this would make things even
more complex...
1999-07-07 21:24:56 +00:00
nathanw 5e40cf296d Move the knowledge that /usr and /var should be mounted early from
rc.subr to the default rc.conf.
While this is no longer necessary to supress noise,
it increases the clarity of the situation and removes
one more bit of what should be adjustable configuration
from scripts that site admins shouldn't have to edit.

Addresses PRs misc/7406 and (partially) bin/7491.
1999-04-28 23:32:29 +00:00
cjs 1a3bfc2c1b When checking local status, jJust ignore not-found filesystems, rather
than printing an error, just as we do when we try to mount it.
1999-04-13 02:15:49 +00:00
cjs 668efbbcec Change mount_critical_filesystems() so that if given an argument
of "local" it will not mount filesystem types it identifies as
network file systems (currently just nfs). Call the function twice,
before networking starts with arg "local", after networking starts
with arg "network". Remove critfs_require_network as is now redundant.
1999-04-01 03:58:44 +00:00
mellon 8572695519 - Move critical filesystem mounting code into a shell function and put
that in rc.subr.
- Support critfs_require_network rc.conf variable.
1999-03-24 18:59:47 +00:00
lukem 77eeaedfe8 improve description comment 1998-02-28 22:56:11 +00:00
lukem 79201de07b * add synonyms for "yes": "true", "on", and "1"
* add synonyms for "no": "false", "off", and "0"
* remove unnecessary trailing semicolons (this is sh, not C)
1998-02-28 22:54:02 +00:00
lukem 6b18196f4c convert 'if .. else .. fi' into a 'case .. esac', and allow for any
uppercase/lowercase variations of 'yes' and 'no'. fixes [misc/4887]
sent in by "John F. Woods" <jfw@jfwhome.funhouse.com>
1998-01-26 04:36:26 +00:00
cjs ebb2301a41 Prune unused function. 1997-08-30 03:34:29 +00:00
cjs c3b0e18db8 Split rc.conf variables for starting programs into two: an on/off
switch and a set of flags. Get rid of DEFAULT flags entirely. Print
warnings if on/off switches are not set, or are set incorrectly.
Add a shell function to simplify this on/off switch testing.
1997-08-29 02:24:04 +00:00