wimleers / fileconveyor

File Conveyor is a daemon written in Python to detect, process and sync files. In particular, it's designed to sync files to CDNs. Amazon S3 and Rackspace Cloud Files, as well as any Origin Pull or (S)FTP Push CDN, are supported. Originally written for my bachelor thesis at Hasselt University in Belgium.
https://wimleers.com/fileconveyor
The Unlicense
341 stars 95 forks source link

Automatic start of fileconveyor at boot #26

Closed Vacilando closed 14 years ago

Vacilando commented 14 years ago

I am trying to figure out how to run the daemon at (re)boot of (Ubuntu) Linux.

I put this line to /etc/rc.local:

/usr/bin/python /mnt/data-store/fileconveyor/code/arbitrator.py

After reboot, I can see the python script running, but /admin/reports/status claims "The daemon is currently not running."

When I start the daemon via terminal (python /mnt/data-store/fileconveyor/code/arbitrator.py) then it works OK.

Could you please advise the best way of running fileconveyor at (Ubuntu) Linux boot?

Thanks.

Vacilando commented 14 years ago

Well, I have a solution now.

There is a known bug in fileconveyor; see http://github.com/wimleers/fileconveyor/issues#issue/16 Because of this, databases and probably other files were written to whatever the current directory was, but not in fileconveyor's directory.

Solved by changing directory to fileconveyor before launching it.

So I put these 2 lines to /etc/rc.local:

cd /mnt/data-store/fileconveyor/code /usr/bin/python /mnt/data-store/fileconveyor/code/arbitrator.py

Probably not the most elegant solution, but it works!

wimleers commented 14 years ago

Your crude solution should work indeed. But I simply need to fix it. Sorry for taking so long. If you'd post patches, I'd commit them right away (hint hint ;) :P)!