IngUnix IngUnix - 24 days ago 9
Linux Question

where i can put a script to start on init centos?

I need to put a script to start on init on centos ?, i not need to make a daemon, only a script.

i don't know if can do this, but only get answer that can be with daemon.
i don't need daemon.

i put some scrips like this to init centos:

bufferC = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, w3ingunix)
c.setopt(c.WRITEFUNCTION, bufferC.write)
c.perform()
c.close()
# Body is a string in some encoding.
bodyC = bufferC.getvalue()
print(bodyC)


i need a script to run no matter path where it is and not need to be a daemon !

Answer

well!, only you have to do, is make that script and save on wherever you decide on the system and refer it on this path to get start on init on centos !

cd /etc, then

vim rc.local

and put the path of your script, the when restart system, your script will run.