I have two shell scripts name first.sh and second.sh. The contents of first.sh and second.sh are given below:
>>first.sh
#!/bin/bash
while true
do
echo The current time is $(date)
sleep(1)
done
>>second.sh
#!/bin/bash
while true
do
echo The current time from second script is $(date)
sleep(1)
done
Similarly, the content of first.service is:
[Unit]
Description=first service
After=second.service
[Service]
ExecStart=/home/abanstola/first.sh
The content of second.service is:
[Unit]
Description=Second service
[Service]
ExecStart=/home/abanstola/second.sh
Note the After=second.service
in the first.service code. According to the docs, the first service should not be running until the second service starts. But even if I disable or stop the second service, the first service runs without any problem. What am I doing wrong here?