[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Script vs command line behaviour



On Thu, 13 Oct 2016, Mark Fletcher wrote:
> but I don't completely understand what you mean. Are you saying that, 
> even though the command to start fetchmail is not an invokation of a 
> systemd unit, the fact that it is happening from inside a script that is 
> run by a systemd unit somehow allows systemd to capture the PID for 
> fetchmail, and that that in turn is having a bearing on my being able to 

Yes.

try "ps xawf -eo pid,user,cgroup:64,args" to see how things are grouped
into "cgroups" by systemd (or by the kernel autogroup facility, or by
cgmanager on systemd-less systems, etc).

Depending on how the systemd unit is configured, systemd will kill
everything belonging to that unit's cgroup when you tell it to stop the
unit.

You can have an unit start processes in a separate cgroup (so they don't
get killed along with the unit), refer to the systemd-run command.


There are other ways to deal with this as well, and they might be more
idiomatic.  I was waiting for someone that groks systemd better to
reply, but since nobody did, here is an workable answer to get you
started :-)

-- 
  Henrique Holschuh


Reply to: