daemon

what is the win32 alternative to the Unix daemon() subroutine?

I have to call several (> 10) .exe command line programs in the background. Creating a Windows Services doesn't sound very appealling in this context - c'mon, that's a bit overpowered for such a simple task. Is there anything like a daemon(3) subroutine for Windows? ...

How do I make a daemon into a stream in PHP

I have a daemon (written in C, but I assume it does not really matter) which outputs messages with printf, and can get input and do stuff with this input (again, not really important what, but he sends those messages to a different machine to be saved there in the DB). My question, how can I make this daemon to be a stream in PHP, so ...

iPhone Daemon Processes and UIApplication's openURL

I have a daemon process which I created running on my iPhone (so yes it is jailbroken). I have been able to use the Audio and CoreLocation frameworks without problems. However when I try to use NSURL *url = [NSURL URLWithString:@"astraproto://hi"]; [[UIApplication sharedApplication] openURL:url]; it just doesn't open. The protocol is...

iPhone UIAlertView in background process

Is it possible to create an alert in the background process? I've tried looking at mobile substrate and hooking functions to SpringBoard but I didn't find anything that works Thanks Reuben ...

Ruby background service

I have a TCPclient written on Ruby. I want to use it in background. Currently it has a loop: loop do end So i can run a client, and it works forever. Is there a way to run in as a service, and write a pid to file, then i'll able to kill that process by pid? ...

Trying to setup a PHP daemon using System_Daemon and I'm having issues getting it to run.

I get the following error when trying to start a daemon using Ubuntu 10.04 and the PHP5: PHP Warning: PHP Startup: Unable to load dynamic library 'usr/lib/php5/20060613/pcntl.so' - /usr/lib/php5/20060613/pcntl.so: cannot open shared object file: No such file or directory in Unknown on line 0 Does System_Daemon try to call pcntl? If s...

Measuring daemon CPU utilization over a portion of its wall clock run time

I am dealing with a network-related daemon: it takes data in, processes it, and spits it out. I would like to increase the performance of this daemon by profiling it and reducing it's CPU utilization. I can do this easily on Linux with gprof. However, I would also like to use something like "time" to measure it's total CPU utilization...

Daemon with Clojure/JVM

I'd like to have a small (not doing too damn much) daemon running on a little server, watching a directory for new files being added to it (and any directories in the main one), and calling another Clojure program to deal with that new file. Ideally, each file would be added to a queue (a list represented by a ref in Clojure?) and the ...

Execute script with Ruby on Rails?

I want to start my daemon with my application. In the command line, I can write something like lib/daemons/mydaemon_ctl start to start up my daemon, but I have to do this manually. I want the daemon to start when I start my server (i.e. when the initializer files are loaded). Is there a ruby command for executing a command line? Someth...

Stop daemon with server in Ruby on Rails

I have a daemon that I'm starting along with the server using an initializer file. I want to stop this daemon once the server stops, but I'm not sure where to put a script that would run when the server stops. Initializers get automatically loaded when the server starts. Is there a similar "destroyers" folder? Where would I put code tha...

How do I manage a Python based daemon on Linux?

I have a working Python based program that I want to run as a daemon. Currently I'm doing it in a very hackish manner of starting it in with screen-d -m name session and killing it with pkill -9 -f name. Eventually I'm doing to have to move this to the better system we use here (thus I'm not willing to modify the program) but in the int...

How to restart C daemon program in Linux after receiving SIGHUP signal

Hello Can anybody please post some example code on how I can reread a configuration file and restart my daemon after the daemon receives a SIGHUP signal. The daemon is a user space program written in C on Linux and is not started by inetd. ...

Problems with PHP System_Daemon and IMAP connection.

I'm trying to create a PHP daemon that connects to an IMAP server and processes emails as they come in. I have it close to working, but the daemon keeps grabbing the original emails that it finds the first time the daemon is loaded. I believe the reason is because I'm opening the IMAP connection in the parent process. Example below: i...

Python, MySQL and Daemon Problem in Ubuntu 10.04

I have a script which runs inside a while loop and monitors a mysql data source every 2 seconds. If I run if from the command line, it runs and works fine. But If I attach it to a daemon, it throws an error saying "MySQL has gone" or something similar. I checked and found MySQL up and running. I could even execute queries from other tool...

New to JEE; architecture suggestions for a service/daemon?

I am brand new to the JEE world. As an exercise to try and familiarize myself with JEE, I'm trying to create a tiered web-app, but I'm getting a little stuck on what the best way is to spin up a service in the background that does work. Parameters of the service: It must open and hold a socket connection and receive information from t...

Does Iphone supports background process or services?

Hi all, I am planning to develop a iphone client application to upload images from iphone gallery to amazon s3 using rest calls.so is there any library to run this application as a background process in iphone. Also is there any library to access the iphone photo gallery(Should be able access all the images,not only selected one like i...

missing entry in launchctl after restart

I have a deamon which is registered with launchctl to run as system-wide-daemon and to load automatically with every system startup or if the daemon crashes. I have registered this daemon with: sudo launchctl load -w /Library/LaunchDaemons/plist.file Everything works fine. My daemon is registered and with sudo launchctl list I can...

Daemon running as user nobody needs to copy file from Desktop

I have a daemon that is running as user nobody. It needs to copy a file that I specify into /Users/Shared/MyFolder If I tell it to copy a file that is already in /Users/Shared/ it works fine. If I tell it to copy it from somewhere in my home directory like the desktop, the copy fails. I'm using NSFileManager copyPath:toPath: Any ideas? ...

Creating a Custom Ubuntu Daemon

What's the "correct" way to create a custom daemon in Ubuntu, that will start at boot time and be controllable by Ubuntu's standard daemon start/stop commands? Can I just copy and paste one of the scripts in /etc/init.d or do I need to "register" the daemon somewhere else? ...

Linux daemonize

I am writing a linux daemon . I found two ways to do it. Daemonize your process by calling fork and setting sid. Running your program with & Which is the right way to do it ...