On 11 Feb 2016 3:37 p.m., "Adam Borowski" <kilobyte@angband.pl> wrote:
>
> On Thu, Feb 11, 2016 at 11:59:09PM +0530, Pirate Praveen wrote:
> > Checking /proc/cmdline was working in my test machine as I had systemd before it became the default.
> >
> > I think checking /proc/1/cmdline will be a better method of checking systemd.
>
> /proc/1/cmdline will be wrong in chroots if the chroot doesn't use systemd
> but the host system does. You want to check /run/systemd instead.
>
[ -d /run/systems/system ] specifically, as per sd_booted upstream API.
Reason for this is that user session systemd can run without a system one, or logind (old) used standalone. And that means /run/systemd will be present for those cases without pid1 being systemd.
https://www.freedesktop.org/software/systemd/man/sd_booted.html
> --
> A tit a day keeps the vet away.
>