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 |