Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

keep services up no matter what

function finish {
    # re-start service
    sudo /etc/init.d/something start
}
trap finish EXIT
sudo /etc/init.d/something stop
# Do the work...

# Allow the script to end and the trapped finish function to start the
# daemon back up.
Source by redsymbol.net #
 
PREVIOUS NEXT
Tagged: #services #matter
ADD COMMENT
Topic
Name
2+1 =