I'd like to send a systemd notification with readiness and main pid. Unfortunately, it seems like systemd doesn't cope with translating pids from different namespaces. (Just a guess...)
Specifically, I'm staring a service with:
ExecStart=podman run --rm --cgroups=disabled -v /run/systemd:/run/systemd ... script.sh
And the started script does:
echo "MAINPID=$$" | nc -uUN -w0 /run/systemd/notify
This doesn't seem to change anything. The MAINPID is set to either conman (default) or podman (--sdnotify=ignore
). Then again, I'm effectively sending MAINPID=1
from inside the running container.
Is there some workaround here to ensure a specific process inside the service/container becomes the MAINPID instead?