Skip to content

Better way to restart services #1

@MiteshShah

Description

@MiteshShah

Sometime service is failed to stop/start/restart in this case
https://github.com/rtCamp/rtAdmin/blob/master/zzz/restart.sh is not able to detect weather the service is restarted successfully or not.

I've some solutions for this problems

!/bin/bash

Restart the MySQL Service

service mysql restart

MySQL Restarted Susscessfully?

CHECK=$(echo $?)

If MySQL Is Not Restarted

Then Restart MySQL Service

while [ $CHECK -gt 0 ]
do
#echo In While $CHECK
service mysql restart
CHECK=$(echo $?)

done

Restart the PHP5-FPM Service

service php5-fpm restart

PHP5-FPM Restarted Susscessfully?

CHECK=$(echo $?)

If PHP5-FPM Is Not Restarted

Then Restart PHP5-FPM Service

while [ $CHECK -gt 0 ]
do
#echo In While $CHECK
service php5-fpm restart
CHECK=$(echo $?)

done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions