1

Now, I need to start the server like this.

$./server.start

I have to this every time I start and logged into my machine. It would be so good if there is a script which does the same automatically when I again start the machine.

Need help with that.

1
  • 1
    What is written in the script? If you have only comands, like service foo start or systemctrl start foo there is a easy way
    – Boba Fit
    Aug 16, 2018 at 13:29

1 Answer 1

0

After ssh to the server Just backgrounding your script (./myscript &) will not daemonize it. You must disconnect stdin, stdout, and stderr, and make it ignore the hangup signal (SIGHUP).

nohup ./myscript 0<&- &>/dev/null

will do the job. Or, to capture all output:

nohup ./myscript 0<&- &> my.admin.log.file &

and, this article more helpfull for you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.