OpenRC / openrc

The OpenRC init system
BSD 2-Clause "Simplified" License
1.46k stars 246 forks source link

Feature request: `/etc/rc.local` support #562

Closed samboy closed 1 year ago

samboy commented 1 year ago

Since old school sysvinit users might expect to find /etc/rc.local, it might be useful to add support for this:

vapier commented 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.

samboy commented 1 year ago

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.