Question: I need help with this l inux SYSTEMD, How do i do this Write a systemd service unit called heartbeat. The function of this service

I need help with this linux SYSTEMD, How do i do this

Write a systemd service unit called heartbeat. The function of this service is to write a log message to /var/log/messages every ten seconds. Start this service.

When you run the command systemctl status heartbeat, you should see output similar to the following:

[root@localhost system]$ systemctl status heartbeat.service  heartbeat.service - heartbeat service Loaded: loaded (/etc/systemd/system/heartbeat.service; disabled; vendor preset: disabled) Active: active (running) since Mon 2018-01-08 21:15:14 EST; 1min 34s ago Main PID: 24626 (bash) CGroup: /system.slice/heartbeat.service 24626 /usr/bin/bash -c while sleep 10; do /usr/bin/logger Still alive...; done 27946 sleep 10 Jan 08 21:15:14 localhost.localdomain systemd[1]: Started heartbeat service. Jan 08 21:15:14 localhost.localdomain systemd[1]: Starting heartbeat service... 

When you run the command tail /var/log/messages, you should see output similar to the following:

[root@localhost system]$ tail /var/log/messages Jan 8 21:16:25 localhost logger: Still alive... Jan 8 21:16:35 localhost logger: Still alive... Jan 8 21:16:45 localhost logger: Still alive... Jan 8 21:16:55 localhost logger: Still alive... Jan 8 21:17:05 localhost logger: Still alive... Jan 8 21:17:15 localhost logger: Still alive... Jan 8 21:17:25 localhost logger: Still alive... Jan 8 21:17:35 localhost logger: Still alive... Jan 8 21:17:45 localhost logger: Still alive... Jan 8 21:17:55 localhost logger: Still alive... 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!