Questions tagged [daemon]

A daemon is a process or program that runs in the background (i.e. requiring no user interaction).

Daemon processes are background programs found in Linux/Unix systems that are typically started during the booting sequence. They perform special management and utility functions, which may either perform consistent tasks like polling (i.e. the syslogd daemon) or wait for a command to do something (like handling setup of new SSH connections via the sshd daemon).

They can be initiated after start time using the systemctl command:

$systemctl start daemon.service

Some commonly used daemons include:

  • httpd (HTTP web server management)
  • mountd (Mounting of file systems)
  • nfsd (Sharing of network files)
  • routed (Management of routing tables)
  • ntpd (Network time protocol administering)
  • dhcpd (Dynamic host configuration protocol administering)
2634 questions
1
vote
2 answers

Daemonize a PHP script with the option to kill it

I have a script that should start running when the user presses the start button on my application. This script takes a couple of variables given by the user like configuration etc. This script should then be running until the user clicks the stop…
Martijn
  • 2,268
  • 3
  • 25
  • 51
1
vote
1 answer

Creating installer for launch daemon

I have a shell script that copies a plist into /Library/LaunchDaemons with sudo cp com.example.plist /Library/LaunchDaemons then launches it with chown root com.example.plist and launchctl load com.example.plist This works perfectly when run from…
Bob
  • 13
  • 2
1
vote
0 answers

Cant Start Job With Ubuntu Upstart

I have heard that Ubuntu upstart is the way to go for dameonization. So I tried this: First I added an init script in /etc/init/application.conf: description "Application" author "David Williams" env JAVA_OPTS="-server -verbose:gc -Xms1G -Xmx4G…
David Williams
  • 8,388
  • 23
  • 83
  • 171
1
vote
5 answers

Java daemon design practices

I'm writing a daemon in Java that takes in requests from multiple providers in which the provider would return a service object for the daemon to run as a thread. Application architecture: Main class Providers Services Libraries / Models List…
William
  • 15,465
  • 8
  • 36
  • 32
1
vote
1 answer

Java program shutdown on Linux

I am running a java server program on Linux in a virtual instance (from provider). It is a complex program based on Netty. I start it using: nohup java -jar server.jar > server.txt Then, it works fine. But sometimes, it crashes - around 1 time in a…
Artem Moskalev
  • 5,748
  • 11
  • 36
  • 55
1
vote
0 answers

Unix Syslog not working properly

I am using UNIX in cygwin (in Windows 7). I have a syslog.conf file consisting of this line initially: *.* /var/log/messages All information is logged to this "messages" file. Now when I changed the path to a new…
1
vote
1 answer

Daemon writing output to file twice instead of once in C++

I've written a daemon that writes the word "Beat" to a file, followed up the current date and time at 15 second intervals. However, each time I check the output file, the daemon appears to be outputting twice like this: Beat: Fri Jan 1 18:09:01…
Galileo
  • 1,265
  • 2
  • 10
  • 9
1
vote
1 answer

to run php file in background

i want to run code in background..i want this while downloading huge report which takes lot of time.. i have gone through almost all google sites but still m not able to find the answer.. m actually stuck not able to move further.. the code m using…
namratha
  • 652
  • 2
  • 13
  • 29
1
vote
3 answers

Python Daemon, repeat function every x seconds

I want to repeat a function every x seconds when the code its working like deamon in Python 2.6 for Linux. I have some code but its giving me a lot of problems. Is it possible to call a another file.py instead to write the code inside? Here is the…
John Lapoya
  • 582
  • 1
  • 8
  • 21
1
vote
1 answer

Kill all delayed_job workers

I use delayed_job as a daemon https://github.com/tobi/delayed_job/wiki/Running-Delayed::Worker-as-a-daemon I can't tell why, but sometimes I see more than one job done by several workers (different pids), and running stop doesn't stop anything. is…
elado
  • 8,510
  • 9
  • 51
  • 60
1
vote
1 answer

why we need to create a new session for daemon?

when writing a daemon program, it is required to create a new session for it. for example: fork a child process exit main process call setsid in child process I am wondering why we need to create a new session for it? we can put it to the…
camino
  • 10,085
  • 20
  • 64
  • 115
1
vote
1 answer

Cannot Import Daemon class

I am trying to run a daemon but I am not able to import the module daemon. My imports: import os import sys import time from daemon import Daemon Traceback (most recent call last): File "parser.py", line 11, in from daemon import…
user2935657
  • 11
  • 1
  • 2
1
vote
1 answer

process from pcntl_fork not terminating

I am running a web service which involved with daemons by php+apache2. So I tried pcntl_fork function. But there is a question that the child process are not terminating even I used exit(0) in the child process's code which result in a lot of…
zhshr
  • 95
  • 1
  • 8
1
vote
1 answer

Daemon not outputing to file but no errors are shown

I have created a network daemon but for some reason the code does not print to the log file. The file is created if not there and I do get information from the stdout so the process does get past those functions. process_id of child process 7796…
GeneralZero
  • 290
  • 1
  • 3
  • 15
1
vote
1 answer

Run nohup with multiple command-line arguments and redirect stdin

I want to run python argument1.txt argument2.txt >logfile.log with nohup, but I get no output because it is redirecting the input to null. I want it to accept command line arguments at first and do work in nohup way. nohup python argument1.txt…
user14372
  • 1,409
  • 2
  • 11
  • 12