Help needed to improve usage of Deluge WebUI

Support forum for Deluge on Apple Mac OS X

Help needed to improve usage of Deluge WebUI

Postby WalleyeUK » Wed Apr 27, 2011 12:10 pm

Hi all

I've installed Deluge 1.3.1 just fine on my Mac (OS 10.6.7) and can run deluge-web from Terminal with no issues. Once I do this, i go into my browser and have a bookmark to http://localhost:8112 and everything runs.

I use Chrome as my browser and have the Deluge extension in there. However this won't pick up until i actually go to localhost:8112 in the browser and select the connection type (only one listed). This also works fine and once selected, the Chrome extension picks up any torrents running.

My first question is, how can I avoid this so that when I've started deluge-web this also connects to the one connection automatically and the Chrome extension runs without having to first go to localhost:8112

My second question is, how can I run deluge-web automatically when I log into my Mac? I'm a bit of a noob at the unix-side of Mac. I was hoping to just create an Automator application and add that to my list of items that start at login under System Preferences >> Accounts >> Login Items. I tried using the Run Shell Script action and entered "deluge-web" using a /bin/bash shell, but it threw an error.

My final question is, how can I run all this in the background, without the terminal window being open. I'm guessing it has something to do with setting up the daemon "deluged" to run (again ideally to start on login all by itself) but I'm not sure how to get the WebUI component to be enabled. When I tried to run deluged in terminal, Localhost did not work, so I'm obviously missing something.

Please be gentle with me, I'm a super mac user, but dumb-as when it comes to terminal and unix :)
WalleyeUK
New User
New User
 
Posts: 3
Joined: Tue Apr 26, 2011 12:09 pm

Re: Help needed to improve usage of Deluge WebUI

Postby Cas » Wed Apr 27, 2011 5:07 pm

I cannot help with the specifics for MacOS but I think you have maybe misunderstood the way deluge works.

deluged is the daemon.
deluge-web is the web ui that connects to (and can start) deluged

So you need both to be running at startup. deluge-web can be forked to the background with -f.
Cas
Developer
Developer
 
Posts: 2121
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Help needed to improve usage of Deluge WebUI

Postby WalleyeUK » Thu Apr 28, 2011 8:05 am

Hi Cas

Thanks for your reply. After I posted this I did indeed figure that bit out.

I also worked out how to create a LaunchDaemon for Mac that starts at login using a .plist file.

So progress and some great learnings taken from this!

However I'm not quite there yet...

The LaunchD's actually open Terminal and run both, but these windows have to stay open and running for the daemon to stay alive and of course for the WebUI to function. What I'm really after is a completely background process to run without the need for Terminal to open and remain open. Probably this is where my knowledge of how a background service on an OS works is extremely limited. I've been reading around on the interweb, but either there's very light articles that use the word "just" a lot (a poor measure of effort in my view) or they're by an uber-guru telling their university computer science students how to launch the next mission to Mars using nothing but unix command line and an empty cardboard tube.

If anyone has a middle ground please post me the link or DM it to me!
WalleyeUK
New User
New User
 
Posts: 3
Joined: Tue Apr 26, 2011 12:09 pm

Re: Help needed to improve usage of Deluge WebUI

Postby Cas » Thu Apr 28, 2011 10:59 am

Did you read this technote, not sure if this helps:
If you have a daemon that was previously launched via inetd (or xinetd), you can run it from launchd by creating a property list file with the inetdCompatibility property set appropriately. This results in an inetd-compatible launchd daemon. For an example of this, check out /System/Library/LaunchDaemons/finger.plist.


You should post the configs that you have created.
Cas
Developer
Developer
 
Posts: 2121
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Help needed to improve usage of Deluge WebUI

Postby WalleyeUK » Thu Apr 28, 2011 11:37 am

Sorry, poor etiquete on my part! I'll have a read of that link, thanks. On a quick glance some of it is beyond me still, some of it I know through other research. I believe that the approach I'm using using the LaucnhDaemon (launchd) is the right approach as I am running OS 10.6.7 so I reckon I'm on the right track.

Currently I have these executing via 2 separate .plist files (I'm guessing that they might be able to be run in a single, but i'm trying not to overcomplicate this for myself).

Both are held in the /Library/LaunchDaemons folder as I want these to be available to a number of users (and recognising the difference between a LaunchDaemon and LaunchAgent).

Here's the script that run's the daemon:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>KeepAlive</key>
   <true/>
   <key>Label</key>
   <string>com.deluged.startup</string>
   <key>ProgramArguments</key>
   <array>
      <string>deluged</string>
   </array>
   <key>RunAtLoad</key>
   <true/>
</dict>
</plist>


And here is the one that run's the WebUI:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>KeepAlive</key>
   <true/>
   <key>Label</key>
   <string>com.delugeweb.startup</string>
   <key>ProgramArguments</key>
   <array>
      <string>deluge-web</string>
      <string>--fork</string>
   </array>
   <key>RunAtLoad</key>
   <true/>
</dict>
</plist>


I realised that in doing this I'm quite lucky that the OS is running the daemon first before I try and run the WebUI as presumably this has to be done in order?

**********************************************
EDIT:

I realised I'm calling an alias in ProgramArguments in the above examples. I have tried using the full path as deluge is installed to by the MacPorts install process.
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/deluged


Neither this nor the approach above seems to execute the daemon. Litterally, nothing happens. I've looked at quite a few examples now of what's installed on the OS and what other applications do that run daemon processes in the background on startup and aside from the path (which is why I tried changing this) there's really no difference. Confused!! :?
WalleyeUK
New User
New User
 
Posts: 3
Joined: Tue Apr 26, 2011 12:09 pm


Return to Mac OS X

Who is online

Users browsing this forum: No registered users and 1 guest