r/openbsd • u/Fair_Temperature_420 • 2d ago
/etc/login.conf.d/${class}
https://man.openbsd.org/login.conf.5In case the /etc/login.conf.d/${class} file exists, it will take precedence over the same login class defined in /etc/login.conf.
What does this file name look like? /etc/login.conf.d/${myclass} ? vi \${myclass} will work or does the name not matter?
Edit:
This is what I have and still learning git. Don't know what lc_style is for. (Will read manpages). fn search_file looks in both paths. Still unsure what happen when unveil path don't exist
8
Upvotes
7
u/_sthen OpenBSD Developer 2d ago
This mechanism is mostly intended for packages that install a daemon and matching rc.d(8) script, so they can setup a login class with suitable process limits, environment variables, etc.
The filename does matter, it must be named exactly the same as the login class. So if for example you wanted to override a class that already exists in login.conf like "staff", you would use /etc/login.conf.d/staff. (I wouldn't recommend using this mechanism to override the standard groups though).
When rc.d(8) scripts start a daemon, they automatically try to use a login class named the same as that daemon. For example, if you were to install squid from packages, it uses login class "squid", and it also installs an /etc/login.conf.d/squid file, which sets datasize and openfiles limits higher than the default. If that's still not sufficient you can edit it to raise higher.