[systemd-devel] controlling IO from a transient service

jsl6uy js16uy js16uy at gmail.com
Wed Jun 29 21:55:21 UTC 2016


Did NOT even consider the consequence of the su. been pounding the head.
Thanks very much sir!
will try as you recommend and report back

best regards

On Wed, Jun 29, 2016 at 4:00 PM, Lennart Poettering <lennart at poettering.net>
wrote:

> On Tue, 28.06.16 11:20, jsl6uy js16uy (js16uy at gmail.com) wrote:
>
> > Hello all, hope all is well
> >
> > Should I be able to control the IO for a tar process?
> >
> > I am on arch linux using systemd-run to initiate a service to which I can
> > apply resource limits
> >
> > Linux 4.6.2-1-ARCH #1 SMP PREEMPT Wed Jun 8 08:40:59 CEST 2016 x86_64
> > GNU/Linux
> >
> >  systemctl --version
> > systemd 230
> > +PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP
> > +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
> >
> >
> > I am starting a transient service with the parameters below. I have tried
> > several combinations
> >
> > sudo systemd-run --unit=loadio -p "BlockIOWriteBandwidth=/dev/dm-1 50M"
> --
> > su - foo -c "cd $PWD && tar vcf custom_box.box ./metadata.json
> > ./Vagrantfile ./box.img"
>
> So this creates a transient service unit, and then runs "su" inside of
> it, which will create a separate transient scope unit for the login
> session "su" creates.
>
> Or in other words: you actually create a the unit correctly, but then
> immediately escape it again for the actual command you want to run.
>
> Consider using the "User=" property instead of "su". "User=" does not
> involve PAM and hence does not result in creation of a new user login
> session.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160629/7345f52d/attachment.html>


More information about the systemd-devel mailing list