This might be a question that has been repeated but i cannot find a correct way to do it .
What is my case ? ->I want to run a Python script.
What does the python script do in brief? ->The python script runs to setup a virtual private network.
How do I manually start it currently ? ->i use ./file.py start (this works)
what is not working ? ->when i try to start in the beggining (boot ) it doesnot do anything. I am using cron job which is not working at all, and i dont want to use it , i want to use the /etc/init.d/ .
This is my file.conf in /etc/init/xxx.conf
description "file start script"
author "sijan <sijanshrestha2@gmail.com>"
exec python file.py start
exec sleep 10
exec ifconfig ip0 11.0.2.251
exec ip=`ifconfig ip0 | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
exec echo $ip >>/tmp/ip.log
I have added the python file in /etc/init.d/file.py
I am possibly not following the correct procedure to do this since i a very new to system level, however any idea on how to proceed is highly appreciated. I am very keen to get this fixed and learn
/etc/init.d
. Add a line in/etc/rc.local
. Or, alternatively, configure the OpenVPN system service. – Andrea Lazzarotto Aug 26 '16 at 08:37root ALL=(ALL) NOPASSWD: /root/wtap.py
and in rc.local i added
– Sijan Shrestha Aug 26 '16 at 09:45exec /root/wtap.py start
still having trouble. I am missing something that is causing this issue ./usr/local/bin
– Jacob Vlijm Aug 26 '16 at 10:41