On Wed, Jul 31, 2013 at 9:39 PM, Wang Xuerui <idontknw.w...@gmail.com> wrote:
> 在 2013-8-1 上午10:26, <cov...@ccs.covici.com>写道:
>
>
>>
>> Can a shell script tell if systemd is the init?  I have a couple of
>> places where it would be nice to know this.
>>
>> Thanks in advance for any suggestions.
>
> Check /proc/1/comm or something like that, IIRC...

Yep:

if grep -q systemd /proc/1/comm; then
    echo systemd
else
    echo "not systemd"
fi

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México

Reply via email to