Question: Exercise 1: create a startup script for an application called sleep-walking-server, which is provided below. The script should be named sleep-walking and accept start and

Exercise 1:

create a startup script for an application called sleep-walking-server, which is provided

below. The script should be named sleep-walking and accept "start" and "stop" as arguments.

If anything other than "start" or "stop" is provided as an argument, display a usage statement:

"Usage sleep-walking start|stop" and terminate the script with an exit status of 1.

To start sleep-walking-server, use this command: "/tmp/sleep-walking-server &"

To stop sleep

-walking-server, use this command: "kill $(cat /tmp/sleep-walking-server.pid)"

Here is the contents of "sleep-walking-server". Be sure to put this file in /tmp and run chmod

755 /tmp/sleep-walking-server

#!/bin/bash

PID_FILE="/tmp/sleep-walking-server.pid"

trap "rm $PID_FILE exit" SIGHUP SIGINT SIGTERM

echo "$$" > $PID_FILE

while true

do

:

done

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 Finance Questions!