I have lot of questions about scripts. How to configure the script that 1 It automatically turns on when the computer is turned on? 2 I was possible start and close the script with console? 3 After closing console the script still have been work?
-
1please limit your questions into single question of your specific problem, also see here to How to ask. – αғsнιη Feb 06 '18 at 11:21
1 Answers
That's depend on what OS you are running. A program that starts when a computer is turned on is generally called a service. Traditional Unix way is to use rc script. If you used systemd, that should still be supported. See How does systemd use /etc/init.d scripts?
All scripts can be started from the console by design, just use their full path or have their directory in your path and use their name. Stopping a script can be done using CtrlC if running in the foreground, or ps and kill interactively from another script, or better, pkill when available. Depending on the signal and the script, it can be terminated gracefully or not.
A script launched with nohup and running in the background is unaffected when the console from where it was launched is closed.

- 61,204
-
You might mention in 2, that an interactive script can most often be stopped with Ctrl-C. – user unknown Feb 06 '18 at 11:41
-