daemon

Best Method to run a Java Application as a *nix Daemon or Windows Service?

I am looking for the best method to run a Java Application as a *NIX daemon or a Windows Service. I've looked in to the Java Service Wrapper, the Apache Commons project 'jsvc', and the Apache Commons project 'procrun'. So far, the Java Service Wrapper looks like it's the best option... but, I'm wondering if there are any other "Open So...

JavaServiceWrapper on 64bit linux, any problems?

We've been using the 32bit linux version of the JavaServiceWrapper for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looking into Makefile for the 64bit version I found the following comment, though: # This makefil...

What's the best way to keep a PHP script running as a daemon?

What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting. I have some scripts that need to run 24/7 and for the most part I can run them using nohup. But if they go down, what's the best way to monitor it so it can be automatically restarted? ...

How can I post a Cocoa "sheet" on another program's window?

Using the Apple OS X Cocoa framework, how can I post a sheet (slide-down modal dialog) on the window of another process? Edit: Clarified a bit: My application is a Finder extension to do Subversion version control (http://scplugin.tigris.org/). Part of my application is a plug-in (a Contextual Menu Item for Finder); the bulk of my app...

What are the best open source Nagios interfaces?

(best in your own eyes) Most features? Coolest Features? Slickest Design? Centreon? NagVis? Other? ...

What would be the simplest way to daemonize a python script in Linux ?

What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools. ...

So, who should daemonize? The script or the caller?

I'm always wondering who should do it. In Ruby, we have the Daemons library which allows Ruby scripts to daemonize themselves. And then, looking at God (a process monitoring tool, similar to monit) page, I see that God can daemonize processes. Any definitive answer out there? ...

Logging in Linux

So I have a daemon running on a linux system, and I want to have a record of its activities: a log. The question is, what is the "best" way to accomplish this? My first idea is to simply open a file and write to it. FILE* log = fopen("logfile.log", "w"); /* daemon works...needs to write to log */ fprintf(log, "foo%s\n", (char*)bar); /*...

How do I code a Mono Daemon

I'm trying to write a Mono C# daemon for linux. I'd like to do a starts and stops of it when its done processing instead of just killing the process. Does anyone have any examples of this? Edit: I figured out how to use start-stop-daemon --background in debian, so I think I'll just use that for now. Edit: I'm implementing this in jav...

Ruby Daemons will not start

I am using the ruby daemons gem to create a custom daemon for my rails project. The only problem is that when I try to start the daemons ruby lib/daemons/test_ctl start that it fails and will not start. The log file has this output. # Logfile created on Wed Oct 22 16:14:23 +0000 2008 by / *** below you find the most recent exception th...

Open Browser window from Java program

Question I have an application written in Java. It is designed to run on a Linux box standalone. I am trying to spawn a new firefox window. However, firefox never opens. It always has a shell exit code of 1. I can run this same code with gnome-terminal and it opens fine. Background So, here is its initialization process: Start ...

How can I write a simple HTTP proxy in Perl?

I don't want to use the HTTP::Proxy package because I want to dump out a couple requests. My one liner looks like this, but breaks on trying to pass the header in: perl -MData::Dumper -MHTTP::Daemon -MHTTP::Status -MLWP::UserAgent -e 'my $ua = LWP::UserAgent->new;my $d=new HTTP::Daemon(LocalPort=>1999);print "Please contact me at: <", $...

A cron job for rails: best practices?

What's the best way to run scheduled tasks in a Rails environment? Script/runner? Rake? ...

Getting the path of a remote rsync depot

Hey, I know if you run in rsync rsync some.domain.com:: It will return me a list of the rsync depots. Is there any way of getting it to return the details of the depot, the path specifically. Thanks ...

Re-attatching an X server view of a lost process.

Hello. I'm running Xorg and my (Qt) program daemonises itself. Now I log out and restart the X server. When I log in again my process is still running fine, but I can't see it. Is there a way of attatching the new incarnation of the X server to the old process? If I don't restart the whole server, but log out and in again, is there a wa...

java background/daemon/service cross platform best pratices

Howdy I am looking for the best way to make my desktop java program run in the background (daemon/service?) across most platforms (Windows, Mac OS, Linux [Ubuntu in particular]). By "best way" I am hoping to find a way that will: 1) require a minimum amount of platform-specific code. 2) not require the user to do anything a general co...

How to convert an existing Java application to a SYS V service (daemon)

I have a Java application, to start it I use java -jar myapp.jar To stop it I use CTRL+C. Now I need to convert that application to something that I can start with: /etc/init.d/myapp start And I can stop with: /etc/init.d/myapp stop The problem is all about saving the PID of the process, I think I saw somewhere a recip...

run periodic tasks on server in the background

What's the best/easiest way to run periodic tasks (like a daemon thread) on a tomcat/jetty server? How do I start the thread? Is there a simple mechanism or is this a bad idea at all? ...

How do you create a daemon in Python?

Searching on Google reveals x2 code snippets. The first result is to this code recipe which has a lot of documentation and explanation, along with some useful discussion underneath. However, another code sample, whilst not containing so much documentation, includes sample code for passing commands such as start, stop and restart. It al...

How do I daemonize an arbitrary script in unix?

I'd like a daemonizer that can turn an arbitrary, generic script or command into a daemon. There are two common cases I'd like to deal with: I have a script that should run forever. If it ever dies (or on reboot), restart it. Don't let there ever be two copies running at once (detect if a copy is already running and don't launch it ...