DWQA QuestionsCategory: ServerAfter running the shell script, will remote login flash back?
ccpython asked 1 month ago

I wrote the following script:

#! /bin/bash
source service supervisor stop
source service supervisor start
source service nginx restart

usechmod 755After giving permission, I ran it. Returned:
stopping supervisor...
Then change the script to:

#! /bin/bash
source service supervisor stop &&
source service supervisor start &&
source service nginx restart 

Run again or return:

stopping supervisor...

Wait for me to use any of the following commands in the terminal:

source service supervisor start
source service supervisor status

The same is true of nginx’s commands. Before flashing back, you will be prompted:

basename invalid option -- 'b'
Try 'basename --help' for more information.

I don’t know much about Linux. After reading the tutorial, I wrote the script. This time, I know it’s wrong. Please give me some advice.

jokester replied 1 month ago

Find the file called service and send the content

jokester replied 1 month ago

I didn’t find the service file, but this onearticleI talked about how to use Ubuntu service, and I want to send the files under / etc / init. D /?

1 Answers
Samuelren answered 1 month ago

Try removing the source

Samuelren replied 1 month ago

Who told you to add source before the order

ccpython replied 1 month ago

You’re right. Would you please explain?

ccpython replied 1 month ago

In this tutorialWith this command, I copied it into the script.