|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
What is the equivalent of a unit file of Linux in OpenBSD?
Dear OpenBSD users,
there is an information for Linux distributions: Quote:
Could you please refer a man page for this? Also if you've provisioned such a system can you tell something about it? For example what did you build? What does it do? I'd really like to hear about your experience. |
|
||||
See rc.d(8) et al. Check /etc/rc.d/ for some examples to work from (and the man page ofc).
Note that systemd unit files are declarative in nature and so require no coding skills. Services in OpenBSD are controlled by shell scripts, which will need a lot more thought and attention to avoid user-induced bugs. This is one of the advantages of systemd for the "normal" user. |
|
|||
Quote:
Thanks for the information. So in order to create a script for rc.d I assume I should be able to write some ksh code, is that correct? |
|
|||
Quote:
How can I get the full list of these keywords below? Which words I can put into a script so rcctl can understand? I guess these scripts are controlled by rcctl. Code:
rc_reload=NO rc_stop=NO Last edited by gordon.f; 29th December 2022 at 04:50 PM. Reason: Typo |
|
||||
The available actions are listed by the
_rc_actions variable in /etc/rc.d/rc/subr.
Last edited by Head_on_a_Stick; 29th December 2022 at 05:09 PM. Reason: better reply |
|
|||
Quote:
|
|
|||
Quote:
Code:
. /etc/rc.d/rc.subr Code:
daemon_execdir="/etc/amd" |
|
|||
Yes, that's what I'm wondering. How do you use that variable before including the file which defines it?
Last edited by gordon.f; 29th December 2022 at 06:00 PM. Reason: Typo |
|
||||
The variable is only called in rc.subr, it is set (or not) in the rc script itself.
Reference: https://github.com/openbsd/src/blob/...d/rc.subr#L116 |
|
|||
I'm sorry I didn't get it.
Code:
#!/bin/ksh # # $OpenBSD: amd,v 1.11 2022/05/26 11:27:03 ajacoutot Exp $ daemon="/usr/sbin/amd" daemon_execdir="/etc/amd" . /etc/rc.d/rc.subr |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Equivalent to Linux's /sys/class/backlight? | vns3 | OpenBSD General | 2 | 10th November 2018 05:27 PM |
tcptrack or equivalent | Scripter | OpenBSD Packages and Ports | 16 | 23rd June 2018 11:53 PM |
Linux kernel: Critical UFS file system bug in 4.9 and 4.11 kernels (4.8.4 and above) | comet--berkeley | Other BSD and UNIX/UNIX-like | 1 | 19th June 2017 05:13 PM |
FreeBSD equivalent to OpenBSD mk.conf FETCH_PACKAGES=Yes | sysfu | FreeBSD Ports and Packages | 10 | 16th March 2015 11:37 AM |
Linux Binary: cannot execute binary file | xmorg | FreeBSD General | 3 | 25th September 2010 03:46 PM |