-1

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 !

IngUnix
  • 1
  • 3
  • Possible duplicate of [How to run a shell script at startup](http://stackoverflow.com/questions/12973777/how-to-run-a-shell-script-at-startup) – nakano531 Nov 13 '16 at 02:32

1 Answers1

0

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.

ccamol
  • 119
  • 1
  • 7