Practical Linux Command Line 2.0 - Make a Program Start on Boot with Systemd

Practical Linux Command Line 2.0 - Make a Program Start on Boot with Systemd

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

This tutorial explains how to run scripts on boot using systemd, a powerful Linux utility. It covers creating a service file, configuring it with the correct syntax, and enabling it to run on boot. The video also demonstrates how to manage services using systemctl commands, including enabling, disabling, starting, and stopping services. The tutorial highlights the advantages of using systemd over Cron for boot scripts and provides practical examples of creating and managing a logs folder in the home directory.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a major limitation of using Cron for running scripts on boot?

Cron is not available on all Linux systems.

Cron is currently unstable for running scripts on boot.

Cron requires root privileges to run any script.

Cron does not support scheduling tasks at specific times.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the first step in creating a systemd service for running a command on boot?

Writing a bash script for the command.

Defining the command to be executed.

Enabling the service using systemctl.

Creating a symlink in the system directory.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a systemd service file, what does the 'After' directive specify?

The target after which the service should start.

The user under which the service will run.

The command to be executed by the service.

The description of the service.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which section of the systemd service file contains the command to be executed?

[Service]

[Unit]

[Command]

[Install]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you ensure a systemd service runs on boot?

By adding the service to the Cron tab.

By enabling the service with systemctl.

By creating a symlink in the home directory.

By using the 'start' command with systemctl.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What command would you use to stop a running systemd service without disabling it?

systemctl halt

systemctl disable

systemctl stop

systemctl remove

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a potential use case for combining systemd and Cron?

To run a script only once at a specific time.

To create and manage user accounts automatically.

To create a folder on boot and log data periodically.

To install software packages automatically.