OpenBSD CVS

CVS log for src/share/man/man8/rc.subr.8


[BACK] Up to [local] / src / share / man / man8

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.49 / (download) - annotate - [select for diffs], Sat Oct 22 10:34:56 2022 UTC (19 months, 1 week ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

Fix markup ("Ar" -> "Va" ).

from Raf Czlonka, thanks

Revision 1.48 / (download) - annotate - [select for diffs], Fri Sep 2 22:11:57 2022 UTC (20 months, 4 weeks ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.47: +16 -6 lines
Diff to previous 1.47 (colored)

Make rc_configtest behave like rc_pre and rc_post; i.e. don't define a default
function (each rc.d script is supposed to define its own if wanted).
This way, we can filter out the "configtest" action depending on whether the
function exists or not.
Adapt documentation.

tweak/ok kn@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Aug 30 05:40:28 2022 UTC (21 months ago) by jmc
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

overriden -> overridden;

Revision 1.46 / (download) - annotate - [select for diffs], Mon Aug 29 19:14:02 2022 UTC (21 months ago) by ajacoutot
Branch: MAIN
Changes since 1.45: +15 -4 lines
Diff to previous 1.45 (colored)

Introduce the rc_configtest() function.
By default it just returns "0" but can be overriden by rc.d scripts to check
that the daemon configuration is valid when running "start", "reload" and
"restart".

Revision 1.45 / (download) - annotate - [select for diffs], Fri May 27 12:27:39 2022 UTC (2 years ago) by ajacoutot
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

Normalise markup.

from Raf Czlonka

Revision 1.44 / (download) - annotate - [select for diffs], Thu May 26 11:27:03 2022 UTC (2 years ago) by ajacoutot
Branch: MAIN
Changes since 1.43: +10 -4 lines
Diff to previous 1.43 (colored)

Introduce a new daemon_execdir variable for changing to a specified directory
before running rc_rcexec.

Based on an proposal from openbsd.tech at aisha.cc
ok robert@ abieber@

Revision 1.43 / (download) - annotate - [select for diffs], Sat May 21 14:11:39 2022 UTC (2 years ago) by ajacoutot
Branch: MAIN
Changes since 1.42: +30 -35 lines
Diff to previous 1.42 (colored)

Document rc_exec.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Dec 30 08:14:29 2021 UTC (2 years, 5 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.41: +5 -5 lines
Diff to previous 1.41 (colored)

Sync rcexec with reality.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Nov 11 12:23:15 2021 UTC (2 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.40: +18 -10 lines
Diff to previous 1.40 (colored)

Tweak rc_stop and rc_reload description by mentioning their corresponding
_signal variable.
Fix a warning from 'mandoc -T lint' while here.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Nov 6 10:38:04 2021 UTC (2 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.39: +10 -2 lines
Diff to previous 1.39 (colored)

Allow passing a different signal than SIGTERM in the default rc_stop()
function. This will allow to simplify some rc.d script that cook there own
function to gracefully stop a process (e.g. web servers). There are other use
cases as well.
And do the same for rc_reload because it's cheap and can also simplify a
handful of rc.d scripts.

Behave like shutdown and if the process is still not down after daemon_timeout
(configurable; default to 30s), then send a SIGKILL.

While here, factorise pkill invocations into a _rc_sendsig() function that can
potentially be used by rc.d scripts instead of cooking pkill lines; this will
benefit from the configured routing table etc.

tested & ok robert@

Revision 1.39 / (download) - annotate - [select for diffs], Sun Oct 31 17:58:28 2021 UTC (2 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

Make it more visible that not only rc_reload() can be disabled.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Feb 27 09:28:05 2021 UTC (3 years, 3 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.37: +9 -2 lines
Diff to previous 1.37 (colored)

Add logger(1) support for daemons that are logging to stdout/stderr (mostly from
the go ecosystem).
Properly handle failing daemon startup now that we have pipefail.

To take advantage of this new feature, just add foo_logger=facility to the
daemon rc.d(8) script or in rc.conf.local(8) or use rcctl:
rcctl set foo logger daemon.info

tweak for checking flags in rcctl(8) from martijn@
"this looks pretty good" deraadt@
ok sthen@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Feb 21 00:47:21 2020 UTC (4 years, 3 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored)

Fix daemon_rtable route command mention

Without "exec" the comand is invalid.

OK sthen

Revision 1.36 / (download) - annotate - [select for diffs], Mon Oct 29 07:55:41 2018 UTC (5 years, 7 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.35: +1 -1 lines
Diff to previous 1.35 (colored)

Revert previous (for now).
semarie found a few regressions with daemon that will fail if cwd is not
accessible.

Revision 1.35 / (download) - annotate - [select for diffs], Tue Oct 16 07:07:05 2018 UTC (5 years, 7 months ago) by ajacoutot
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

Change the way we call su(1) in rcexec:
- drop `-'l' to prevent simulating a full login and running /root/.profile
(prodded by a mail from J Greely)
- use `-m' to preserve the environment because we now set HOME to "/" like
/etc/rc does; note that we now also clear the environment using `env -i' before
running su(1) which leaves us with only HOME, PATH and SHELL

Committing early to catch regressions fast, if any.
ok halex@

Revision 1.34 / (download) - annotate - [select for diffs], Sat May 27 19:55:48 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.33: +15 -4 lines
Diff to previous 1.33 (colored)

Ok turns out we still want to keep the rc_bg variable around but we need
to know which daemon cannot background themselves (actually we want to
know the opposite, but there are much more). However, it's only needed in
_rc_wait and rc.subr still does its magic without the need to add `&'.

Revision 1.33 / (download) - annotate - [select for diffs], Sat May 27 13:51:52 2017 UTC (7 years ago) by ajacoutot
Branch: MAIN
Changes since 1.32: +4 -18 lines
Diff to previous 1.32 (colored)

Add an ALRM timer to cope with 2 annoying issues in rc.d(8):
- prevent a daemon from hanging the boot
(typo in your flagsm e.g. httpd_flags=-d)
- make sure we can get the status of a backgrounded daemon instead of always
returning success

Side effect of this is that we can kill a knob! rip rc_bg :-)
Ports will need love, and a second commit is coming for that.

The diff is small yet not trivial so I am committing early in the release
process in one shot so it can easily be reverted if needed. I started working on
this during g2k16 in Cambridge then finished it in Brisbane for a2k17 where
robert@, beck@ and sthen@ agreed it was the correct way to go and I should move
ahead with it post 6.1.

If you see any regression, please talk to me!

Revision 1.32 / (download) - annotate - [select for diffs], Wed Sep 7 13:12:42 2016 UTC (7 years, 8 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.31: +6 -2 lines
Diff to previous 1.31 (colored)

Introduce an _rc_check_name() function to check the input script name so that
we don't end up with cryptic error messages.
Regex help from rpe@
Issue reported by Anthony Coulter in rcctl(8), but better fix the root cause.

Also clarify the mage page that rc.d script name must follow ksh(1) variable
naming.

ok robert@ sthen@

Revision 1.31 / (download) - annotate - [select for diffs], Tue Apr 26 18:30:22 2016 UTC (8 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.30: +2 -3 lines
Diff to previous 1.30 (colored)

unwanted .El;

Revision 1.30 / (download) - annotate - [select for diffs], Tue Apr 26 17:43:12 2016 UTC (8 years, 1 month ago) by ajacoutot
Branch: MAIN
Changes since 1.29: +33 -19 lines
Diff to previous 1.29 (colored)

Document recent rc.subr/rc.d changes.

ok sthen@ robert@

Revision 1.29 / (download) - annotate - [select for diffs], Fri Sep 25 08:24:52 2015 UTC (8 years, 8 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

typo.

Revision 1.28 / (download) - annotate - [select for diffs], Thu Jan 15 09:20:37 2015 UTC (9 years, 4 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.27: +11 -2 lines
Diff to previous 1.27 (colored)

Extend the description of _timeout.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Sep 22 16:27:03 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.26: +5 -3 lines
Diff to previous 1.26 (colored)

add obviously forgotten daemon_timeout default
and mention that it can be overridden

Revision 1.26 / (download) - annotate - [select for diffs], Mon Sep 22 16:17:32 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

obvious markup typo; frantisek holop <minusf at obiit dot org>

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jul 9 14:19:22 2014 UTC (9 years, 10 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.24: +10 -3 lines
Diff to previous 1.24 (colored)

Add a daemon_timeout variable for rc_wait().
It represents the maximum time in seconds to wait for the start, stop
and reload actions to return. Defaults to "30".
No default behavior is changed.

ok beck@ sthen@ jasper@ giovanni@

Revision 1.24 / (download) - annotate - [select for diffs], Wed Mar 26 00:15:47 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

rc_stop() sends SIGTERM, not SIGKILL; reported by <yon dot fernandez dot
de dot retana at bardinflor dot perso dot aquilenet dot fr on bugs@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jul 15 22:59:12 2013 UTC (10 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.22: +5 -5 lines
Diff to previous 1.22 (colored)

Mark up email adresses with the .Mt macro;
patch from Franco Fichtner <franco at lastsummer dot de>;
ok jmc@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Nov 17 00:55:58 2012 UTC (11 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.21: +28 -24 lines
Diff to previous 1.21 (colored)

Fix some abuse of the .Ar and .Fn macros;
ok ajacoutot@ and sthen@ on a previous version some time ago,
using the additional suggestion ".Dq NO" from jmc@.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Aug 15 18:23:10 2012 UTC (11 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

remove trailing whitespace;

Revision 1.20 / (download) - annotate - [select for diffs], Mon Aug 6 06:44:15 2012 UTC (11 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.19: +14 -8 lines
Diff to previous 1.19 (colored)

Adapt after recent move from pkill(1) to pgrep(1) in rc_check.

from robert at peichaer dot org
ok jmc@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Aug 4 15:30:48 2012 UTC (11 years, 9 months ago) by ajacoutot
Branch: MAIN
Changes since 1.18: +10 -2 lines
Diff to previous 1.18 (colored)

Document rc_usercheck.

ok todd@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Dec 13 00:09:52 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.17: +7 -3 lines
Diff to previous 1.17 (colored)

If a daemon always requires one or more fixed flags or arguments,
put these into $daemon, not into $daemon_flags;
feedback and ok jmc@, ok ajacoutot@, issue brought up by sthen@,
and sthen@ also likes the general idea.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Mar 25 10:03:26 2011 UTC (13 years, 2 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Bump timeout to 30s.

ok robert@

Revision 1.16 / (download) - annotate - [select for diffs], Wed Mar 23 20:43:43 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +12 -7 lines
Diff to previous 1.15 (colored)

Cleanup .Va macros, triggered by a smaller diff from ajacoutot@.
* Do not use .Va for mere emphasis, it's for variable names.
* Use .Dl to display complete single command lines.
* And .Bd -literal is nicer when they contain double quotes.
ok ajacoutot@

Revision 1.15 / (download) - annotate - [select for diffs], Tue Mar 15 12:58:31 2011 UTC (13 years, 2 months ago) by ajacoutot
Branch: MAIN
Changes since 1.14: +5 -3 lines
Diff to previous 1.14 (colored)

Put daemon between double quotes to make it clear we are talking about
the daemon class, not the daemon script.

ok schwarze@

Revision 1.14 / (download) - annotate - [select for diffs], Tue Mar 15 10:31:47 2011 UTC (13 years, 2 months ago) by ajacoutot
Branch: MAIN
Changes since 1.13: +2 -4 lines
Diff to previous 1.13 (colored)

Make it clear that rc_reload=NO is not about a daemon not supporting
SIGHUP but having no way to reload the configuration (other than restart).

Revision 1.13 / (download) - annotate - [select for diffs], Thu Mar 10 15:09:38 2011 UTC (13 years, 2 months ago) by jmc
Branch: MAIN
Changes since 1.12: +5 -4 lines
Diff to previous 1.12 (colored)

tweak previous;

Revision 1.12 / (download) - annotate - [select for diffs], Thu Mar 10 10:24:33 2011 UTC (13 years, 2 months ago) by ajacoutot
Branch: MAIN
Changes since 1.11: +55 -17 lines
Diff to previous 1.11 (colored)

Extend the documentation of the actions argument and bring this up to date
after the recent changes.

ok sthen@ robert@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Mar 8 13:49:13 2011 UTC (13 years, 2 months ago) by ajacoutot
Branch: MAIN
Changes since 1.10: +3 -8 lines
Diff to previous 1.10 (colored)

There is no such thing as rc_restart().

Revision 1.10 / (download) - annotate - [select for diffs], Sun Mar 6 16:49:47 2011 UTC (13 years, 2 months ago) by ajacoutot
Branch: MAIN
Changes since 1.9: +14 -6 lines
Diff to previous 1.9 (colored)

Add an "rc_bg" variable that is undefined by default and allows to start
a daemon in the background.

man page tweaks from schwarze@
discussed with an ok schwarze@ robert@

Revision 1.9 / (download) - annotate - [select for diffs], Sat Mar 5 12:56:33 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +9 -18 lines
Diff to previous 1.8 (colored)

Minor polishing that was missed during the recent rc.subr(8) split:
* Avoid markup of "daemon" when not explicitly referring to the variable.
* Improve some wording, remove one typo and one useless .Pp.
Reminded by jmc@, ok jmc@ ajacoutot@

Revision 1.8 / (download) - annotate - [select for diffs], Thu Feb 24 07:06:35 2011 UTC (13 years, 3 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.7: +25 -9 lines
Diff to previous 1.7 (colored)

Fix several documentation bugs (including a typo fix from schwarze@).
Missing documentation about the naming policy for rc scripts.
Document rcexec.
Remove daemon_shell, it's proved useless at best and can introduce
issues we don't want to deal with.

prodded by, discussed with and ok espie@
ok robert@ miod@

Revision 1.7 / (download) - annotate - [select for diffs], Thu Feb 17 18:22:44 2011 UTC (13 years, 3 months ago) by espie
Branch: MAIN
Changes since 1.6: +51 -84 lines
Diff to previous 1.6 (colored)

split along user/implementation lines.
After lots of back and forth with jmc@ and schwarze.

okay miod@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 12 11:22:31 2011 UTC (13 years, 3 months ago) by ajacoutot
Branch: MAIN
Changes since 1.5: +6 -1 lines
Diff to previous 1.5 (colored)

Extend rc_scripts documentation.

prodded by espie@
ok jmc@ (with tweaks), ok miod@

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jan 16 23:31:12 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +154 -67 lines
Diff to previous 1.4 (colored)

explain various points in more detail, and some in easier or
more standard ways; ok jmc@ ajacoutot@ robert@

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jan 16 14:59:19 2011 UTC (13 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.3: +41 -42 lines
Diff to previous 1.3 (colored)

tweak previous;

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 16 13:19:47 2011 UTC (13 years, 4 months ago) by jasper
Branch: MAIN
Changes since 1.2: +9 -9 lines
Diff to previous 1.2 (colored)

- new sentence, new line
- remove double word
- slight rewording tweaks

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jan 16 13:08:50 2011 UTC (13 years, 4 months ago) by jasper
Branch: MAIN
Changes since 1.1: +5 -3 lines
Diff to previous 1.1 (colored)

- missing .Pa

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jan 16 13:05:17 2011 UTC (13 years, 4 months ago) by robert
Branch: MAIN

Start documenting rc.subr(8).
There is still space for fixes so we are not linking it to the build yet.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.