Questions tagged [daemon]
On linux an unix-like systems is demon the designation of processes running in the background and providing certain services. Direct user intaractions with demons are not intended.
289
questions
74
votes
2
answers
71k
views
Create a directory under /var/run at boot
I had a daemon that needed its own dir in /var/run for its PID file with write permission granted to the daemon's user.
I found I could create this dir with these commands:
# mkdir /var/run/mydaemon
...
68
votes
11
answers
188k
views
Disable a service from starting at all runlevels?
I have a service foo which currently starts at runlevel 3 and above. How can I stop it from doing so, without using update-rc.d foo stop 3 ., which (if I understand it correctly) would turn off the ...
67
votes
4
answers
204k
views
What is the difference between syslog, rsyslog and syslog-ng? [closed]
I am a bit confused in syslog, rsyslog and syslog-ng.
From where can I get the source code for syslog()?
Is there any difference between rsyslog and rsyslogd?
56
votes
4
answers
96k
views
Start N processes with one systemd service file
I found this systemd service file to start autossh to keep up a ssh tunnel: https://gist.github.com/thomasfr/9707568
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network....
53
votes
4
answers
206k
views
Configuring Systemd Service to run with root access
I have a service in the form of a node.js application set up with Systemd on Raspbian Jessie and it is using its own user account. However, I am finding that the service does not run correctly because ...
44
votes
4
answers
197k
views
Authentication is required to manage system services or units.
I have a strange issue whenever trying to stop/start a daemon as a regular user, it asks to authenticate with the credentials of another regular user - for example:
[bob@server ~]$ systemctl stop ...
38
votes
7
answers
169k
views
How to automatically start supervisord on Linux (Ubuntu)
Supervisord does not come with an init script or does not indicate how to get it started automatically, ie. after a reboot. I've tried some user-contributed /etc/init.d scripts, but they all fail.
...
37
votes
6
answers
149k
views
How to stop nginx on Mac OS X
I've installed and configured nginx server on my Mac from MacPorts
sudo port install nginx
Followed the recommendation from the port installation console and created the launchd startup item for ...
34
votes
4
answers
77k
views
public key authentication fails ONLY when sshd is daemon
I have no clue on how this happens. The distro is Scientific Linux 6.1 and everything is set up to perform authentication via public key. Yet, when sshd is running as a daemon (service sshd start), it ...
23
votes
5
answers
58k
views
console-kit-daemon - can it be stopped?
I have 60 instances of Console Kit daemon on Ubuntu 9.04 server installation. Is it safe to kill those or stop these processes. They seem to be taking about 20% of RAM each(see on htop).
19
votes
3
answers
40k
views
Is there a "standard" way to make daemon in Debian?
I need to create a daemon from the application in Debian. Is there any standard tool for this in Debian like "upstart" in Ubuntu? I need only start-stop commands, to start a program as a daemon with ...
18
votes
7
answers
49k
views
Too many open files on Debian
I have long running process at Debian. At some point in throw an error:
Too many open files.
Running:
ulimit -a
shows:
open files (-n)
1024
I wish to increase number ...
16
votes
4
answers
77k
views
Create daemon on ubuntu 16.04
I developed a crawler in PHP that parse an URL with specific headers and put all URLs of content in the queue. It works fine.
I developed this code in a ubuntu 14.04 and I put a .conf file in /etc/...
16
votes
5
answers
26k
views
Standard or best way to keep alive process started by init.d
I'm looking for a standard way or best practice to keep a daemon started by an init.d shell script alive.
Or even better, is there a way to keep it alive directly from /etc/init.d?
Specifically, I ...
14
votes
2
answers
41k
views
Does NTP daemon set the host timezone?
If I am using NTP daemon or ntpdate command, do I need to worry about changing the timezone?
Should I re-configure the timezone using cron job to guarantee the accuracy of the server time?
I am ...
12
votes
4
answers
15k
views
Is there a difference between a daemon and a service?
Is there a difference between a daemon and a service?
Or are they both basically an application that is resident in memory, and is bound to a specific port and listens/responds to requests?
12
votes
3
answers
16k
views
Can start-stop-daemon use environmental variables?
I need to daemonize a Windows app running in Wine, and create a pid in /var/run. Since it requires an X11 session to run, I need to make sure the $DISPLAY variable is set in the running user's ...
12
votes
1
answer
25k
views
Monit configuration reload - supposed to restart monitored services?
Running Monit 5.4 on an Ubuntu server. When I use monit reload, it seems that it restarts monitored services (Tomcat 7 in this situation). Is it the expected behavior? Documentation says :
reload - ...
11
votes
1
answer
35k
views
Systemd : Run a Python Script At Startup (virtualenv)
I have a python script that I normally run it with this command:
(environment) python run.py
I want to run this script at start. (I'm using ubuntu) Here is my service:
[Unit]
Description=My Script ...
11
votes
5
answers
32k
views
runit - unable to open supervise/ok: file does not exist
I'm trying to figure out why runit will not boot or give me the status for the managed applications. Running on Ubuntu 12.04.
I created /service, /etc/sv/myapp (with a run script, a config file, a ...
10
votes
3
answers
14k
views
Managing daemons with supervisor: no foreground mode available
I'm trying to manage a process with supervisord, but the process does not have an option to run in foreground: it always daemonizes. (That's Zabbix Server).
Is there any way to manage daemons with ...
10
votes
1
answer
35k
views
Init script does not create a PID file
I need to create an init script for an IRC logger. I copied /etc/init.d/skeleton. I filled in the configuration section to fit my needs and I also had to add --background to the start daemon command ...
10
votes
2
answers
11k
views
Run as different user
On a RedHat system, i'm trying to launch a program with a different user who dont have any shell. In /etc/passwd, shell is /sbin/nologin.
I have tried:
su myuser -c /home/myuser/script.sh
Result: ...
9
votes
3
answers
32k
views
Why does NTP daemon keep listening on UDP6?
I have a clean Debian 7 installation, and I manually entered the following lines in /etc/ntp.conf:
interface ignore wildcard
interface listen <local_nic_ip>
Hoping that NTP will no longer ...
9
votes
4
answers
9k
views
How to tell if an ssh ControlMaster connection is in use
I'd like to use ssh's ControlMaster feature to share connections for speed increases. I'm trying to script it so that I can start/restart/stop a number of connections to different hosts.
How can I ...
9
votes
2
answers
4k
views
Call to daemon in a /etc/init.d script is blocking, not running in background
I have a Perl script that I want to daemonize. Basically this perl script will read a directory every 30 seconds, read the files that it finds and then process the data. To keep it simple here ...
8
votes
4
answers
1k
views
Should a foreground program invoked by a daemon split logging between stderr and stdout based on severity levels?
Usually log messages are written to stderr. I'm wondering if it is a good idea/practice to split log messages so that errors and warnings go to stderr while debug/informational/notice messages go to ...
8
votes
2
answers
20k
views
daemon function isn't working in CentOS 6.4
I'm trying to daemonize a process under a different user.
In my init.d, I have a service which looks a little bit like this:
...
start() {
echo "Starting mydaemon..."
daemon --user someuser -...
8
votes
1
answer
11k
views
How can I generate a command for start-stop-daemon that will kill the process if it doesn't term during a timeout period?
I need to run a start-stop-daemon for a redis instance and I want it to send a SIGTERM and if the redis instance doesn't quit i would like it to force a quit.
The start-stop-daemon configuration says ...
8
votes
2
answers
19k
views
systemd ignores return code while starting service
I ran into this problem while writing unit-file for one simple daemon. When daemon returns '1' on startup systemd just ignores it, and it looks like daemon was started successfully while it's actually ...
8
votes
3
answers
19k
views
Ways to set umask on Ubuntu for daemon processes
I have an http daemon server process (yaws) that I would like to have server write any new files with a umask of 002, so that another user in the same group can modify, move, or delete files created ...
8
votes
2
answers
9k
views
What's the purpose of kslowd?
I'm running Ubuntu 10.10:
uname -a
Linux mt-xps 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux
When I run top, I occasionally see a "kslowd000" or similar process ...
8
votes
1
answer
2k
views
Safely providing passwords to a linux daemon
I have a linux daemon that accesses some services (db etc). It needs some passwords for this. What would be the best way to give the passwords to the daemon in a secure manner?
I currently store the ...
8
votes
3
answers
34k
views
How can I run supervisord without using root?
I seem to be having trouble figuring out why supervisord won't run as a non-root user. If I start it with the user set to jason (pid 1000), I get the following in the log file:
2010-05-24 08:53:32,...
7
votes
3
answers
4k
views
How can I drop privileges and still clean up my pid file in /var/run?
I have a daemon called foo. My init script /etc/init.d/foo starts the foo daemon and stores its pidfile in /var/run/foo.pid, which seems to be the standard place. Because /etc/init.d/foo must be run ...
7
votes
2
answers
8k
views
Start Sinatra app in the background with stdout and stderr redirected (append) to a file
I have a Sinatra app which I run on my local machine using ruby app.rb. While deploying it on a remote machine via ssh, how do I run it in background and redirect stdout and stderr to a log file?
On ...
7
votes
4
answers
4k
views
No coredumps for daemons started at boot by init.d on Ubuntu
How can I get daemons started by init.d at boot to coredump on Ubuntu? This is what I have done so far...
echo "ulimit -c unlimited" >> /etc/profile
mkdir /corefiles/
chmod 777 /corefiles/
echo ...
7
votes
1
answer
17k
views
Running Jenkins standalone vs within Tomcat
What things should be considered when deciding between running Jenkins standalone or within Tomcat? We would prefer to not have to use Tomcat because there's no other applications on this server ...
6
votes
2
answers
55k
views
How to check syslog.d is running
My syslog is running correctly but out of curiosity how to check that syslog daemon is running. Is there anyway I could check the status like apache
root@server1:/etc# /etc/init.d/apache2 status
...
6
votes
3
answers
20k
views
How to start Mongo daemon with auth support
I want to start the MongoDB daemon with auth support using the Mongo init script:
sudo /etc/init.d/mongod start
I have also added db users to the database to authenticate. I'm working with two ...
6
votes
1
answer
4k
views
nohup vs screen vs ? for manually starting daemon processes
When I need to start a background process on a low-importance server, I tend to use nohup:
nohup ./server.sh &
Most colleagues seem to prefer screen:
screen -D -R mydaemon
./mydaemon.sh
^A ^D
...
6
votes
1
answer
10k
views
Launching a PHP daemon from an LSB init script w/ start-stop-daemon
I'm writing an lsb init script (admittedly something I've never done from scratch) that launches a php script that daemonizes itself. The php script starts off like so:
#!/usr/bin/env php
<?php
/*...
6
votes
1
answer
8k
views
runit does not kill process on sv stop or sv reload
i am running a headless selenium process along a jenkins server on an AMI linux box, all managed by runit.
the problem is that issuing "sv stop selenium" or "sv reload selenium" do not term or kill ...
6
votes
1
answer
5k
views
Equivalent for the "pid file" stanza in newer versions of upstart
I'd like to be able to use upstart to manage daemons where I don't have complete control over the forking behaviour. The "pid" stanza is removed as of version 0.3.9, so I can't point it at a pid file. ...
5
votes
5
answers
1k
views
How to daemonize a shell task?
How can I run a console command (like cp or tar, for example) without needing to keep an open SSH?
5
votes
4
answers
14k
views
How do I find out the process id of the backgrounded process?
I've got a command (program) that I'd like to run with nohup and background it. Like
nohup command > logfile.txt &
How do I find out the process ID? I would like to be able to write the ...
5
votes
4
answers
17k
views
How do I automatically restart a process on server reboot/process exit?
On my Ubuntu server I use God to monitor some Ruby processes/scripts, including a Queue system.
God automatically checks when one of my processes exists and restarts it. It also keeps track of memory ...
5
votes
2
answers
22k
views
init script that logs output of the script
How can this be done? I know it's pretty simple and includes appending something like & or &> to the actual command that starts the init script.
But, what is the best approach and how can ...
5
votes
6
answers
3k
views
How to daemonize servers on Ubuntu?
I've got a couple of servers on my Ubuntu that need to be restart-proof daemonized. How can I do that with generic init first process? Should I swap to upstart or some other replacement?
5
votes
1
answer
557
views
Opera unite as a daemon
Is it possible to run an opera unite server without the browser?
Say for instance I want to use my always-on FreeBSD server, which doesn't run X.