Closed samboy closed 1 year ago
i don't think we'll want to bother with this. you're free to symlink that file into /etc/local.d/
.
the point of openrc was to break away from the classic sysvinit systems out there because they were completely unmanageable. we also don't support /etc/rc.#
paths, nor do we want to.
I agree completely that the old SysV scripts are a mess. And, they aren’t standardized so new inits can do whatever they want in terms of config files, etc.
One thing I really like about systemd
is that it does what the old daemontools
by the legendary DJB did, converting a network or other program which doesn’t fork()
to daemonize and logs to standard output/error in to a full fledged service, with daemonizing and logging handled by the calling process. Indeed, I created a tool called duende
which does the same thing for my tiny open source project, but I no longer need that. I can do this now:
# Place this file here:
# /etc/systemd/system/maradns.service
# Then
# systemctl enable maradns
# systemctl start maradns
# To view log
# journalctl -u maradns
[Unit]
After=network-online.target
ConditionPathExists=/usr/local/bin/maradns
Description=MaraDNS
Wants=network-online.target
[Service]
ExecStart=/usr/local/bin/maradns
StandardOutput=journal
TimeoutSec=0
Type=exec
[Install]
WantedBy=multi-user.target
This replaces an over 100 line shell script and a 282-line C program which MaraDNS had to use in the old days of sysvinit
.
If OpenRC ever supports making wrappers which convert simple programs in to fully daemonized services, add a note here.
Until then, I will close this issue. If upstream doesn’t want to implement something, I see no point in having an open ticket clog up the ticketing system. Trust me, I know all about open source economics, and fully appreciate that I’m not a customer because I have never paid you.
Since old school
sysvinit
users might expect to find/etc/rc.local
, it might be useful to add support for this:/etc/local.d
this will only run if thelocal
service is enabled and started/etc/local.d/README
to this file (enable withrc-update add local
, run withrc-service local start
, notes on the/etc/local.d
directory)local
service after running all*.start
scripts in/etc/local.d
(there’s a general understanding/etc/rc.local
is the last thing one runs when booting a system before allowing logins)