I want to send WatchDogSec from /lxc/childapp2/media/app which is being started inside the container.
I think it is not happening with this service file as systemd considers lxc-attach as main process and expects WatchDogSec from it not from /app process.
Thank you for the feedback.
Do you mean login as user(here it is appfw) and then execute systemctl commands from there?
But is it not possible to use Watchog feature of linux in lxc in host itself
/usr/local/bin/lxc-start -n childapp2 will start the container and its init system.
You can then configure the init system inside that container to run the service you want when the container starts.
“But is it not possible to use Watchog feature of linux in lxc in host itself” - I’m not sure what you mean by that? If the service is running inside the container then it cannot access the host.
My requirement is to run an unprivilaged container via systemd command from the host.
If i give ,
ExecStart= lxc-attach -n <container_name> – <binary_to_execute>
lxc-attach becomes the main process to systemd and it keeps tracking lxc-attach.
I want to maintain the lifecycle of the service based on the application running inside. So i want to make systemd track the binary i executed with lxc-attach
I can even start the container as systemd unit.
My requirement is control the application started inside the container using watchdogSec feature of systemd(i.e., to get the sd_notify from the application nside the container)
Does that use a notify socket specified in an env var NOTIFY_SOCKET?
If so then that won’t work as the container process won’t be able to access the notify socket from the host’s systemd.
I believe a simpler approach would be to get the systemd inside the container to start the process on container start and then use the watchdog feature inside the container.
ok…thank you for the feedback
is there any particular procedure to get systemd inside the container
Below is the status for one of my servies. Is it normal for app_c not listing under systemd cgroups? Does it mean systemd cannot see the application running from lxc-attach?