Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I don't understant why my script is not running. Here is what I did (I'm using Ubuntu 10.04).

I wrote a mountFTP.conf script:

description     "Mount the remote FTP for sync"

start on started tty1

task
script
curlftpfs ftp://admin:123456@195.78.27.45 /FTP/
end script

I saved the script in /etc/init/ folder. If I use the command "service mountFTP start" it works, but it doesn't want to automatically start on boot...

I also tried with "strat on stratup" with no luck. I also added some log to the script to check if it is executed or not, and it is not executed at all.

share|improve this question
    
Is tty1 started already? Try to place some logging in your script to see what happens... –  Frantique Nov 15 '12 at 14:18
    
I suppose you did type "start on startup" instead of "strat on stratup" ? –  Nanne Nov 15 '12 at 14:28
1  
Probably that he did not linked the upstart-job to his script. See my answer. –  Frantique Nov 15 '12 at 14:33

2 Answers 2

Follow these steps:

sudo chown root:root yourscript.conf  
sudo chmod 644 yourscript.conf  
sudo mv yourscript.conf /etc/init  
cd /etc/init.d  
sudo ln -s /lib/init/upstart-job yourscript  
share|improve this answer
    
Thanks, I thought it would start after the tty1 service. So I tried with "start on runlevel [2345]" but it still wont start –  lucas Nov 15 '12 at 14:47
    
Yes it was "start on startup" in my script. I check the owner and permission on my script and it was already ok. I also tried to add the symlink in init.d but it doesn't help. Really strange –  lucas Nov 15 '12 at 15:04
1  
Ok I finally found the solution! I used the following line in my script: "start on (local-filesystems and net-device-up IFACE=eth1)" I still don't know why the "start on runlevel [2345]" didn't worked.. Thanks Frantique for your help ! –  lucas Nov 15 '12 at 15:40

It looks like the version of Upstart that @Frantique mentions is only available in the latest (13.10) version of Ubuntu. Most of my stuff is older than that.

Another alternative is to pipe your output to 'logger'.

Try something like:

description     "Mount the remote FTP for sync"

start on started tty1

task
script
curlftpfs ftp://admin:123456@195.78.27.45 /FTP/ | logger
end script
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.