I have a third party (Microsoft) that bundles a product (SQL Server 2017) as a systemd task. Everything pretty much works, but their bundling actually checks if the service is running with checkrunninginstance.sh which has,

systemctl status mssql-server > /dev/null 2>&1
exit $?

This is problematic because I can't find a way for the container itself to either,

  • integrate with the host's copy of systemd, from a chroot
  • run as systemd using nspawn

Is it advised for systemd tasks to use systemd themselves? If so, how do you do it?

  • Your question is unclear, can you please try to clarify? If you're running something in a container, you might want to consider using machinectl to run it. It's compatible with systemd-nspawn but it registers it as a "machine." Also note that you can ask systemctl on the host to tell you about the status of services inside a machine (registered by machinectl) by passing systemctl the -M argument. – filbranden Jul 26 '18 at 5:35
  • You might enjoy this article about container integration with systemd. Good luck! – filbranden Jul 26 '18 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.