[systemd-devel] systemd and process migration

Lennart Poettering lennart at poettering.net
Mon Apr 20 06:58:58 PDT 2015


On Mon, 20.04.15 14:59, Adrian Reber (adrian at lisas.de) wrote:

> Using CRIU I have been migrating processes from one system to another
> for the last few months (even years). I am now interested in migrating
> processes under systemd's control. Before starting to look how to make
> it work I wanted to know if there has been any discussion if and how
> systemd and CRIU can work together?

Not that I was aware of.

Personally I do not really believe in the idea of CRIU. I mean, I can
see that people want the functionality, but given the amount of
context processes maintain about the system I find it quite illusionary
that this can work for any but the most simple programs.

> Dumping a process under systemd's control should be no problem.
> After criu has dumped the process (and killed it) systemd should know
> that it does not need to restart the process, but even if the process is
> restarted by systemd it does not hurt the process migration.
> 
> The interesting part happens on the system where the process wants to be
> migrated to. After the process has been dumped and transfered from the
> source system to the destination system it needs to be restarted. So far
> this works with different tested processes (postgresql is my current
> test process). If I want to restore the process as a systemd child
> process I have the problem that the process would have to be re-parented
> to systemd after restarting which is not possible in Linux. Therefore I
> need the help of systemd.
> 
> My plan now would be to transfer the process to the destination
> system and tell systemd I want to restore a process which should be
> under systemd's control after the restore has completed. Therefore
> systemd needs to run criu with the option to restore the new process as
> a criu sibling. Thus systemd would be the correct parent process.
> 
> Is this something which would be useful to integrate into systemd?
> I have some ideas how this could be implemented and how the user
> interfaces could look like. Before going in too much detail I want to
> find out if this is a direction which makes sense.

systemd has no provisions for anything like this and I have doubts it
really should have. I mean, normal programs retain ccess to the cgroup
tree, so you could readd whatever you restore back in the cgroups, but
that's hardly sufficient to make systemd aware of a process like this
properly.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list