Automatic service jails - review request

Alexander Leidinger <[email protected]>
Newsgroups gmane.os.freebsd.architechture
Message-ID <20230601122431.Horde.mmXZpnuf9SpQYXzs4Mrw_Ek@webmail.leidinger.net>
Hi,

I implemented a functionality which allows to automatically put rc.d  
services into jails. They inherit the same filesystem, and maybe the  
same network / jailed sysvipc / ..., so it's not the same isolation as  
a manual jail with a separate filesystem, but at least you can  
restrict access to sysvpic, parts of net, ..., and unrelated processes  
automatically (1-2 config lines in rc.conf). The included man-page  
change contains more info. I'm intentionally a bit less verbose here,  
as this is also a test to see if the man page is good enough to  
describe this.

I have put up some reviews in Phabricator:
  - https://reviews.freebsd.org/D40369
    -> Extend /usr/bin/service with the possibility to set ENV vars
    This is a pre-req for the functionality.
  - https://reviews.freebsd.org/D40370
    -> The implementation.
  - https://reviews.freebsd.org/D40371
    -> Additional config for /some/ basesystem services (e.g. allow  
network access for syslogd).

The /usr/bin/service change is something which also helps in  
developing/debugging rc.d scripts in general. I think it could be  
committed before the branch of 14-stable (and as such would then allow  
an easy MFC of the implementation later).

The other two reviews may need some revisions (and the 3rd may benefit  
from further changes to services (which can come in later) I don't  
have in use myself or haven't had the time to have a look at it), but  
I have those changes running since some years and I should try to get  
them out the door. Peer review/pressure may help here... :)

Note, this is the second implmementation which uses an env var to  
track state (much simpler code than the first implementation), whereas  
the first implementation tried to use different commands  
("startjailed/stopjailed") to track state.

It would be nice if some people with insight into /etc/rc would have a  
look at D40369 and D40370, and everyone interested in this  
functionality into the man pages and whatever kind of area they can  
provide some insight into.

Bye,
Alexander.

-- 
http://www.Leidinger.net [email protected]: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    [email protected]  : PGP 0x8F31830F9F2772BF
signature.asc (application/pgp-signature, 851 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmR4cd8ACgkQEg2wmwP4
2IYsyA//fhpvlBK8gsaBCQ7P+vdCj0A6Z2Rg6INDIdtXZZOzSYW9pt9NbkuRXiHq
B8YebnesjYXEtMMl1G6rguQ4OK7u1Uul6x8okMOCXn2WoE+UuoScDbaINKlwtEmK
lt869NQG+cPpBaAZSE3NBMMlBCRhgn7LSuKpUdcv5CKr6R6BKa7HWB6YeqOILpRF
y2eLtbRMqBQK+zGuWSVgky3po7rtmFJtS16xgUgKejNq+ob5/fpxPXHAR68y1cbr
HZevNh9W15DqGafnyL5xEZJb/GCSZm7XAKe9t389O1B8+fcPxgrl7iSgc6KBcbJr
ae7glRGSfFI01Mc1Hj7lsvwcR4TLOulJhj7l1HFvo7jOLiHy88EYsfaaIsl02YLM
Atx+1eH/Jwz8fIfqNZ088GfflGVKr61/Kceqjszfnrr+RfrD1n+A99EnC59dEika
CIDdb00eWMidOZhJ+ZWHpcg4ecds3dPKiaJkaqztDOaeA88HNeEtdkrT59MSvB30
mYsAU0uFGv351nOXb9zqTuQbcvM0nEVCwRBNfCJ9LIEWIfwRYZDxvFxW+MLXqTeJ
HzYHg2VBzq64Gh4o1j5X4dQ1pecQEGYrMcRVTmwzZU3yB+C+9cioUx87QGh8xDqn
b+d/a6onHzOPpiwvs2//Zdr0CpZAeEGfitnUZnpebgRDkuq5trU=
=2ahY
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.