rc.local wont start my program at boot
Im having trouble getting a command to run when the computer has booted. Im using the rc.local file to try and do this. The 3 lines i have added to the file are below:
Code:
kismet_server > /root/logfile.txt & The problem is strange because the logfile.txt is created but nothing is written to it. If i enter the commands manually when the computer is on it all works perfectly fine. It just dosn't seem to work when attempting to start it automatically at boot. I have tried adding these lines to both /etc/rc.local and /etc/init.d/rc.local and both produce the same results. Is there any reason this may be happening? or an alternative way i can make a program start at boot time. Thankyou in advance for your help. |
What system are you trying to do this on?
If it is a current Fedora, it is entirely possible that the network you are trying to listen on doesn't exist at the time it tries to start. There are NO guarantees that rc.local actually runs at the proper time. Fedora now being systemd based, tries to start everything at once. So unless you add explicit chains to the "after:" lists to try to force it... it will run before the network is even initialized. |
I believe each distro works differently, so what distribution are you working with?
some distros now use systemd and think systemd doesnt use rc.local at all. I am no 100% in this hopefully somebody here with more experience can see your post. |
Thank you for the reply's. It is a Debian based distro that running on a Raspberry PI computer. I have a print statement in the python script and i can see that is is infact starting when the computer starts.
If the network interface dosn't have time to start i would still expect to see logfile.txt contain the error that the interface diddnt start. It is just the problem of the logfile.txt not being written to in any way, even though executing the exact same command manually works perfectly fine. |
Is it possible that the Kismet server is, in fact, logging to its default location instead of to the logfile.txt that you want it to use?
I think that would be the final proof that the problem is the order things are starting up. |
Unless the program daemonizes itself, it'll terminate when rc.local (actually the process running rc.local) finishes.
Try prefixing with 'nohup' as well. |
Quote:
|
All times are GMT -5. The time now is 10:44 PM. |