apache2ctl detects if systemd is in use by looking at the owner of /proc/1/exe.
Under docker, however, this cannot be relied on and may simply be the command being run:
$ docker run --rm --name "apache2-test" 26ff08910bcd ls -l /proc/1/exe
lrwxrwxrwx 1 root root 0 Feb 23 22:07 /proc/1/exe -> /usr/bin/ls
Another way to look for systemd is [ -d /run/systemd/system ], which may be worth having as a fallback to check if /proc/1 is not systemd.
apache2ctl detects if systemd is in use by looking at the owner of /proc/1/exe.
Under docker, however, this cannot be relied on and may simply be the command being run:
$ docker run --rm --name "apache2-test" 26ff08910bcd ls -l /proc/1/exe
lrwxrwxrwx 1 root root 0 Feb 23 22:07 /proc/1/exe -> /usr/bin/ls
Another way to look for systemd is [ -d /run/systemd/system ], which may be worth having as a fallback to check if /proc/1 is not systemd.