I am using PPODMAN systemd based podman containers and to kill the container I just execute the command systemctl halt
and the container gets killed. I execute following steps:
Create Container
podman create -t -i \
--restart=always \
--systemd=true \
--name test \
oraclelinux:7 /usr/sbin/init
Start the Container
podman start test
Kill the container
podman exec -i -t test /bin/bash
systemctl halt
I want to directly call the system call which basically called by the systemctl halt
command. How can I call the API using C?