Shell script to check process is running or not in Linux Penguin Technology - 12:58 Edit Write a Shell script to check process is running or not in Linux#!/bin/bashpid=`pgrep -f apache2`pid_count=${#pid[@]}if [ $pid_count -gt "1" ];then echo "Apache pid not found" exit 1else echo "Starting service" service apache2 startfi Share on Facebook Share on Twitter Share on Google Plus About Penguin Technology I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices. RELATED POSTS
0 comments:
Post a Comment