daemon

Python daemon will not run in background on Ubuntu

Hi, My python daemon runs fine in the foreground of my Ubuntu system using this command in the terminal: python /opt/my-daemon.py foreground However when I try to call the daemon using the "start" command it fails, why? python /opt/my-daemon.py start This is how I call the command in the /etc/rc.local file: python /opt/my-d...

Linux: How to make a deamon/service usable with xinetd ?

Anybody knows what changes are necessary for a server to work with xinetd ? The server being a .NET mailserver that runs on Linux. See the bottom of this post for reference: Lumisoft Mailserver Forum Post Note: xinetd, not mono-service. [x]inetd is an internet superserver. A superserver starts a server service on demand. (As opposed t...

fedora 13 init.d script, can't stop

Hi, I wrote init.d script that suppose to run java CLI proccess. The problem is that when i stop it, i get [failed] and the proccess is still running. thanks #!/usr/bin/env bash # # chkconfig: 345 97 03 # # processname: quotes-srv # # # source function library . /etc/rc.d/init.d/functions NAME=quotes-srv start() { echo -n ...

RPC w/ PHP - agnostic to transport mechanism

For a recent project, I have a PHP script running as a CLI-based daemon. This daemon will be responsible for monitoring/controlling independent worker processes. Periodically, users will issue requests to manage workers through a PHP web front-end (CLI daemon and front-end code are on the same physical server). The front-end will need t...

rsync: polling for new files

I've got: $ rsync -azv zope@myserver:/smb/Data/*/*/* ~/rsynced_samples/ And I want it to run forever, syncing any new file as soon as it appears on myserver: (specifying a poll interval, such as 4 seconds would be an ok comprise) ...

PHP daemon process to submit post-dated status updates to Facebook, Twitter, etc.

I am building an app that lets users link their facebook, twitter, linkedin accounts to my app and than post updates to all these sites through my app. Additionally user can 'post-date' status updates. They can set a date and time to their update, and which will cause the update to be posted to the requested sites only at the specified d...

Launching an independent process from php (via httpd)

Hi, i'm trying to spawn a daemon-like process from php on a unix environment, keep the pid for reference and keep it completely independent from httpd processes. This is useful for controlling middleware applications from administrative backoffices. I want to keep it generalized to reuse for any command, i don't want to write a .sh for ...

Using Qt Solution (Qt Service) with FOSS.

I am creating a piece of FOSS to handle all the extra buttons ony my keyboard (through g15daemon). As part of this, I wish to create a daemon to handle parsing events. I am planning on using the Qt Service solution provided by Qt. My question is: should these files be included with the project or handled seperately? Since the Qt-Servic...

What are the behavioral differences between a daemon and a normal process?

I know that daemons run in the background mostly i.e. they require very less interaction from the user. Wikipedia lists some of the types of daemons that commonly exist: Dissociating from the controlling tty Becoming a session leader Becoming a process group leader Staying in the background by forking and exiting (once or twice). This...

C daemon sleep()

I'm running a running a simple daemon test in c++. It runs fine without the sleep() but if I add sleep() func it runs once then stays a sleep. Further the first run should print once "Hello" in logs/log.dat file but that doesn't happen either. Here is the code: #include <cstdlib> #include <cstdio> #include <iostream> #includ...

How do I get started writing a daemon process in a Unix-like operating system, like Linux?

I am doing a tool in PHP for my personal use. But PHP is very slow and the task I need to do is takes much time, so I'll make a daemon in c++ and keep it in the background (It will run in a VPS). PHP would connect to the daemon througt a simple tcp socket (I'll try to design/use a simple IPC protocol) in order to submit the task. The d...

Simple queue for youtube-dl in linux shell

youtube-dl is a python script that allows one to download youtube videos. It supports an option for batch downloads: -a FILE, --batch-file=FILE file containing URLs to download ('-' for stdin) I want to setup some sort of queue so I can simply append URLs to a file and have youtube-dl process them. Currently, it does not remove f...

Why does a Daemon randomly stop?

Hello, This is sort of related to a previous, yet so far unsuccessful question of mine. I have a daemon that is placed in the LaunchAgents folder (on Mac) and it should run perpetually in the background, but after a couple of days it just stops for no apparent reason. I have no idea why and thus my question: What are the reasons that a...

Success with start-stop-daemon and mono-service2?

Has anyone had any success using start-stop-daemon and mono-service2 together? I've been fighting this for a few days now and have gotten various bits to work, but have had no success in getting a fully functional init script for a mono service. Here is what I have learned to date: The mono or mono-service exe must be named as the va...

ruby daemons - running but not functioning

hi, I have created my first ruby daemon and it functions fine for about a day but then it stops functioning but it still appears in the /var/run folder. here is my control code - require 'rubygems' require 'daemons' dir = File.dirname(__FILE__) options = { :app_name => "rk_mail", :dir_mode => :system, :backtrace => true, :log_ou...

Make a Ruby program a daemon?

I want to write a Ruby program that will always be running in the background (a daemon) on my mac. Can someone point me in the right direction on how this would be done? Thanks. ...

Emacs C-x C-c overriding save-buffers-kill-terminal if within last open frame

I have setup emacs -daemon to run on login to Gnome and associated emacsclient with .cpp and .py files that I work with in Eclipse in order that emacs is used as my default editor for these files when selected within Eclipse. This way I can get a good work flow combining the editing capabilities of emacs and the project/build management...

Use existing java application with tomcat & cie.

I created a java application a year ago which is basically a multithread socket server for a website. I built this around a tutorial, which I expanded to do many things, including live multiplayer game with Flash client. The tutorial I used is the following (in french): http://defaut.developpez.com/tutoriel/java/serveur/multithread/ It...

How to use the pidfile library correctly?

I already read the man page of the pidfile function family. But I don't really understand it. What is the correct usage? Is there a more elaborate example available? I think I understand pidfile_open. But when should I call pidfile_write and prdfile_close? From which process? Parent or child? What parameters do I have to pass to those fu...

Is there a good reason to write my own daemonize function instead of using daemon(3)?

There are a lot of example implementations of daemons on the net. Most that I saw do not use the daemon(3) function to run the program in the background. Is that just a matter of taste, ignorance, or is there a good reason to write my own daemonize function? Is there a specific disadvantage in using daemon(3)? Is it insecure? ...