rc.local - won't run
I am trying to run two commands at boot (tuncfg and hamachi start)
Everything I read refers to /etc/rc.local to perform this task. BUT, my brand new 9.04 ubuntu machine does not have that file in /etc. My other 8.10 machines does have the file. I need to run both of these commands as root. I created the file myself and added the following lines: Code:
/usr/src/hamachi/tuncfg/tuncfg Code:
chmod +x rc.local No dice, does not run at boot. If I run the file manually after booting, it works fine and my hamachi starts and works perfect. Why does rc.local not run at boot ? |
Hi -
Ubuntu (for whatever reason) plays a different game: to customize initialization, you can create an executable shell script called "/etc/init.d/local", and put your commands there. Here are more details: https://help.ubuntu.com/community/RcLocalHowto 'Hope that helps .. PSM |
thanks for the info...got a little closer now. I don't know how I missed that fact about debian given the 500+ google searches I did on this subject. Well, I created the file /etc/init.d/local and added one line to call a script from my home directory
contents of /etc/init.d/local /home/tbegehr/goham.script did a chmod +x on /etc/init.d/local Ran this command , which was in the link you sent me: sudo update-rc.d local defaults 80 got a couple "ok" signals and one error about "warning: etc/init.d/local missing LSB information". I rebooted and it does not run. I can run the script in /home/tbegehr - it works. I can run /etc/init.d/local manually and it call the script from /home/tbegehr.... and that works too. Just doesn't seem to run at boot. |
Hi -
I confess - I'm used to the standard "/etc/init.*" convention. But the warning you mentioned led me to this page: http://wiki.debian.org/LSBInitScripts It sounds like maybe your script is probably actually being run ... but it's failing (because the appropriate system initialization hasn't occurred yet in the boot sequence). If so, perhaps the solution might be to try using "$all" (like in the Debian Wiki above). One workaround (admittedly ugly!) might be to: 1. Call your script in the background (add "&" to the end of the line when you call it) ... and then ... 2. Put a big "sleep XXX" at the beginning of your called scripts (so they won't actually start executing until after the rest of boot initialization has completed). Just a thought... |
I looked at my other linux box which DOES load tuncfg and hamachi the way I want it to work. It has a script in etc/init.d called 'hamachi'. I copied the exact same script over to my new box and it does not work. This is the script:
Code:
#!/bin/sh |
Try this on your other box and see if it identifies any symlinks you need
Code:
/bin/ls -l /etc/rc[S0-6].d/*hamachi |
what is rc[SO-6].d ? There is no such file.
I have rc0...thru rc6.d No rc[SO-6].d Does 'SO-6' stand for something I am not understanding ? |
Quote:
|
so what *exactly* do I need to type for the command ?
|
boxb29 -
You still haven't answered the main question: Now that you've put "tuncfg" and "hamachi" in /etc/init.d/local: Q: Are they not being executed by /etc/init.d/local? ... OR ... Q: Are they being executed *at the wrong time* (too early in the boot)? Please determine this before going any further! |
Quote:
|
I can't tell...that's my problem.
|
I get an error "no such file or directory". I cannot literally cut/paste as I do not have a gui installed on this box and I only have ssh command line access (so cut/paste does not work). I typed it in exactly as you wrote it though.
|
ok, on the machine that *works* I get this response from you command:
lrwxrwxrwx 1 root root 19 2009-01-31 21:31 /etc/rc2.d/S99hamachi -> /etc/init.d/hamachi lrwxrwxrwx 1 root root 19 2009-01-31 21:31 /etc/rc3.d/S99hamachi -> /etc/init.d/hamachi lrwxrwxrwx 1 root root 19 2009-01-31 21:31 /etc/rc5.d/S99hamachi -> /etc/init.d/hamachi From the machine that doesn't work , I get: root@reno:/etc/init.d# /bin/ls -l /etc/rc[S0-6].d/*hamachi /bin/ls: cannot access /etc/rc[S0-6].d/*hamachi: No such file or directory |
*Forget* about Ubuntu 8.10 for the time being. (For better or worse) you're in Ubuntu 9 now. Make it work first; figure out "what's different" afterwards.
From where I'm sitting, "/etc/init.d/local" looks like your best shot. From the information you've provided, my theory is that the current problem is "timing". Please: 1. Verify that "tuncfg" and "hamachi" are actually getting invoked 2. If so, try one of my two suggestions to "slow them down" (either "$all", or "sleep"). 3. Post back what you find about these two questions |
All times are GMT -5. The time now is 12:30 AM. |