I have a homebrew headless NAS running 12.04.

In it I have a bunch of disks that are presented as a samba share thanks to Greyhole. If I want to do anything to the files within this share, I must do it through greyhole so that everything is updated properly. Thus, the share must be mounted locally and then accessed from there if I want to work on the files from the local machine. I do this mounting automatically thanks to these instructions.

I also have Deluge installed that takes care of all my torrenting needs. Deluge's default download location is in this share, so that all the downloads are immediately available to the rest of the network.

Obviously for everything to work, the share must be mounted, otherwise Deluge is going to have a problem downloading to it.

The problem is, it seems like Deluge is starting before the shares are mounted when the system boots. So downloading/seeding does not continue automatically after boot. I have to log in and force a manual rescan and start on each torrent otherwise all the torrents just hangs on the error.

Is there a way I can make deluge start after the shares got properly mounted? I looked into Upstart's emits functionality but I cannot seem to get it to work properly. Any advice?


How is deluge starting automatically at boot? Via Upstart?

You need to add a line to the end of the start function in /etc/init.d/mount_shares_locally :

initctl emit --no-wait mounted-samba-shares

then have deluge "start on mounted-samba-shares" in deluge's Upstart job.

  • I have tried exactly this sans the --no-wait switch. I was under the impression that emit is non-blocking anyway? When I tried it my mount script simply hanged at I assume this new change. I will try your suggestion tonight and report back. – getack Jun 2 '14 at 5:15
  • Oh and yes, Deluge starts with Upstart. It's got a simple start on networking-up and somethingelse stanza. I will amend this with the event that the emit in my mount script fires. – getack Jun 2 '14 at 5:17
  • 1
    If it just has start on filesystem and static-network-up, you can just do the mounted-samba-shares, as that will only be emitted if both those are up already. Oh, and initctl emit is blocking by default (weirdly). – CameronNemo Jun 2 '14 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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