Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] how to tell you are using systemd?
Date: Thu, 01 Aug 2013 03:11:54
Message-Id: CADPrc80m8qih3dykiEgELHJKHVPBakLo3hRn6f5n7f1+seQtow@mail.gmail.com
In Reply to: Re: [gentoo-user] how to tell you are using systemd? by Wang Xuerui
1 On Wed, Jul 31, 2013 at 9:39 PM, Wang Xuerui <idontknw.wang@×××××.com> wrote:
2 > 在 2013-8-1 上午10:26, <covici@××××××××××.com>写道:
3 >
4 >
5 >>
6 >> Can a shell script tell if systemd is the init? I have a couple of
7 >> places where it would be nice to know this.
8 >>
9 >> Thanks in advance for any suggestions.
10 >
11 > Check /proc/1/comm or something like that, IIRC...
12
13 Yep:
14
15 if grep -q systemd /proc/1/comm; then
16 echo systemd
17 else
18 echo "not systemd"
19 fi
20
21 Regards.
22 --
23 Canek Peláez Valdés
24 Posgrado en Ciencia e Ingeniería de la Computación
25 Universidad Nacional Autónoma de México