Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

Getting ready

The first step is to determine whether your system is using the SysV init calls, systemd, or upstart.

Linux/Unix systems must have an initialization process running as PID 1. This process executes a fork and exec to start every other process. The ps command may tell you which initialization process is running:

    $ ps -p 1 -o cmd
    /lib/system/systemd

In the previous example, the system is definitely running systemd. However, on some distributions, the SysV init program is sym-linked to the actual init process, and ps will always show /sbin/init, whether it's SysV init, upstart, or systemd that's actually being used:

    $ ps -p 1 -o cmd
    /sbin/init

The ps and grep commands give more clues:

    $ ps -eaf | grep upstart

Alternatively, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985