daemon

Creating a daemon with stop, start functionality in C

How to add daemon stop, start and report function to this daemon code? #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <errno.h> #include <unistd.h> #include <syslog.h> #include <string.h> int main(void) { /* Our process ID and Session ID */ pid_t pid, sid...

Executing shell script with system() returns 256. What does that mean?

I've written a shell script to soft-restart HAProxy (reverse proxy). Executing the script from the shell works. But I want a daemon to execute the script. That doens't work. system() returns 256. I have no clue what that might mean. #!/bin/sh # save previous state mv /home/haproxy/haproxy.cfg /home/haproxy/haproxy.cfg.old mv /var/run/ha...

If i connect to a python websocket will it start a new script or connect to a daemon

Clue is in the name. When a websocket connects will it connect to run a new script or start a daemon, if it does start a new script is there a way to pass it on to a daemon script ? Thankyou ! Finished I dont know what the answer to my own question is but i just set up a deamon to run on its own port. ...

Java daemon deployment infrastructure

Is there any deployment platforms for Java daemons? We have glassfish, geronimo etc. for web-application deployment, but if I have simple Spring based application which is processing messages from ActiveMQ or something like that. Where I should deploy that? ...

Starting a Process When a Port is Connected To

I want to create a single client that issues unicast requests for data from any of many workstations on the same LAN. The client will likely run Linux, but the workstations may run any OS. Is it possible to avoid running a daemon on each of the workstations and yet have them reply to requests within a few seconds? I want to avoid creatin...

How to write a daemon

Does anyone know how to write a daemon? I want to write a daemon which executes a script to move a file from one particular directory to another. ...

how to schedule some code execution in android or: what exactly are daemon threads in android?

hi there! i'm currently working on an app for the android os that requires to fetch data from a remote server from time to time. as this "update" should be carried out even when the actual frontend app is not running, i implemented a remote service that is started on system boot. now i need to schedule a timer to start the update. is ...

how to realize an update service running in the background in android?

hi there! i'm currently working on an app for the android os that displays some data. to ensure this data is up-to-date, it is required that the app fetches updates from a remote server from time to time. as the data does not change very often, this update should be carried out once per week. i want to give the user the ability to choos...

Non-blocking native files access - single-threaded daemon in C?

I've found out that native files access has no "non-blocking" state. (I'm correct?) I've been googling for daemons which are "non-blocking", and I've found one which achieved said behavior by threading file access operations, so that the daemon won't block. My question is, wouldn't threading and IPC'ing such operations be rather expens...

mail daemon on java

I need to create something like mail daemon on java or node.js We have a highload project written on PHP which generates a lot of e-mail registrations/updates/etc. Currently all messages are being put into mongodb after processing (language/template). I'm considering writing a small daemon which will check for new messages in mongo every...

Java running as a Unix service

Hello there! I have build a little daemon in Java and I would like to run it as a service under Unix (e.g. Debian 5). I have read, that there is a possibility of using a Java wrapper - but isn't there any other option which is easier to implement? Can't I just use a Unix command such as "xxx java -jar program.jar"? Thanks in advice, gu...

Twisted UDP Server - daemonize?

I have the following UDP server using Twisted: # init the thread capability threadable.init(1) # set the thread pool size reactor.suggestThreadPoolSize(32) class BaseThreadedUDPServer(DatagramProtocol): def datagramReceived(self, datagram, (host, port)): #do some stuff here... def main(): reactor.listenUDP(PORT, BaseT...

Embedded Linux LED-flashing daemon: does it exist?

I've seen embedded boards before that have an LED that flashes like a heartbeat to show that the board is still executing code. I'd like to do something similar on an embedded Linux board I'm working on. Given that it's a fairly trivial bit of code, it seems likely to me that someone has already written a daemon for Linux that does this,...

Storing pid file for a daemon run as user

Is there a preffered place to store a pid file for a daemon that's run as a user? /var/run is the standard place, but this is for a user daemon so it doesnt have write privelages there. Presumably my daemon will be started from .profile or .bashrc or something. Is just saving it to /tmp a bad idea? ...

daemon process killed automatically

Recently I run a below command to start daemon process which runs once in a three days. RAILS_ENV=production lib/daemons/mailer_ctl start, which was working but when I came back after a week and found that process was killed. Is this normal or not? Thanks in advance. ...

Emacs: GUI with emacs --daemon not loading fonts correctly

Hello, I set up an emacs --daemon in order to startup emacs faster. I like especially the GUI version of emacs, so I do emacsclient -c to open a new emacs frame. The problem is that I have changed my fonts, but these fonts aren't loaded if I start emacsclient -c. However, they are applied if I start just emacs (but this causes the who...

Profile python program that forks itself as a daemon

Is it possible to run cprofile on a mult-threaded python program that forks itself into a daemon process? I know you can make it work on multi thread, but I haven't seen anything on profiling a daemon. ...

Working implementation of daemon in Python

Does anyone know of a working and well documented implementation of a daemon using python? Please post a link here if you know of a project that fits these two requirements. ...

Talking with a Ruby daemonized process

Hi, I use Ruby 1.9 and the following method inside my program: Process.daemon Then, when I open a new terminal, I would like to call my daemonized program (named my_program) and send to it a message. Such as this: $ my_program --are_you_still_alive Thank you for any idea. ...

Node.js as a background service

I want my node.js server to run in the background, ie: when I close my terminal I want my server to keep running. I've googled this and came up with this tut, however it doesn't work as intended. So instead of using that daemon script, I thought I just used the output redirection (the 2>&1 >> file part), but this too does not exit (I get...