Questions tagged [daemon]

Computer program that runs as a background process, rather than being under the direct control of an interactive user.

420 questions
172
votes
3 answers

What does "systemctl daemon-reload" do?

I have a service that stopped suddenly. I tried to restart that service but failed and was asked to run: systemctl daemon-reload. What does it exactly do? What is a daemon-reload?
John
  • 1,821
  • 2
  • 9
  • 4
53
votes
4 answers

What's the difference between running a program as a daemon and forking it into background with '&'?

What are the practical differences from a sysadmin point of view when deploying services on a unix based system?
user1561108
  • 1,041
  • 2
  • 14
  • 26
53
votes
3 answers

How to list all running daemons?

From my question Can Process id and session id of a daemon differ?, it was clear that I cannot easily decide the features of a daemon. I have read in different articles and from different forums that service --status-all command can be used to list…
Jackzz
  • 1,363
  • 3
  • 15
  • 21
50
votes
1 answer

Systemctl remove unit from failed list

How can I remove a unit from the systemctl --failed list without rebooting the machine? Background: I have, amongst others, the following entry in the list: ● [email protected] loaded failed failed OpenVPN service for intranert This…
Richard Neumann
  • 1,309
  • 1
  • 14
  • 22
46
votes
16 answers

How to run Dropbox daemon in background?

I'm using Debian 6 and Dropbox. I followed these commands to install it. When I run ~/.dropbox-dist/dropboxd — Dropbox works and stuff. Problem is that when I close terminal or, even worse — reboot, Dropbox stops working and I need to run that…
daGrevis
  • 843
  • 2
  • 9
  • 19
38
votes
3 answers

"Proper" way to run shell script as a daemon

I am writing a shell script that I would like to run as a daemon on startup without using external tools like daemontools or daemonize. Linux Daemon Writing HOWTO According to the Linux Daemon Writing HOWTO, a proper daemon has the following…
user339676
  • 877
  • 2
  • 9
  • 15
37
votes
4 answers

How to check that a daemon is listening on what interface?

Ex.: an sshd is configured to only listen on wlan0. So. Besides checking the sshd_config how can I check that a daemon is listening on what inerface? netstat can do it? how? (OS: openwrt or scientific linux or openbsd) UPDATE: I thought sshd could…
gasko peter
  • 5,434
  • 22
  • 83
  • 145
26
votes
1 answer

Why we use setsid() while daemonizing a process?

In order to create a service (daemon) we fork the parent and make it to exit while making the child to be the session leader by calling setsid(). Moreover why do we use setsid()? Our orphan process is taken care of by init(though in not all cases)…
Kalu
  • 449
  • 1
  • 6
  • 14
24
votes
3 answers

How to set a script to execute when a port receives a message

I'm wondering how to get a shell script to listen in on a certain port (maybe using netcat?). Hopefully so that when a message is sent to that port, the script records the message and then runs a function. Example: Computer 1 has the script running…
Daniel
  • 349
  • 1
  • 2
  • 3
23
votes
7 answers

Ubuntu12.04: How to disable a daemon process at startup

I normally use service start/stop or initctl start/stop to start or stop a daemon process but now what I am looking for is to disable a daemon process from starting at startup example mysqld. Currently what am doing is renaming /etc/init/mysql.conf…
RanRag
  • 5,675
  • 6
  • 20
  • 15
21
votes
1 answer

start-stop-daemon not working as expected, no pid file was written

I'm trying to control a python based program (which doesn't detach itself from console) #!/bin/bash user=nobody pid=/var/run/xx.pid name=xx prog=/xx.py case $1 in start) /sbin/start-stop-daemon --start -b --oknodo --user "$user" --name…
daisy
  • 53,527
  • 78
  • 236
  • 383
19
votes
1 answer

What is the difference between start-stop-daemon and running with &?

I am setting up a service in /etc/init.d. I am looking at various scripts in there, some are implemented with start-stop-daemon ... and some with /path/to/script &. All of them save the pid in a file and do some checks. What is the best practice,…
Thomas
  • 883
  • 2
  • 12
  • 25
19
votes
3 answers

How to set OOM killer adjustments for daemons permanently?

Running some Linux servers with single or just a few vital system service daemons, I would like to adjust the OOM killer for those daemonized processes in case something odd happens. For example, today some Ubuntu server running MySQL got a killed…
gertvdijk
  • 13,459
  • 7
  • 45
  • 59
18
votes
1 answer

Idiomatic location for file based sockets on Debian systems

I am writing a daemon process for a Debian system in C that uses a Unix Domain Socket. If the daemon process's working directory is the root directory, is there an idiomatic directory to place the socket on the file system?
recursion.ninja
  • 285
  • 1
  • 3
  • 7
18
votes
2 answers

What is log_daemon_msg?

I was looking through /etc/init.d/ssh to get an idea of how a "proper" sys daemon is run at boot (I'm trying to add svnserve to that list). I saw this log_daemon_msg used as a command, but I have no idea what it is. which log_daemon_msg and man…
Dubslow
  • 292
  • 1
  • 2
  • 9
1
2 3
27 28