Age | Commit message (Collapse) | Author |
|
better visual cues as to what's happening. Feedback/ok aja@ schwarze@
|
|
|
|
|
|
|
|
|
|
do that if pf is actually enabled (rely on pfctl -si)
requested by deraadt@
|
|
|
|
accordingly.
ok robert@
|
|
ok robert@
|
|
rc_pre() functions are returning correctly. This change
also simplyfies the changes because false || return 1 can be replaced
with false if that's the last call. thanks halex@!
|
|
ok robert@
|
|
|
|
|
|
|
|
|
|
switched a while back.
ok miod, kettenis
|
|
|
|
|
|
ok robert@ deraadt@
|
|
* if we try to reload a non running daemon, just exit gracefully, like
we do for 'stop'
* add an rc_check call right after rc_reload to make sure the daemon is
still around; until now we only checked the pkill(1) return code but
that is not enough
ok robert@
|
|
|
|
|
|
to the machine's hostname either because there is a network problem
or because /etc/hosts is wrong. while trying to resolve it also does
not change it's process name so let's cope with that in the rc script
|
|
|
|
From now on rc(8) is going to call these scripts to start them up on boot
in the same order than before.
In addition the inetd and rwhod variables in rc.conf are deprecated so that
inetd_flags and rwhod_flags should be used. The old flags are still going
to be used for some time to allow users to switch.
There are more rc modifications to come later so let's put this in so
we can base more work on this.
It is important to mention that you can still keep using rc.local just
like the way you did before, and we have no intention to remove that either.
I'd also like to thank ajacoutot@, halex@, sthen@ and schwarze@ for working
on this with me.
|
|
ajacoutot@ and robert@ couldn't really remember the reason to be different,
either
|
|
* Instead of nesting subshells, perform a linear series of operations
and bail out as soon as one of them fails.
* Rename rc_print to rc_exit, let it calculate the exit code itself
and let it exit, considerably simplifying error handling; new name
suggested by sthen@.
OK ajacoutot@ sthen@
|
|
the correct code according whether the daemon did start successfully or
not.
rc_wait()
This function has been extended, first we need to pass in which mode we
are running (start or stop) and second we can pass a number of seconds
to wait (optionnal, will default to 30s).
The function will return the correct code whether we are running during
"rc_cmd start" or "rc_cmd stop".
rc_cmd() start
If we are running in background mode, then we call rc_wait with the
"start" argument.
The sleep(1) is needed to prevent a race condition where the process
will appear in the list before failing and rc_check will see it as
running. Call rc_post() when failing to prevent being left in an
inconsistent state (because rc_pre() would have run successfully)
rc_cmd() stop
We are now calling rc_wait with the "stop" argument.
"looks good" sthen@, ok robert@
|
|
"1".
hint from MERIGHI Marcus
ok robert@
|
|
- As noticed by ajacoutot@, re_format(7) does not treat '\t' as a tab,
so some t's got stripped from daemon names.
- The tr(1) failed to sanitize mixtures of blanks and tabs.
ok ajacoutot@
|
|
- (ok) is only printed while in interactive mode, but (failed) stays
even for rc if the command fails
ok ajacoutot@
|
|
ok schwarze@
|
|
ok otto@, aja@
|
|
from Piotr Sikora
ok robert@
|
|
ok robert@
|
|
ok ajacoutot@
|
|
so remove that test condition. Commented by schwarze@, OK ajacoutot@
|
|
gets called from rc.local or rc.shutdown
- notify the user if a given operation was successfull or not by appending
the (ok) or (failed) strings to the end of the daemon name
- hide stdout and stdin unless RC_DEBUG=1 is set, otherwise all the function
names will be printed out and all output sent to stdin or stdout
- since from now on rc.subr is taking care of printing out the daemon names
on startup, we don't need to do this from rc.{local,shutdown} anymore
brainkilling work done by me and ajacoutot@, ok ajacoutot@
|
|
don't rc_post if rc_stop failed.
"I agree with the direction" sthen@
ok robert@
|
|
Use $() constructs as it's safer than ``.
Both req. by deraadt@
Use pkill instead of pgrep in rc_check so that we don't need to fiddle
with redirections in reload.
prodded by schwarze@
ok robert@
|
|
ok robert@
|
|
rc_stop so scripts don't need to set it.
ok sthen@ (on a much bigger diff) robert@
|
|
rc_cmd start/stop actions. This way when rc.d(8) scripts override these
functions, we don't loose rc_{pre,post}.
Add a max 5 secs loop after rc_stop in the rc_cmd top action. This seems
to be a good default for returning to command line only after the daemon
has really stopped. This fixes "restart" for some daemons and allows to
properly stop some others at shutdown time.
Note that this is just a best-effort default, some daemons may need a
lot more time to shutdown but this case is usually handled in the
rc.d(8) script itself and we obviously do not want to hang the shutdown
process.
Call rc_cmd start/stop in restart and _not_ rc_start/rc_stop which can
get overriden in a script.
discussed with and inputs from sthen@ and schwarze@
ok sthen@ robert@
|
|
a daemon in the background.
man page tweaks from schwarze@
discussed with an ok schwarze@ robert@
|
|
ok robert@ espie@ miod@
|
|
easily use it in rc scripts instead of copying/pasting the same huge
command lines everywhere.
ok robert@ sthen@
|
|
let's use it. If not, then fall back to using daemon.
While here, do some reordering.
"I like this" sthen@, ok robert@
|
|
As schwarze@ also stated, this will prevent anyone from calling it
(which would be an error) and makes it clearer that rc.subr is not just
a functions container.
No functionnal change, unless you were calling rc_conf from an rc script
which would have been wrong anyway.
ok schwarze@ robert@
|
|
script; instead, rc.subr can call rc_conf itself right after reading in
rc.conf.
from schwarze@ (committing on his behalf)
ok robert@
|
|
local_rcconf would get overwritten by flags from the rc script itself.
Based on an original idea and diff from robert@, create an rc_conf
function that we add in the rc_script after the defaults daemon*
variables.
This way we can use defaults variables names in other part of the script
(when defining a specific pexp for instance).
While here, simplify setting up the default daemon variables so that we
don't need to do any substitution in rc_start.
rc scripts must include daemon variables before calling rc_conf. All
other locally modified variables (pexp, rc_reload, local additions...)
must come after.
feedback from and works for sthen@
ok robert@
|