I have written up a Shell init.d
script named "My_first_initd_script"
. The script works great when I run it from the /etc/init.d/
-working in the foreground.
I would like to make"My_first_initd_script"
script work in the background [daemon] as well so that it works when I quit from the terminal. It's been advised that I need to write up a upstart script. I've read it a dozen times, I don't understand it.
Q: Do I really need an upstart script, if so where do I place the script, and what do I write in the script? Also is there alternative ways?
I am really not quite sure about upstart scripts cause I never did one.
But If you want to run a script or command even you close your terminal or logout of your user account then you better use
nohup
command.Syntax :
nohup My_first_initd_script
Then you can close your terminal or logout from your PC but it will run. And you want to start the same from the system startup then add this command in
/etc/rc.local
Let me know if any issues.