On 2022-03-23, Sven F. <[email protected]> wrote: > Dear reader, > > according to the rc.d man: > > -- > daemon_class is a special read-only variable. It is set to "daemon" > unless there is a login class configured in login.conf(5) with the same > name as the rc.d script itself, in which case it will be set to that > login class. This allows setting many initial process properties, for > example environment variables, scheduling priority, and process limits > such as maximum memory use and number of files. > -- > > If the demon requires a specific class, like lets say `unbound`, > but it s launched through a symlink `unbound_jail -> unbound`, > the class will not be used and login.conf > *must* declare `unbound_jail` ?
Correct, that is what the documentation says will happen, and is what does happen. You can also look at the daemon_class entry in /var/run/rc.d/$daemon_name to confirm which class it was actually started with. > In other words, > > Is there a way to, without rewriting rc_exec, use a specific class > for all 'instances' created through a symlink of the rc.d/script directory. > So all other unbound daemon actually do `su -c unbound` and not > `su -c unbound_secondary` That feature is not available. But you could add login.conf entries like unbound_secondary:tc=unbound: or copy the unbound block to /etc/login.conf.d/unbound and symlink to the names for the other classes. At least that then has symmetry with your symlinks in /etc/rc.d. -- Please keep replies on the mailing list.

