What systemd unit is that process running under?

cgroups v1: grep '^1:name=systemd:' /proc/$pid/cgroup | sed 's/^1:name=systemd://'

cgroups v2: grep '^0::' /proc/$pid/cgroup | sed 's/^0:://'

*****
Written on