lastpeony4
lastpeony4

Reputation: 577

How to detect if a Java application running as a systemd service is operating within an LXC container?

I am trying to detect if java app running as systemd service is operating inside lxc container from app itself through java code.

checking /proc/self/cgroup file for “lxc” string works if app is not started as a service.

If its started as a service this file does not contain anything related to “lxc”

I need a way to detect if java app is running inside lxc even if its started through sudo service serviceName start

Upvotes: 1

Views: 48

Answers (0)

Related Questions