summaryrefslogtreecommitdiff
path: root/etc/rc.d
AgeCommit message (Collapse)Author
2021-02-27Add logger(1) support for daemons that are logging to stdout/stderr (mostly fromAntoine Jacoutot
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@
2021-02-26Ship resolvd service, enable it by defaultkn
Starting right after unwind. OK deraadt
2021-02-26rc(8) bits for dhcpleased(8).Florian Obser
OK deraadt
2020-07-12Use su -fl to avoid sourcing /etc/profile / the target user's .profileJeremie Courreges-Anglas
This way rc.d and rcctl don't suffer from side effects in people's rc files. If you somehow used those files to set environment variables, you should have used login.conf as described in rc.d(8) instead. ok ajacoutot@
2020-04-29Sort variables and fix a comment.Antoine Jacoutot
No functional change.
2020-02-22Do not run _rc_parse_conf of /var/run/rc.d/foobar on "start".Antoine Jacoutot
This is needed in case a foobar fails to start but still returns 0. Changing its flags (in rc.conf.local) would then get ignored because of this cache (which is around to handle stop/check/reload on flags changes). claudio@ reported this issue when struggling with prometheus several weeks ago
2020-01-25sync rc.d/sshd with sshd proctitle change - listener has been modified toStuart Henderson
keep command-line arguments again; ok aja@ djm@
2020-01-24retire rebound etc bits to the atticTed Unangst
2020-01-22update pexp in rc.d/sshd to match the new setproctitle ('sshd: [listener]Stuart Henderson
1 of 10-100 startups'). "makes sense" deraadt@ Beware if you have multiple sshd processes (e.g. on different ports) and want to restart/stop just one - with the current proctitle there's no way to distinguish between these so rc.d/rcctl will match all of them.
2019-11-22sndiod(8) reopens audio interfaces on SIGHUP, which makes a lot of senseClaudio Jeker
when -F is used. Because of this allow rc.d script to reload sndiod. OK kn ratchov aja
2019-09-07Remove dependency on basename(1).Antoine Jacoutot
prodded by deraadt@ ok kn@ deraadt@ tb@
2019-05-12Stop generating keys for nsd-control(8). These are unused since nsd wasTim van der Molen
switched to using a local control socket by default. OK florian@ sthen@
2019-03-21Start in the daemon configured routing table and not in the one we're currentlyAntoine Jacoutot
in. This fixes the case where one would be in a non default rdomain shell then run an rdomain 0 rc.d daemon. reported by YASUOKA Masahiko and Pierre Emeriaud ok sthen@ claudio@ benno@
2019-02-07No need to run unbound-anchor anymore. Unwind(8) handles the bootstrapFlorian Obser
correctly itself now. At leat considering the end of life times of OpenBSD releases and the speed at which the root key signing key (KSK) rolls. On the other hand, unbound-anchor assumes a certain network quality which we cannot guarantee in places where we want to run unwind(8). This in turn can lead to unbound-anchor stalling the boot process.
2019-01-26rc(8) bits for unwind(8); OK deraadtFlorian Obser
2019-01-21Use ${rcexec} in rc_pre to do the config testing. This allows to specifyClaudio Jeker
macros with spaces in them. With and OK ajacoutot
2019-01-20The shell will strip the quotes from daemon_flags when starting a daemon so makeAntoine Jacoutot
sure pexp matches the process (i.e. doesn't include the quotes). It's a bit hackish but it allows things like these in rc.conf.local: relayd_flags=-D IPS="1.2.3.4 2.3.4.5" And we properly end up with... $ grep ^pexp /var/run/rc.d/relayd pexp=/usr/sbin/relayd -D IPS=1.2.3.4 1.2.3.5 ... which matches what is in the process list: root 14217 <snip> 0:00.01 /usr/sbin/relayd -D IPS=1.2.3.4 1.2.3.5 There's always the possibility that we have introduced a regressions with hand crafted functions in rc.d scripts (mostly from packags), so watch out. reported by and debugged with claudio@
2018-10-29Revert previous (for now).Antoine Jacoutot
semarie found a few regressions with daemon that will fail if cwd is not accessible.
2018-10-16Change the way we call su(1) in rcexec:Antoine Jacoutot
- 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@
2018-09-27Add vmctl stop -a [-fw] option to stop or terminate all running VMs.Reyk Floeter
This is also be used to simplify the vmd rc stop script. OK mlarkin@ ccardenas@
2018-07-23Remove rtadvd(8) rc script.Florian Obser
2018-07-12rc(8) infrastructure for radFlorian Obser
2018-07-11Add -w option to vmctl stop to wait for completion of VM termination.Reyk Floeter
Use it in /etc/rc.d/vmd accordingly. OK sthen@
2018-02-20Call "vmctl stop" on each VM at shutdown, for OpenBSD guests this means theyStuart Henderson
are signalled to shutdown cleanly. Wait for each to finish to avoid too much busy work at once; this may need revising if it turns out to be too slow with a larger number of VMs (e.g. signal/delay/signal/delay/... then wait for shutdowns), but let's avoid making it more complex unless we know it's needed. Based on a diff from abieber@, discussed with mlarkin@ aja@ rpe@, ok rpe
2018-01-11CommentsRobert Peichaer
2018-01-11- change [] tests to [[]]Robert Peichaer
- change -a, -o to &&, || inside [[]] - remove unecessary quoting inside [[]] - remove X"" constructs inside [[]] - remove \ (line continuation) in case of &&, || and pipes - replace backticks with $() discussed with and OK aja@ OK tb
2018-01-11Change the shebang line from /bin/sh to /bin/ksh in all base rc.dRobert Peichaer
daemon scripts. discussed with and OK aja@ OK tb
2017-06-05Temporarily disable the second call to rc_check until I figure out whatAntoine Jacoutot
is going on. Should fix another case of false negative reported by sthen (redis).
2017-06-05Fix logic in _rc_wait to properly cope with setproctitle(3) daemons. It was aAntoine Jacoutot
regression from my recent rc.subr changes. reported by deraadt@ and naddy@ : pflogd was marked as failed during boot while it was properly running
2017-06-03Move slaacd to /sbinFlorian Obser
jca points out that all the other interface configuration tools live there (like ifconfig or dhclient). Furthermore it starts so early in the boot process that /usr might not be mounted yet if it's a nfs filesystem. sthen and deraadt agree
2017-05-30Introduce a scary rc.conf(8) knob library_aslr=(YES|NO) to turn off theTheo Buehler
reordering of libraries by rc(8). This way machines with very slow disk I/O have a chance of booting within reasonable time now that libcrypto is also randomized. Discussed with various; input & ok from deraadt ajacoutot
2017-05-29rc.d(8) for slaacdFlorian Obser
OK phessler, deraadt
2017-05-28Move check later to mitigate a possible race.Antoine Jacoutot
2017-05-28Indent and rename var; no functional change.Antoine Jacoutot
2017-05-28When a daemon reaches its timeout when starting, display "timeout" insteadAntoine Jacoutot
of "ok" so the user is warned and has a chance to fix it (most of the time due to bogus flags). Daemons reaching the timeout without being able to start are still marked as "failed" (which should also give a clue to the user that some investigation is needed). prodded by beck@ a while ago discussed with and ok sthen@
2017-05-28Drop useless lines continuation; no functional change.Antoine Jacoutot
2017-05-27Ok turns out we still want to keep the rc_bg variable around but we needAntoine Jacoutot
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 `&'.
2017-05-27Add an ALRM timer to cope with 2 annoying issues in rc.d(8):Antoine Jacoutot
- 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!
2017-03-23Don't check for spamd_black twice in rc_pre and rc_start; just do everythingAntoine Jacoutot
in rc_pre. prodded by and ok jmc@, ok halex@
2017-03-17Enable dhcrelay6(8).Rafael Zalamena
ok deraadt@
2017-02-26Switch to xenodm(1).Matthieu Herrb
Do it now deraadt@
2017-02-17Stop supporting the historical way of starting ypbind(8); that is settingAntoine Jacoutot
'ypbind_flags=""' when domainname is set and /var/yp/binding exists. This can lead to inconsistent behavior at startup since /var may not be mounted yet and /etc/rc's start_daemon() will not start ypbind. A.K.A. make ypbind startup consistent with all other OpenBSD daemons. ok deraadt@
2017-01-24Whitespace.Antoine Jacoutot
2016-10-06Add switchdReyk Floeter
OK deraadt@
2016-09-07Introduce an _rc_check_name() function to check the input script name so thatAntoine Jacoutot
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@
2016-08-31use tab.Antoine Jacoutot
2016-05-03signal name should be first, fixes reload; ok deraadt@Otto Moerbeek
2016-04-28Experiment on matching on the daemon_user is over. It needs more work.Antoine Jacoutot
portmap isn't happy with it as reported by naddy@
2016-04-27Revert the revert and match on the daemon_user again.Antoine Jacoutot
We'll see if something else breaks but it's the right thing to do. discussed with robert@
2016-04-27Override each and every rc.d functions to be able to match on the user.Antoine Jacoutot