daemon

simple twisted server (twistd .tap)with a pexpect instance error

Hi all, I have been creating an async server socket that sends and recives xml using twisted. The application works great! but because my main objective was to embed it in an init.d script and make it run in the background i decided to transform it in a "twisted application" in order to run it using twistd # from twisted.internet impor...

Python Daemon To Watch A Folder And Update A Database.

This is specifically geared towards managing mp3s but should easily work for any directory structure with a lot of files. I want to find or write a daemon (preferably in Python) that will watch a folder with many subfolders that should all contain X number of mp3s. Any time a file is added, updated or delete it should reflect that in a...

Python/Django polling of database has memory leak

I've got a Python script running Django for database and memcache, but it's notably runnning as a standalone daemon (i.e. not responding to webserver requests). The daemon checks a Django model Requisition for objects with a status=STATUS_NEW, then marks them STATUS_WORKING and puts them into a queue. A number of processes (created usin...

C or C++ for Linux/UNIX daemon programming?

Dear stackoverflow, The topic basically says it all. I want to go more into writing daemons for Linux/UNIX systems and I want things to be fast and stable. Everything I look at seems to be written in C, however, some new projects seem to be using C++ a bit more. So if I were to start my own project, let's say a modular HTTP daemon, whi...

Does anybody know where to get a smtp connection Daemon?

Here's the thing. I need a daemon running on the server which basically will open an smtp connection, then it will expect calls to the process to send e-mails through the opened connection. This is to avoid connecting to the smtp every time, instead I can receive multiple calls to the process but connection only one time. By the way, t...

Why is gconfd running for daemon user without shell access?

I have a java process that runs as a service via a shell script on a RHEL box. The process runs for a while, then seems to die quietly. The process does have a shutdown hook that fires and in the event of a normal kill it does log stuff and but nothing is logged in the cases where it dies. I checked the system logs and at the same tim...

How do I rollback capistrano tasks upon failure?

In my Capistrano deploy.rb, I have a couple of daemons like delayed_jobs and fetcher, starting and stopping depending on where they are in the deployment process. This method would create problems if a deployment fails, because the daemons wouldn't be managed properly (ie. two processes spawned instead of one, or processes were shutdown...

Launchd agent not starting

I'm attempting to write a launchd agent that runs a simple application for every user that logs in to the Mac OS X system. I have created a file named com.mycompany.myapp.plist and placed it in /Library/LaunchAgents. The contents of that file are: { LimitLoadToSessionType = "Aqua"; StartInterval = 10; OnDemand = NO; Kee...

Python Daemon Subprocess not working at boot

I am attempting to write a python daemon that will launch at boot. The goal of the script is to receive a job from our gearman load balancing server and complete the job. I am using the python-daemon module from pypi (http://pypi.python.org/pypi/python-daemon/). The nature of the job that it is completing is converting images in the or...

Ruby daemons and frequency

Hi, I've written this ruby daemon, and was wondering if somebody could have a look at it, and tell me if the approach I've taken is correct. #!/usr/bin/env ruby require 'logger' # You might want to change this ENV["RAILS_ENV"] ||= "production" require File.dirname(__FILE__) + "/../../config/environment" $running = true Signal.trap...

launch agent from daemon in user context

I have a launch daemon that runs in the login context of a Mac OSX 10.6 machine. I want to launch an agent for each user from that agent, and have the agent run in the user's login context. However, I need to control the precise arguments to the agent application very carefully, which is why I cannot use a launchd agent, like I have for ...

Something like PPerl for Ruby?

I've used PPerl for deamon like processes. This program turns ordinary perl scripts into long running daemons, making subsequent executions extremely fast. It forks several processes for each script, allowing many proceses to call the script at once. Does anyone know of something like this for ruby? Right now I am planin...

Running a Java daemon with a GWT front-end served by embedded Jetty

Greetings, coders, Background Info and Code I am trying to create a daemon-type program (e.g., it runs constantly, polling for things to do) that is managed by a GWT application (servlets in a WAR) which is in turn served by an embedded Jetty server (using a WebAppContext). I'm having problems making the GWT application aware of the da...

Python-daemon doesn't kill its kids

When using python-daemon, I'm creating subprocesses likeso: import multiprocessing class Worker(multiprocessing.Process): def __init__(self, queue): self.queue = queue # we wait for things from this in Worker.run() ... q = multiprocessing.Queue() with daemon.DaemonContext(): for i in xrange(3): Worker(q) ...

How do I get Emacs to evaluate a file when a frame is raised?

Basically I have my Emacs set up so it has a GUI specific elisp, but when starting it in daemon mode this doesn't evaluate. The code is something like: ;; gui.el (when window-system (progn ;; do stuff here )) I'd like this file (or at least the code within it—perhaps a funtion) to be re-evaluated when I run emacsclient -c on...

Right way to create [self]respawning app in python

I am using jabber bot written in python to log some MUC talks. Sometimes it drops on some network or XMPP problems. In this case I have to start it again by myself. The goal is to make it "self-respawning". I have some variants about how to do it. Bot is one process. Another process monitors its activity and starts it if bot died. Mai...

how do i claim a low-numbered port as non-root the "right way"

I have a script that I want to run as a daemon listening on a low-numbered port (< 1024) Script is in python, though answers in perl are also acceptable. The script is being daemonized using start-stop-daemon in a startup script, which may complicate the answer What I really (think) don't want is to type ps -few and see this process r...

Daemonize() issues on Debian

Hi, I'm currently writing a multi-process client and a multi-treaded server for some project i have. The server is a Daemon. In order to accomplish that, i'm using the following daemonize() code: static void daemonize(void) { pid_t pid, sid; /* already a daemon */ if ( getppid() == 1 ) return; /* Fork off the parent process */ p...

Is it possible to set up MongoDB in a shared hosting?

I'm using GoDaddy and would like to have MongoDB for my pet project.. but I don't really think its possible, since it has to be running the Daemon... but.. it doesn't hurt to ask, is there a way? ...

System_Daemon and shell_exec

Hey Everyone, I've set up a daemon (daemon.php) using PEAR's System_Daemon which waits for something to appear in the database. Once something is there, the daemon gets enough information and sends it out to another script (execute.php) using the shell_exec command this way I'm not worried about waiting for a response and holding up the...