NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.28k stars 14.27k forks source link

Tracking issue: add systemd slices for related services #279915

Open h7x4 opened 10 months ago

h7x4 commented 10 months ago

Issue description

I'd like to start organizing some of the nixos services into systemd slices.

According to the systemd.slice docs, A slice unit is a concept for hierarchically managing resources of a group of processes. There are quite a few modules that split up their services into several systemd units, which I think makes sense to collect into a slice.

Some of the benefits of creating such slices would be:

As a side note, I also think most slices should be prefixed with system- if there's not a good reason not to. By default, service and scope units are placed in system.slice. This would be in contrast to something like how php-fpm is currently put in a top-level slice (planning to move this as part of this tracking issue).

TODO

tomodachi94 commented 3 months ago

Upstream PR filed at https://github.com/OpenPrinting/cups/pull/1035 to add a slice for the CUPS printing system, since it appears we use the upstream units.

hacscred commented 1 month ago

What is the group of processes involved in paperless? The already merged commit doesn't mention any group larger than one of processes, which is incompatible with the goals of this issue.

tomodachi94 commented 1 month ago

That module has a few services

Afaict, these services are all parts which allow the larger Paperless system to function robustly.

hacscred commented 1 month ago

The PR https://github.com/NixOS/nixpkgs/pull/341278/files doesn't tie those together. The paperless-web.service should be assigned to the slice mentioned in the PR or as a child, which is also not happening in that PR.

If you are accomplishing something in that PR, it's certainly not obvious.

tomodachi94 commented 1 month ago

The way the module is arranged, adding something to defaultServiceConfig should propagate it across all of the module's units, but I could be wrong.

Here's where I think this behavior takes effect, but feel free to disagree:

hacscred commented 1 month ago

