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
1 answer

Changing process name when running Python as daemon

I found this excellent website which gives an example upstart script for running Python scripts as daemons. My question is, can I change the name it reports as when I type ps -e? I was thinking start-stop-daemon might have an option to do that but I…
1
vote
1 answer

Can I prevent a script from launching twice using open(2) with O_CREAT and flock(2)?

I would like to prevent a script from launching twice by using a PID file. There are many ways to implement exclusivity, but since my script will always run on a Linux machine and I would like to be able to detect stale PID files automatically, I…
1
vote
0 answers

Ruby Constantly consume external API and share output across processes

I'm writing trading bot on ruby and I need to constantly do some calculations based on Exchange's orderbook depth data across several daemons (daemons gem). The problem is that right now I'm fetching data via Exchange's API separately in each…
Ilya Cherevkov
  • 1,743
  • 2
  • 17
  • 47
1
vote
1 answer

Run Play application dist in production as daemon

With my Play application built with command activator stage, I want to deploy it to production server. However, when I use the start script to start the app, it seems the app is not forked into a separated JVM. Thus if I try Ctrl+C, it will kill the…
Khanetor
  • 11,595
  • 8
  • 40
  • 76
1
vote
1 answer

Running a Linux Daemon vs An infinite loop in the background

I have this code to make a Daemon in C: #include #include #include #include #include #include void main() { FILE *fp= NULL; pid_t process_id = 0; pid_t sid = 0; // Create…
Kousha
  • 32,871
  • 51
  • 172
  • 296
1
vote
1 answer

How to make/monitor/deploy daemon processes in JRuby

I'm currently porting a Rails App currently using REE to JRuby so I can offer an easy-to-install JRuby alternative. I've bundled the app into a WAR file using Bundler which I'm currently deploying to GlassFish. However, this app has a couple of…
nazdrug
  • 11
  • 3
1
vote
1 answer

How to load large python object and allow other program to access it

I have a function that does the following: cursor.execute('SELECT runtime, fingerprint FROM itemstable') items = cursor.fetchall() for item in items: do_something() It takes about 3s to return the SQL query because there are 500k results or so…
David542
  • 104,438
  • 178
  • 489
  • 842
1
vote
1 answer

Daemonizing php script on Centos

Running into some problems trying to daemonize a php script on Centos Linux environment. It's unfortunate that Centos only has the limited daemon function and not the start-stop-daemon... I'm trying to create a service that runs a php script…
kennzors
  • 15
  • 8
1
vote
1 answer

BASH daemonize script amqp-consumer not persistant

First, sorry for my english :) I'm trying to daemonize a script, which uses a bash AMQP client library (amqp-tools), to allow message forward through a RabbitMQ broker. Here is a part of the script encrypter_mom_mailconsumer.sh write_log INF…
1
vote
2 answers

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…
Alex
  • 2,309
  • 2
  • 16
  • 20
1
vote
1 answer

Daemon PID lock error

After startup of system my script starts from crontab as daemon. It works for a while and suspends/hangs without response. After that I cannot run it like sudo python script.py restart, because it says: File…
mefe
  • 307
  • 1
  • 6
  • 14
1
vote
1 answer

Running SDL application as daemon on embedded linux system

I'm developing an application using /dev/fb0 framebuffer for graphics output. Running fine when executed from the terminal but when I try to run it as a daemon it won't output anything on the framebuffer. pid_t pid, sid; pid = fork(); …
1
vote
1 answer

Qt app receives HUP signal unexpectedly when forked to background

I have built a Qt app which upon receipt of the HUP signal shuts down nicely (setup like this how to get signals into Qt). This works great under Red Had 6, but when I run this app under Ubuntu 14 my app receives the HUP signal immediately (after…
TSG
  • 4,242
  • 9
  • 61
  • 121
1
vote
1 answer

Daemon on embedded Linux device using BusyBox be written in C or as a script

Should a daemon on an embedded device using BusyBox be written in C or as a script? All the examples I have seen use #! /bin/ash at the top of the file and that is for scripting? But in the device I'm writing to has only complied C files (I think)…
mycowan
  • 993
  • 8
  • 18
1
vote
0 answers

Put in a web page an image depending on daemon

I 'm trying to put on my website an image that changes depending on the state of a daemon . Let me explain: The daemon can return me 2 states when run service alapma.sh status: 1_[FAIL ] /home/pi/alarma.py is not running ... failed! 2_[ ok]…