daemon

Recommended way to manage persistent PHP script processes?

First off - hello, this is my first Stack Overflow question so I'll try my best to communicate properly. The title of my question may be a bit ambiguous so let me expand upon it immediately: I'm planning a project which involves taking data inputs from several "streaming" APIs, Twitter being one example. I've got a basic script coded u...

Sending signal to daemon in php

Hi, I have a daemon written in PHP which is running on my linux machine. I am trying to send a signal to it through another php file. For this purpose I am trying posix_kill function. But its not working. When I run the php page, I get an error that php is compiled without --enable-grep I want to know how to enable it? OR what is the...

Ruby daemons vs daemon-kit gems: what are the pros and cons?

What are the relative pros and cons of: http://rubyforge.org/projects/daemons http://github.com/kennethkalmer/daemon-kit Which is more robust? Are there any other effective Ruby daemon management tools? ...

Build a ruby daemon that integrates my rails environement

Hi guys, I need to build a ruby daemon that will use the freeswitcher eventmachine library for freeswitch. Since few days I as looking the web for the best solution to build a ruby daemon that will integrate my rails environment, specailly my active record models. I've take a look to the excellent Ryan Bates screencast (episodes 129 cu...

What C++ library to use to write a cross-platform service/daemon?

I wonder what library would ease the development of a cross-platform service/daemon ? (C/C++) I'm targeting: Windows, Linux and OS X. Requirements: network operations and serial port communication. Also it would be nice to have a basic sample service application. ...

How can I get mounted name and (Drive letter too) on Windows using python

I am using Daemon tool to mount an ISO image on Windows XP machine.I do mount using Daemon command (daemon.exe -mount 0,iso_path). Above command will mount ISO image to device number. In my case I have 4 partition (C,D,E,F) and G for DVD/CD-RW. Now what happen, ISO gets mounted to drive letter 'H:' with name (as defined while creating I...

How to set up a PHP daemon ?

I will be writing my first daemon in php and I have a couple really basic questions that I need help with. What packages need to be installed on my linux server and Does anything in PHP need to be enabled? So far I have gotten this - http://pear.php.net/package/System_Daemon/download Where on server do I save my daemon files? I hav...

Installing Daemons

A simple link would be nice for me to understand how to install my C++ program as a daemon in UNIX, now I know some will say this should be on Server Fault, but as far as I understand it I need the init.d shell script to actually create the start and stop for the daemons. But if you guys can show me a simple shell script for the daemon ...

How to auto-restart a python script on fail?

This post describes how to keep a child process alive in a BASH script: http://stackoverflow.com/questions/696839/how-do-i-write-a-bash-script-to-restart-a-process-if-it-dies This worked great for calling another BASH script. However, I tried executing something similar where the child process is a Python script, daemon.py which crea...

What's the correct way to stop a background process on Mac OS X?

I have an application with 2 components: a desktop application that users interact with, and a background process that can be enabled from the desktop application. Once the background process is enabled, it will run as a user launch agent independently of the desktop app. However, what I'm wondering is what to do when the user disables...

Best way to daemonize Java application on Linux

Hi. While I found this question being answered here on SW several times, I didn't find a concluding answer what is the best approach. I'm not looking to use any external wrapper, as I found them launching the java process under a nice level lower then themselves which potentially lowers the performance, so it seems only the shell metho...

Running daemon through rsh

I want to run program as daemon in remote machine in Unix. I have rsh connection and I want the program to be running after disconnection. Suppose I have two programs: util.cpp and forker.cpp. util.cpp is some utility, for our purpose let it be just infinite root. util.cpp int main() { while (true) {}; return 0; } forker.cp...

When does a PHP <5.3.0 daemon script receive signals?

I've got a PHP script in the works that is a job worker; its main task is to check a database table for new jobs, and if there are any, to act on them. But jobs will be coming in in bursts, with long gaps in between, so I devised a sleep cycle like: while(true) { if ($jobs = get_new_jobs()) { // Act upon the jobs } else { //...

How to trace a raw (character) device stream on Unix ?

I'm trying to trace what is transiting in a raw (character) device on an Unix system (ex: /dev/tty.baseband) for DEBUG purpose. I am thinking of creating a deamon that would: upon start rename /dev/tty.baseband to /dev/tty.baseband.old. create a raw node /dev/tty.baseband spawn two threads: Thread 1: reading /dev/tty.baseband.old writ...

Can't run rails server as daemon

I'm using rails 2.3.2 and when I run script/server -d, the only output I get is => Booting Mongrel => Rails 2.3.2 application starting on http://0.0.0.0:3000 which is fine. But when I check for anything running on port 3000, i get nothing. Any ideas? ...

Locking a file to verify a single execution of a service. How reliable?

Hello, I am deploying a little service to an UNIX(AIX) system. I want to check if there is no active instance of that service running when starting it. How reliable is to implement that check like this? Try to acquire a lock on a file (w/ FileChannel) If succeeds, keep lock and continue execution If fails, exit and refuse to run the m...

Perl daemon script for message queue hanging for 20 seconds after each process. Why?

I have daemon script written in Perl that checks a database tables for rows, pulls them in one by one, sends the contents via HTTP post to another service, then logs the result and repeats (only a single child). When there are rows present, the first one is posted and logged immediately, but every subsequent one is delayed for around 20 ...

Integrating Incoming Email Into a php/mysql App

I am looking to create an incoming email daemon switchboard that I can integrate with various remote php/mysql apps. Ideally I want to check the 'to' address to see if it is in a mysql database and if it is, have the email parsed and posted via CURL to a target destination as well as have attachments saved somewhere locally. I will like...

Cocoa Launch agent registering itself after installation.

I have created Cocoa app which is type of launch agent. To distribute this I have created package as well which installs the app and copies the launchagnet plist file in /Libraries/LaunchAgents. Now the problem is after installation i want this app to be running in user context immediately without logoff/restart. If I register this with...

C functions invoked as threads - Linux userland program

I'm writing a linux daemon in C which gets values from an ADC by SPI interface (ioctl). The SPI (spidev - userland) seems to be a bit unstable and freezes the daemon at random times. I need to have some better control of the calls to the functions getting the values, and I was thinking of making it as a thread which I could wait for to ...