[systemd-devel] user slice changes for uid ranges

Jérémy ROSEN jeremy.rosen at smile.fr
Sun Sep 29 14:07:24 UTC 2019


I don't have a complete solutions, but here are a couple of tools that you
might be able to assemble into something that work
* dropins,  you could do a dropin for every existing UID that sets the
Slice= field
* generators : could be used to generate those dropins....
* also note that if a unit is named a-b-c.service, systemd will look for
dropins named a-b-.service and a-.service... there might be something to do
with that, but I havn't given it much thought

Le ven. 27 sept. 2019 à 18:28, Mantas Mikulėnas <grawity at gmail.com> a
écrit :

> On Fri, Sep 27, 2019 at 5:03 PM Stijn De Weirdt <stijn.deweirdt at ugent.be>
> wrote:
>
>> hi all,
>>
>> i'm looking for an "easy" way to set resource limits on a group of users.
>>
>> we are lucky enough that this group of users is within a (although
>> large) high enough range, so a range of uids is ok for us.
>>
>> generating a user-<uid>.slice file for every user (or symlink them or
>> whatever) looks a bit cumbersome, and probably not really performance
>> friendly if the range is in eg 100k (possible) uids.
>>
>> e.g. if this range was 100k-200k, i was more looking for a way to do
>> e.g. user-1XXXXX.slice or user-100000:200000.slice
>>
>
> As far as I know there isn't a good systemd-native method for this, but
> you can dynamically set slice parameters during PAM processing, as in this
> blog post:
> https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu1804SystemdUserLimits
>
> --
> Mantas Mikulėnas
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 
[image: SMILE]  <http://www.smile.eu/>

20 rue des Jardins
92600 Asnières-sur-Seine
*Jérémy ROSEN*
Architecte technique

[image: email] jeremy.rosen at smile.fr
[image: phone]  +33 6 88 25 87 42
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>

[image: Découvrez l’univers Smile, rendez-vous sur smile.eu]
<https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190929/f54149cd/attachment.html>


More information about the systemd-devel mailing list