The way the feature should work is that there exists a slice foo.slice as well as foo-sub{1,2,3}.slice (matching the various paperless service names would make sense, but that's not needed as long as they share the same prefix with a dash). The namespace is not related to resource allocation, which is what slices are about.

Unless you have any proof that it actually works, and by proof I mean a committed performance test I certainly do not believe it works.

My knowledge just comes from reading the documentation and according to the documentation, you need to set the slice name.

Even, if there is some implicit naming going on, setting the slice name explicitly would still be better with a comment saying that a hierarchical naming scheme is being used.

So, you might be right, but your answer is biasing me more towards the hypothesis of you not knowing what you are doing.

So, please read the documentation again and make my suggested changes or prove I am wrong. I provided some evidence that I am right.

h7x4 commented 1 month ago

The way the feature should work is that there exists a slice foo.slice as well as foo-sub{1,2,3}.slice [...]

I did not understand what you meant here. Do you want a slice for every single systemd service belonging to paperless? You can already do resource control directly on the service, which will end up creating an underlying cgroup. https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html

Unless you have any proof that it actually works, and by proof I mean a committed performance test I certainly do not believe it works.

If you worry that systemd slices and/or cgroups doesn't work as expected, this would be an upstream issue with systemd or the kernel. We don't set any resource limits by default, so there shouldn't be any (or at least negligible) difference in performance.

My knowledge just comes from reading the documentation and according to the documentation, you need to set the slice name.

Even, if there is some implicit naming going on, setting the slice name explicitly would still be better with a comment saying that a hierarchical naming scheme is being used.

The slice names are set correctly in their units. Try building this configuration. All units matching result/etc/systemd/system/paperless-*.service has the Slice attribute set correctly.

nixpkgs.lib.nixosSystem {
  system = "x86_64-linux";
  modules = [{
    boot.isContainer = true;
    services.paperless.enable = true;
  }];
}
paperless-web.service ``` [Unit] After=paperless-scheduler.service BindsTo=paperless-scheduler.service Description=Paperless web server JoinsNamespaceOf=paperless-task-queue.service [Service] Environment="GUNICORN_CMD_ARGS=--bind=localhost:28981" Environment="LOCALE_ARCHIVE=/nix/store/d6myxy49v33ir221631mrcj9iz7myzmc-glibc-locales-2.39-52/lib/locale/locale-archive" Environment="OMP_NUM_THREADS=1" Environment="PAPERLESS_CONSUMPTION_DIR=/var/lib/paperless/consume" Environment="PAPERLESS_DATA_DIR=/var/lib/paperless" Environment="PAPERLESS_MEDIA_ROOT=/var/lib/paperless/media" Environment="PAPERLESS_NLTK_DIR=/nix/store/3xb257vqfjhg102msnml817wnhpg5wck-paperless_ngx_nltk_data" Environment="PAPERLESS_REDIS=unix:///run/redis-paperless/redis.sock" Environment="PAPERLESS_THUMBNAIL_FONT_NAME=/nix/store/xwvq79xldrrp0nq7m2jf7i3l164dykva-liberation-fonts-2.1.5/share/fonts/truetype/LiberationSerif-Regular.ttf" Environment="PATH=/nix/store/0kg70swgpg45ipcz3pr2siidq9fn6d77-coreutils-9.5/bin:/nix/store/fnq94lw19pnwdl9p8zhfrad4jmlgxlbr-findutils-4.10.0/bin:/nix/store/vsyc8jhsr4d9lm2r8yqq9n3j4i66inlj-gnugrep-3.11/bin:/nix/store/gjlh1zvckhz0qv795lnzgw2zciklbzj2-gnused-4.9/bin:/nix/store/1lbc6v5p1a3rn4rjaqnz0694xfbq8dxq-systemd-256.4/bin:/nix/store/0kg70swgpg45ipcz3pr2siidq9fn6d77-coreutils-9.5/sbin:/nix/store/fnq94lw19pnwdl9p8zhfrad4jmlgxlbr-findutils-4.10.0/sbin:/nix/store/vsyc8jhsr4d9lm2r8yqq9n3j4i66inlj-gnugrep-3.11/sbin:/nix/store/gjlh1zvckhz0qv795lnzgw2zciklbzj2-gnused-4.9/sbin:/nix/store/1lbc6v5p1a3rn4rjaqnz0694xfbq8dxq-systemd-256.4/sbin" Environment="PYTHONPATH=/nix/store/h3i0acpmr8mrjx07519xxmidv8mpax4y-python3-3.12.5/lib/python3.12/site-packages:/nix/store/rr7665vdgls08iqkb336fg4r9l2wv4kv-python3.12-bleach-6.1.0/lib/python3.12/site-packages:/nix/store/4xp4w9af0r18rcn0d89cip5rph6f2w3p-python3.12-channels-4.1.0/lib/python3.12/site-packages:/nix/store/is65549yxi2dh3bg4hza7k7bjyhzpmqq-python3.12-channels-redis-4.1.0/lib/python3.12/site-packages:/nix/store/5j06ypbayayf0z1n2y3wr9bdc08ibvdh-python3.12-concurrent-log-handler-0.9.25/lib/python3.12/site-packages:/nix/store/sdxn8wq9hb50043gx4l53iqjyifgwdwq-python3.12-dateparser-1.2.0/lib/python3.12/site-packages:/nix/store/9g24slb59364al1sv56w50r50kwai9zm-python3.12-django-4.2.16/lib/python3.12/site-packages:/nix/store/r7z9203v89jdxni88nivz8k9900k7vh9-python3.12-django-allauth-0.61.1/lib/python3.12/site-packages:/nix/store/ip7m5qlmw543q4g7g4jrfaaa1lh99z27-python3.12-django-auditlog-3.0.0/lib/python3.12/site-packages:/nix/store/jdjy28vzl1rz2h4yrp60ya04mx7304fk-python3.12-django-celery-results-2.5.1/lib/python3.12/site-packages:/nix/store/ip7fwkfqfqp3285dvx0da7bf02d51ywb-python3.12-django-compression-middleware-0.5.0/lib/python3.12/site-packages:/nix/store/82l29rlksvmh5jhncmj3dkwr8v6bijbq-python3.12-django-cors-headers-4.4.0/lib/python3.12/site-packages:/nix/store/04297ynihpyvnva46rcw5w19vzhvv4xl-python3.12-django-extensions-3.2.3/lib/python3.12/site-packages:/nix/store/5imc9580w3y39l2bz494vb71s6h3yyns-python3.12-django-filter-24.3/lib/python3.12/site-packages:/nix/store/ylh7wjl11zz0qg7ymj1lgbxqw0iyswlf-python3.12-django-guardian-2.4.0/lib/python3.12/site-packages:/nix/store/46r0ad1lscqa9wq5svhdjd71m4mv8kgw-python3.12-django-multiselectfield-0.1.12/lib/python3.12/site-packages:/nix/store/p94kwxa4aakwvb4dqg8y19hrzl8wc759-python3.12-django-soft-delete-1.0.13/lib/python3.12/site-packages:/nix/store/56mfcjjsccsxkgdwhgzqz3d62p10hjdh-python3.12-djangorestframework-3.15.2/lib/python3.12/site-packages:/nix/store/ynkjy0dzqzylsqnlsli3n9ckyf8gnwab-python3.12-djangorestframework-guardian2-0.5.0/lib/python3.12/site-packages:/nix/store/q7ki41vimjy13qv7n2yjrgcnj66cn0w8-python3.12-drf-writable-nested-0.7.0/lib/python3.12/site-packages:/nix/store/xxk64nvcg2r6z66n3im0sa4vjrq0hl80-python3.12-filelock-3.15.1/lib/python3.12/site-packages:/nix/store/9pxyxwbh1ggx89574w3sdpifds3j2h0i-python3.12-flower-2.0.1/lib/python3.12/site-packages:/nix/store/mb0z65m1abbxl5l1zgpaqy5vkmg2y499-python3.12-gotenberg-client-0.6.0/lib/python3.12/site-packages:/nix/store/jwdcxqgxnpa3aisv1hf2g4rnbw4jy8jh-python3.12-gunicorn-23.0.0/lib/python3.12/site-packages:/nix/store/gqrmxmwyfwpbc2maq534vyagj2ngp95z-python3.12-imap-tools-1.7.2/lib/python3.12/site-packages:/nix/store/sidd8i48f517il12fgsjbk3rkqp198al-python3.12-inotifyrecursive-0.3.5/lib/python3.12/site-packages:/nix/store/dqswlwcn1dpy1hh1ijxx0cn255jgv48d-python3.12-langdetect-1.0.9/lib/python3.12/site-packages:/nix/store/6jmdpj4f8bl90sy9qfk6clll5jzhxdgn-python3.12-mysqlclient-2.2.4/lib/python3.12/site-packages:/nix/store/mn1xkx8mrb88lwmilbd5lbc7ccn4byv1-python3.12-nltk-3.9.1/lib/python3.12/site-packages:/nix/store/57gvriyjifb20gb7314z24mac9cka4vx-python3.12-ocrmypdf-16.5.0/lib/python3.12/site-packages:/nix/store/4lj07nrpbrridapfc096f0a14pi5gxr4-python3.12-pathvalidate-3.2.0/lib/python3.12/site-packages:/nix/store/603cjar99wfmkqk140m6192prk0k77vf-python3.12-pdf2image-1.17.0/lib/python3.12/site-packages:/nix/store/lyxa19dhqk0zk4v6vl265m5mrnrjxwbk-python3.12-psycopg-3.2.2/lib/python3.12/site-packages:/nix/store/22d4sr968zx6l3sl7xrzcq4z18frqb7m-python3.12-python-dateutil-2.9.0.post0/lib/python3.12/site-packages:/nix/store/g41x3pgyv05khp5qdqnp4p3mir8jk95s-python3.12-python-dotenv-1.0.1/lib/python3.12/site-packages:/nix/store/fz1lbbdnblqa1aq8cin4cmi1p9ff06jy-python3.12-python-gnupg-0.5.3/lib/python3.12/site-packages:/nix/store/h0xw2af5lgwdwhrjf53ylbizb7f76h2d-python3.12-python-ipware-2.0.0/lib/python3.12/site-packages:/nix/store/c76pbd4k5ixx57nglmhhmcgpci7gzqw5-python3.12-python-magic-0.4.27/lib/python3.12/site-packages:/nix/store/8wqk72ikbazgqrarydxhbsd39rxqcrjg-python3.12-pyzbar-0.1.9/lib/python3.12/site-packages:/nix/store/vsl1d3fsn5v9ldymbl3ibdqwbszrzrj2-python3.12-rapidfuzz-3.9.7/lib/python3.12/site-packages:/nix/store/p5f3h0qhy9ndi2bg6zx3m9ix1vbmy4jq-python3.12-redis-5.0.6/lib/python3.12/site-packages:/nix/store/1d6cjhp004crgy316ycwh2dlk25c72p0-python3.12-scikit-learn-1.5.0/lib/python3.12/site-packages:/nix/store/w03cd4dj2p6xdv8jf7lr9l0571l7zqfl-python3.12-setproctitle-1.3.3/lib/python3.12/site-packages:/nix/store/d7df4rphs2ga3qi6kfwszvbaqvvrxqn0-python3.12-tika-client-0.6.0/lib/python3.12/site-packages:/nix/store/v66xc27ch6vwx2j1s76finhcw4wrb37x-python3.12-tqdm-4.66.4/lib/python3.12/site-packages:/nix/store/vxzklh93y8lhm4a9qc4yl0cb645q94k6-python3.12-uvicorn-0.25.0/lib/python3.12/site-packages:/nix/store/8d9lr98d6bh0bymzfhi2lh4ji459r1pm-python3.12-watchdog-4.0.1/lib/python3.12/site-packages:/nix/store/jkrdrqwdy4yrvr1v6z5sfahxk0yb41m9-python3.12-whitenoise-6.7.0/lib/python3.12/site-packages:/nix/store/ymbz28kb07r7an38l48r3j4y80yghdxy-python3.12-whoosh-2.7.4/lib/python3.12/site-packages:/nix/store/va00s7fr0n6hbkflcm9pnhysdhd6rcz8-python3.12-zxing-cpp-2.2.1/lib/python3.12/site-packages:/nix/store/1nsjcxh43z91p7jb5h6q0rbpiy88asp3-python3.12-hiredis-2.3.2/lib/python3.12/site-packages:/nix/store/mbkhbki3qdijarll5gif80rs1jdq1rw6-python3.12-httptools-0.6.1/lib/python3.12/site-packages:/nix/store/84b7b30qi2v9x63pqda03z0z1yfdgq0p-python3.12-pyyaml-6.0.2/lib/python3.12/site-packages:/nix/store/8r4k22bpl0khvmjaipy6jf7f0385v37i-python3.12-uvloop-0.20.0/lib/python3.12/site-packages:/nix/store/d378q7n42xphsckzrsxhzfrlnl9hh87v-python3.12-watchfiles-0.22.0/lib/python3.12/site-packages:/nix/store/xdiyj235y45f7r0zrfca00170gysdgb3-python3.12-websockets-12.0/lib/python3.12/site-packages:/nix/store/47l6q1ncbpha65983vj4xyj2hg4lab2m-python3.12-html5lib-1.1/lib/python3.12/site-packages:/nix/store/zxl97260xfw4pd13jrnkaghkalbin3y5-python3.12-packaging-24.1/lib/python3.12/site-packages:/nix/store/l7idy2qiiv0v0b6khfjvz3l5k6mnm47l-python3.12-setuptools-72.1.0/lib/python3.12/site-packages:/nix/store/rgfl07w7jjb0mmxgifzyca6g6fh6cq36-python3.12-six-1.16.0/lib/python3.12/site-packages:/nix/store/rrrcpbx8d7w21gm78cscz8xmpiajmd9b-python3.12-webencodings-0.5.1/lib/python3.12/site-packages:/nix/store/zl61g639zczg1fcsd2jxiyw0560zssnx-python3.12-asgiref-3.8.1/lib/python3.12/site-packages:/nix/store/90ysgnzazl1nnwjqdqn9b0py5k2f5wn5-python3.12-typing-extensions-4.12.2/lib/python3.12/site-packages:/nix/store/nr5i59jzfgvni6xrmggm2cmfq0yvqivm-python3.12-sqlparse-0.5.0/lib/python3.12/site-packages:/nix/store/hk6c2mr67vv3cgyq0j380xw3hzqh49sh-python3.12-aioredis-2.0.1/lib/python3.12/site-packages:/nix/store/zvdmb69rq0bbp0wf7yddj2fb7paw4dv8-python3.12-msgpack-1.0.8/lib/python3.12/site-packages:/nix/store/djbqdqgd27dd56hw3iq8jsvrl0z3sslv-python3.12-async-timeout-4.0.3/lib/python3.12/site-packages:/nix/store/gbk8pgnz74hhjwb9f524bfnh88v8y60c-python3.12-portalocker-2.8.2/lib/python3.12/site-packages:/nix/store/cwfjwjxar2lbslrv7ylfhs71khbd1c7s-python3.12-deprecated-1.2.14/lib/python3.12/site-packages:/nix/store/gk1hl6dr6v54hjazcqakgdq1y8sxmap1-python3.12-wrapt-1.16.0/lib/python3.12/site-packages:/nix/store/xkc1v16pqb3h8dgiap1ammqxmlhc0wy2-python3.12-pytz-2024.1/lib/python3.12/site-packages:/nix/store/5hmzxcidgl9mqq1v0knf6mwl8136phlv-python3.12-regex-2024.5.15/lib/python3.12/site-packages:/nix/store/ikar4rm7lw6azrn5kmmvc70lwkks5g0g-python3.12-tzlocal-5.2/lib/python3.12/site-packages:/nix/store/jfjadyx625y7bfswvhypis7xqzalsyk2-python3.12-pyjwt-2.9.0/lib/python3.12/site-packages:/nix/store/87hap7780r72q1by6iv5ars2fq6q62r7-python3.12-python3-openid-3.2.0/lib/python3.12/site-packages:/nix/store/aiz4dvsx8hpchv4p8vkb38cz3bjxnd2d-python3.12-requests-2.32.3/lib/python3.12/site-packages:/nix/store/y018jmspqk2216y996hdm13yzigby3gc-python3.12-requests-oauthlib-2.0.0/lib/python3.12/site-packages:/nix/store/j4mv1n2srn2nil4aghdnsz0fdzjl267c-python3.12-cryptography-43.0.0/lib/python3.12/site-packages:/nix/store/mfs6advjdfwhvxs1m7c1pyy6wkf7w4cz-python3.12-defusedxml-0.8.0rc2/lib/python3.12/site-packages:/nix/store/gwq2l5yzxz4r9r3mjd3dd20nir7krxn2-python3.12-brotlicffi-1.1.0.0/lib/python3.12/site-packages:/nix/store/r0nmaqlf3s730inv37hyh8in1hm7xf2n-python3.12-certifi-2024.07.04/lib/python3.12/site-packages:/nix/store/mdjc15jlsywd76vzf0mkaxy7qdv6lk7h-python3.12-charset-normalizer-3.3.2/lib/python3.12/site-packages:/nix/store/c191z6513b56a0rh3v9afqjcqzlqrlvr-python3.12-idna-3.7/lib/python3.12/site-packages:/nix/store/bk5iap4crdi7ih942zsz7w8pc700yp5v-python3.12-urllib3-2.2.2/lib/python3.12/site-packages:/nix/store/0jzljimwigmf28kz0323vv6xbkg21g6w-python3.12-cffi-1.17.0/lib/python3.12/site-packages:/nix/store/f4kd84nwjrac6sbkgb3w8q2jmfdnq9vn-python3.12-pycparser-2.22/lib/python3.12/site-packages:/nix/store/1p7yjjvrll8v9dcw6wy5dpchvk4jd7bp-python3.12-oauthlib-3.2.2/lib/python3.12/site-packages:/nix/store/10zdxkcczgvqvhkyx4a5z8nc9bwl3l2i-python3.12-celery-5.4.0/lib/python3.12/site-packages:/nix/store/hbhkgnl9ljjzhf897bjc5d2a7v12a3g8-python3.12-billiard-4.2.1/lib/python3.12/site-packages:/nix/store/6iw1m117dyw6dhdga3iddyy0bxw5j9bm-python3.12-click-8.1.7/lib/python3.12/site-packages:/nix/store/zphz82yg2mz8sbvisd64jgwzvhysf42h-python3.12-click-didyoumean-0.3.1/lib/python3.12/site-packages:/nix/store/3rlac8if3hylm5c5fjpa7lblskmzr7vm-python3.12-click-plugins-1.1.1/lib/python3.12/site-packages:/nix/store/fck2yl0fjl47n8qklxhjigmpdbk2c8fg-python3.12-click-repl-0.3.0/lib/python3.12/site-packages:/nix/store/w54rd85q45imn0hm3qnfrz4v6fkib23r-python3.12-kombu-5.4.2/lib/python3.12/site-packages:/nix/store/ikc9cwzlcmjcqa5xmwma56s9nq2g08v8-python3.12-tzdata-2024.1/lib/python3.12/site-packages:/nix/store/bsvdvvq95kvxmhz1c90mif24yyr0kqx8-python3.12-vine-5.1.0/lib/python3.12/site-packages:/nix/store/ssk56x7as1lwvj8irnkgdqq78anvxgji-python3.12-prompt-toolkit-3.0.47/lib/python3.12/site-packages:/nix/store/dnxss7vxm3fbz80wq3cgn1fi3182jr4l-python3.12-wcwidth-0.2.13/lib/python3.12/site-packages:/nix/store/q3wdmbabbacbc5mzjmjgdl5s2rakjpy8-python3.12-amqp-5.2.0/lib/python3.12/site-packages:/nix/store/wn3xniby9nnv4f95lj9i6wgk113w9f4w-python3.12-zstandard-0.22.0/lib/python3.12/site-packages:/nix/store/14pz95mkissy2cb393rycc2w0xb9ia0v-python3.12-brotli-1.1.0/lib/python3.12/site-packages:/nix/store/qd22ipkn6cm1h00w8p02wdwy0sl0d68r-python3.12-aiosmtpd-1.4.6/lib/python3.12/site-packages:/nix/store/4ibscrj9jgcvdjjm6qi85a1rq3h8fhh1-python3.12-looseversion-1.3.0/lib/python3.12/site-packages:/nix/store/axkgpqx5s02s9bbviv1g3bvh2i626dgz-python3.12-atpublic-5.0/lib/python3.12/site-packages:/nix/store/i8fan7ly4nqzam5rx4www1ggabzan8gl-python3.12-attrs-23.2.0/lib/python3.12/site-packages:/nix/store/3n1zrmj8y18gw15p1m9dg2sgfhn8h34w-python3.12-pygments-2.18.0/lib/python3.12/site-packages:/nix/store/jaqf0b5hvd8wazazss1a2h0gfhhwsxm4-python3.12-humanize-4.10.0/lib/python3.12/site-packages:/nix/store/pnxrcgbbycb7q1yvlfy8xkhafy5k5mww-python3.12-prometheus-client-0.20.0/lib/python3.12/site-packages:/nix/store/fjc7rl7jrkmsi2570x3i6z3ijv96vy50-python3.12-tornado-6.4.1/lib/python3.12/site-packages:/nix/store/jg65k2a2h1965m3v1h1nfg69hdwf9bkc-python3.12-httpx-0.27.0/lib/python3.12/site-packages:/nix/store/x6b6m7x2is5x03ig67fkpg1rxhz7q54f-python3.12-h2-4.1.0/lib/python3.12/site-packages:/nix/store/xz0s3iqdhkn62z5z2gy9i7p6v2995d3l-python3.12-anyio-4.4.0/lib/python3.12/site-packages:/nix/store/1jsgkgj22j8gz34qgfvvlpakqr1xz23b-python3.12-httpcore-1.0.5/lib/python3.12/site-packages:/nix/store/0awc9c3m3q3cfg0g1yjy46ylg7rnc30r-python3.12-sniffio-1.3.1/lib/python3.12/site-packages:/nix/store/kf7i48l3gkarhbfihks8hrr98kb11kz2-python3.12-h11-0.14.0/lib/python3.12/site-packages:/nix/store/8dx1hrcrj6nrbja0q54yxkdpybpbgpzk-python3.12-hpack-4.0.0/lib/python3.12/site-packages:/nix/store/26sbx3s0xj9nrnhghqzgb3fg6x3z1m6i-python3.12-hyperframe-6.0.1/lib/python3.12/site-packages:/nix/store/i9aqkjx7dszwz5gzrfhr4wdc4ypba6gn-python3.12-inotify-simple-1.3.5/lib/python3.12/site-packages:/nix/store/86wx638i6ghdsw6sfyprkccinpc5jxw8-python3.12-joblib-1.4.2/lib/python3.12/site-packages:/nix/store/glbinh864vd0fz25r60j0g1d8byfrd5m-python3.12-lz4-4.3.3/lib/python3.12/site-packages:/nix/store/8gv60b3hhvvzq7kfwcs5pldbwny1xfbk-python3.12-psutil-6.0.0/lib/python3.12/site-packages:/nix/store/bgjvvgg2fczq7s4ymlfx91sf1k7c6skk-python3.12-deprecation-2.1.0/lib/python3.12/site-packages:/nix/store/g0cp52ym4772918alpwbdqb9lyj4q41j-python3.12-img2pdf-0.5.1/lib/python3.12/site-packages:/nix/store/vqk58xx58ca0l2l0lmfg4ycxifmglvdb-python3.12-pdfminer-six-20240706/lib/python3.12/site-packages:/nix/store/0q4l7ssf2z1m4zbkvk0isrh6hdav5bgf-python3.12-pillow-heif-0.17.0/lib/python3.12/site-packages:/nix/store/m8qf7hyy7vbhqqvsmfm0cxwyddd1nlgj-python3.12-pikepdf-9.1.1/lib/python3.12/site-packages:/nix/store/w6vid70x0mq6c5s7mygcvraq6wg39s02-python3.12-pillow-10.4.0/lib/python3.12/site-packages:/nix/store/x00mzlggxw64q374j8iviylh9c8wq0a0-python3.12-pluggy-1.5.0/lib/python3.12/site-packages:/nix/store/kbikcdysm8zvdfdf1h7660aqvpp8vzjl-python3.12-rich-13.7.1/lib/python3.12/site-packages:/nix/store/h3bypadd78i0bwcsjhbwc1zsddqhpzhj-python3.12-lxml-5.2.2/lib/python3.12/site-packages:/nix/store/lv0nc0d2f9k1fbw4r3zrqarn47vgsvcq-python3.12-olefile-0.47/lib/python3.12/site-packages:/nix/store/krfx2224r0gbjr97g8lm8f4kb3nbsaan-python3.12-markdown-it-py-3.0.0/lib/python3.12/site-packages:/nix/store/iazab0x1qgh4s5qwznis44sc432z6b6d-python3.12-mdurl-0.1.2/lib/python3.12/site-packages:/nix/store/bcm0lxrndvf5ifk2ckw42p4lvp1gfcv7-python3.12-psycopg-c-3.2.2/lib/python3.12/site-packages:/nix/store/fvxlmgcjanv8j0qxzxxgxigq1344zn39-python3.12-numpy-1.26.4/lib/python3.12/site-packages:/nix/store/1nznx3yrv1lz0r1z49mwxxqjsfzikdrw-python3.12-scipy-1.14.0/lib/python3.12/site-packages:/nix/store/izivqf4vhwasj98nqp91f04i58wlg04y-python3.12-threadpoolctl-3.4.0/lib/python3.12/site-packages:/nix/store/ja8qryjdn70zpcw5krbmh48ia421svr4-python3.12-hatchling-1.25.0/lib/python3.12/site-packages:/nix/store/cnd6bff7q5f62sjlg6b9hv5f6h9568is-python3.12-editables-0.5/lib/python3.12/site-packages:/nix/store/rn4ax82sshnyz3i4pas51xqlsp011y10-python3.12-pathspec-0.12.1/lib/python3.12/site-packages:/nix/store/g84rnslf2pgmjbgr7vqgxngq6dkh2rc5-python3.12-trove-classifiers-2024.7.2/lib/python3.12/site-packages:/nix/store/5k7adrpfdchgyniyk97f4a8k5asynmwv-paperless-ngx-2.12.1/lib/paperless-ngx/src" Environment="TZDIR=/nix/store/897xqnq52vw76991r5m80h9j91370vj9-tzdata-2024a/share/zoneinfo" CacheDirectory=paperless CapabilityBoundingSet= DeviceAllow= ExecStart=/nix/store/4gvh137s592akhivsrz8bb0pp3z9z9vs-unit-script-paperless-web-start/bin/paperless-web-start LimitNOFILE=65536 LockPersonality=true MemoryDenyWriteExecute=true NoNewPrivileges=true PrivateDevices=true PrivateMounts=true PrivateNetwork=false PrivateTmp=true PrivateUsers=true ProtectClock=true ProtectControlGroups=true ProtectHostname=true ProtectKernelLogs=true ProtectKernelModules=true ProtectKernelTunables=true ProtectProc=invisible ProtectSystem=strict ReadWritePaths=/var/lib/paperless/consume ReadWritePaths=/var/lib/paperless ReadWritePaths=/var/lib/paperless/media Restart=on-failure RestrictAddressFamilies=AF_UNIX RestrictAddressFamilies=AF_INET RestrictAddressFamilies=AF_INET6 RestrictNamespaces=true RestrictRealtime=true RestrictSUIDSGID=true Slice=system-paperless.slice SupplementaryGroups=redis-paperless SystemCallArchitectures=native SystemCallFilter=@system-service SystemCallFilter=~@privileged @setuid @keyring SystemCallFilter=@setuid mbind UMask=0066 User=paperless ```

So, please read the documentation again and make my suggested changes or prove I am wrong. [...]

Could you be more explicit about which exact changes you are suggesting? It is not clear to me based on what has previously been discussed. Best would be a patch or a PR, but an example or two would probably work as well.

hacscred commented 1 month ago

If you know the value of the Slice attribute of the various paperless services already have a prefix of paperless-, you can interpret my comment as a request to define the Slice value in the module for all of the services (since I am in the church of defaults are awful to depend on), but if others don't care then feel free to ignore that request.

I would like to see such Slice values defined to not be surprised. I think people which are not systems experts should also quickly be able to understand what's happening.

h7x4 commented 1 month ago

If you know the value of the Slice attribute of the various paperless services already have a prefix of paperless-, you can interpret my comment as a request to define the Slice value in the module for all of the services [...]

I might just be dense, but I still don't understand what change you are asking for. All of the 4 paperless services now has Slice = system-paperless.slice, with the system- prefix ensuring that the paperless slice is part of the slice containing all systemwide services. It would be great if you could provide an example of the exact change you are asking for. What do you want the contents of systemd.services.paperless-web.serviceConfig.Slice to be?

I would like to see such Slice values defined to not be surprised. I think people which are not systems experts should also quickly be able to understand what's happening.

I'd be happy to document the approach with both how's and why's around slices and resource control. I can especially see how the system- prefix in particular could be confusing, as we have already had a hiccup with phpfpm. But I'm not really able to pinpoint the other points of confusion, apart from never having seen slices before maybe? Is there anything we should do differently to make things more inherently clear in the config?

hacscred commented 1 month ago

I expected Slice = system-paperless-web.slice for the web service, etc. AFAIU, that's how the system of slices is intended to be used.

I think operationally it would be the same if the web service never gets another sub-service.

hacscred commented 1 month ago

I think I missed the Slice definition once, because every other setting seemed alphabetically ordered.

I would just use the same style.