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.
20
questions
74
votes
2
answers
69k
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
...
55
votes
4
answers
94k
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....
17
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 ...
38
votes
7
answers
168k
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.
...
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 ...
2
votes
1
answer
8k
views
How to configure Python Script to run as a daemon
I have a couple webservers sitting behind a loadbalancer, and i found "watcher.py" here: https://github.com/splitbrain/Watcher
I chose this script for several reasons: recursive through folders, lots ...
68
votes
11
answers
187k
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
199k
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?
53
votes
4
answers
198k
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
9
votes
4
answers
8k
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 ...
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
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 ...
4
votes
1
answer
4k
views
Rename mailer-daemon in postfix
Is there a way to rename the email adress of [email protected] to some other (e.g. [email protected])? I need that the sender of the "Non delivery report" has other email adress than ...
3
votes
7
answers
4k
views
Shell script to execute something when one of the daemon dies?
I just had to build two instances of daemon running on different ports. let's say they both serve critical missions for some applications.
How can I do some automatic task (eg. shell script) ...
0
votes
1
answer
1k
views
Autostart/restart program simply with daemontools in debian 9 [closed]
For example make vlc start and play a video full screen on boot.
After working this out here it is: