Restart the service today and find that there is no restart item in the service bin directory. For more information, you can only restart a service by running the stop command and start command. Therefore, I wrote a shell script restart. sh to restart the instance by calling the stop and start commands. At first, I used the exec command to call the stop. sh and start. sh scripts. Stop. sh script, the command is executed and released, and the start is not called. sh script to view the stop. sh script content, found that there is a command exit, resulting in command execution now exit. I wanted to get rid of the stop. sh script and thought it was not as good as the original service script content, so I didn't change it! The Command Script www.2cto.com is as follows: exec./stop. shexec./start. sh. Then, after removing the exec command, it will be available. No matter what the previous stop. sh script executes or whether the execution is successful, it does not interfere with the execution of the following commands. This is the desired effect, so exec is used to achieve the desired effect. The modified Command Script is as follows:./stop. sh./start. sh author wkm