<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div>Hi Lennart,</div><div><br></div><div>Thanks for the response.</div><div><br></div><div>I am fairly new to systemd, may be I am not familiar with exact systemd terminology.</div><div><br></div><div>I am starting the container using the command either "<span><b>machinectl start appscont</b></span>" or "<span><b>systemctl status systemd-nspawn@appscont</b></span>" after "<span><b>systemctl daemon-reload</b></span>"</div><div><br></div><div><b>override.conf</b> is effective when it is placed in <b>/etc/systemd/system/systemd-nspawn@service.d/</b></div><div><br></div><div>If I have file <b>systemd-nspawn@appscont.service </b>in <b>/etc/systemd/system.control/systemd-nspawn@appscont.service.d, </b>it is not effective, it's using the template file.</div><div><br></div><div>Please let me know, Where exactly am I supposed to drop-in and what should be the name of the unit file ?</div><div><br></div><div class="ydpda4a506fsignature">Regards<br>Mahipal</div></div>
<div><br></div><div><br></div>
</div><div id="ydp874c0f2cyahoo_quoted_2850629341" class="ydp874c0f2cyahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Wednesday, 18 July, 2018, 3:15:56 PM GMT-4, Lennart Poettering <lennart@poettering.net> wrote:
</div>
<div><br></div>
<div><br></div>
<div>On Mi, 18.07.18 19:10, <a shape="rect" href="mailto:patlollamahipal@yahoo.co.in" rel="nofollow" target="_blank">patlollamahipal@yahoo.co.in</a> (<a shape="rect" href="mailto:patlollamahipal@yahoo.co.in" rel="nofollow" target="_blank">patlollamahipal@yahoo.co.in</a>) wrote:<br clear="none"><br clear="none">> Hi All,I am using systemd-nspawn(systemd version 237) to create a container in Yocto's embedded Linux environment on Cortex-A53<br clear="none">> <br clear="none">> Content of the file<br clear="none">> <br clear="none">> <br clear="none">> /etc/systemd/system/systemd-nspawn\@.service.d/override.conf<br clear="none">> <br clear="none">> is[Service]ExecStart=ExecStart=/usr/bin/systemd-nspawn --quiet --boot --link-journal=try-guest --machine=%i -n --property=CPUQuota=10%I am trying to load the CPU with <br clear="none">> <br clear="none">> sha1sum /dev/zero &<br clear="none">> <br clear="none">> <br clear="none">> or <br clear="none">> <br clear="none">> <br clear="none">> for i in 1 2 3 4; do while : ; do : ; done & done<br clear="none">> <br clear="none">> <br clear="none">> inside the container but the top command on host shows that always<br clear="none">> they are at 50% CPU usage altogether(4 sh processes and one sha1sum<br clear="none">> process, if only sha1sum process is started, it alone uses 50% if<br clear="none">> not 10% each) I am unable to understand if there is any other<br clear="none">> setting where this 50% limitation is coming from? And why CPU quota<br clear="none">> passed to systemd-nspawn is not effective?I also tried<br clear="none">> with /etc/systemd/system/<a shape="rect" href="mailto:systemd-nspawn@.service.d" rel="nofollow" target="_blank">systemd-nspawn@.service.d</a>/cpu.conf, still<br clear="none">> the same result but if I pass MemoryMax=50M, process gets killed if<br clear="none">> i try to use more than 50M in total inside the container.If anyone<br clear="none">> knows please help. Thank<br clear="none"><br clear="none">nspawn's --property= is only relevant if nspawn allocates a scope unit<br clear="none">for the container. But that's not what <a shape="rect" href="mailto:systemd-nspawn@.service" rel="nofollow" target="_blank">systemd-nspawn@.service</a> is for:<br clear="none">in that case nspawn simply makes use of the service unit it is already<br clear="none">run in. This is documented in the man page, if you have a look.<br clear="none"><br clear="none">Or in other words: in your unit file drop-in just place CPUQuota=<br clear="none">directly in your [Service] Section:<div class="ydp874c0f2cyqt8359726773" id="ydp874c0f2cyqtfd95541"><br clear="none"><br clear="none"> [Service]<br clear="none"> CPUQuota=10%</div><br clear="none"><br clear="none">And do not make any changes to ExecStart=.<br clear="none"><br clear="none">Lennart<br clear="none"><br clear="none">-- <br clear="none">Lennart Poettering, Red Hat<div class="ydp874c0f2cyqt8359726773" id="ydp874c0f2cyqtfd35154"><br clear="none"></div></div>
</div>
</div></div></body></html>