Questions tagged [start-stop-daemon]

`start-stop-daemon` is a program used to control the creation and termination of Linux system-level processes (daemons).

start-stop-daemon is a program used to control the creation and termination of Linux system-level processes (daemons). Using one of the matching options, start-stop-daemoncan be configured to find existing instances of a running process.

The man page specifies below note:

Note: unless --pidfile is specified, start-stop-daemon behaves similar to killall(1). start-stop-daemon will scan the process table looking for any processes which match the process name, uid, and/or gid (if specified). Any matching process will prevent --start from starting the daemon. All matching processes will be sent the TERM signal (or the one specified via --signal or --retry) if --stop is specified. For daemons which have long-lived children which need to live through a --stop, you must specify a pidfile.

Usage sample:

start-stop-daemon --start --background -m --pidfile ${PIDFILE} --exec ${DAEMON} -- ${TARGETDIR}

Command arguments explanation:

  • --start : Check for an instance of the specified process and start it (if not already started).
  • --background : the daemon is launched as a background process.
  • -m : make a PID file. This is used when your process doesn't create its own PID file, and is used with --background.
  • --pidfile ${PIDFILE} : check if the PID file has been created or not.
  • --exec : make sure the processes are instances of this executable (in this case, DAEMON)

For more informations and more options, check the man page.

98 questions
1
vote
0 answers

Configuring Motion to run as daemon in Raspberry and right (?) issues

I'm able to tun my motion detection in my Raspberry 2: In /etc/default/motion I changed start_motion_daemon=no to start_motion_daemon=yes Next I enabled motion by entering the following at the command line: sudo systemctl enable motion Finally…
hannes ach
  • 8,318
  • 3
  • 39
  • 50
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
0 answers

Python script as service in init.d, is it worth to daemonize?

I have few python scripts that I want to have as a service in a system. My initial approach was to use python-daemon and it worked. Process was detached and running in the background. Then I have learnt that init.d provides wrapper to what I need,…
Drachenfels
  • 2,273
  • 1
  • 24
  • 33
1
vote
1 answer

Stop Daemon not terminating child java process

following setup Start-Stop-Daemon: do_start start-stop-daemon -S -m -p $PIDFILE --name myapp --exec /opt/myapp do_stop start-stop-daemon -K -R TERM/30/KILL/5 -p $PIDFILE --name myapp the script I start looks like that: java -jar ./myapp.jar so…
Tobi
  • 874
  • 1
  • 9
  • 36
1
vote
2 answers

Solr upstart script using start-stop-daemon

I want to start my solr using upstart command. The command I use to start solar normally is /usr/bin/java \ -Dsolr.solr.home=/home/justeat/work/projects/solr/apache-solr-4.0.0/example/solr \ -Djetty.port=8983…
robert
  • 7,691
  • 9
  • 41
  • 68
1
vote
4 answers

Restarting a linux daemon

I have Linux daemon that I have written in C++ that should restart itself when given a "restart"-command from a user over the network through its console. Is this possible? I use a /etc/init.d script. How can I program it to restart itself? Should I…
user152949
1
vote
1 answer

Upstart script for New Relic monitoring plugin

I am trying to start a New Relic monitoring plugin MeetMe/newrelic_plugin_agent with upstart on Ubuntu 12.04. Here is the script I wrote: env USER=newrelic env DAEMON="/usr/local/bin/newrelic_plugin_agent" env DAEMONARGS=" -c…
silentser
  • 1,991
  • 2
  • 21
  • 27
1
vote
1 answer

What is the benifit of PCNTL-PHP for daemon process

I was researching and trying to do a daemon process using php, I found my self compelled to recompile PHP to enable PCNTL. Then I started to do some tests. I forked the single orphan example : #!/usr/bin/env php
Rabih
  • 268
  • 1
  • 4
  • 16
1
vote
2 answers

Could not stop mpd service (No /usr/bin/mpd found running; none killed)

Whenever I want to stop my mpd server running in my RaspBMC by typing: service mpd stop The console shows the typical [ ok ] message: [ ok ] Stopping Music Player Daemon: mpd. But the service doesn't really stops at all (the process keeps…
Lluís Suñol
  • 2,733
  • 3
  • 18
  • 30
1
vote
1 answer

howto start a couple piped processes with start-stop-daemon

I've been googling around looking for a way to properly and cleanly start a series of binaries wich are pipeed toghether, and let all the whole stuff be launched normaly as a series of daemons would be... but no luck with this. In a nutshell, here's…
AlexOlivan
  • 13
  • 3
1
vote
3 answers

php and error "start-stop-daemon: unable to stat"

I have a daemon that I have created using php. I want to have this called by initscripts and have it start on boot, which works fine. However, when I try to kill the process using sudo service crystal_send stop it does not kill the process. And…
dostrander
  • 687
  • 4
  • 19
1
vote
0 answers

Unix daemon starts before network dependency is up

I am trying to create a daemon that is started automatically during the boot-up. It depends on the network, local fs and remote fs services. I believe I have done everything to indicate these dependencies and I expect the daemon to be started…
sky
  • 105
  • 2
  • 9
0
votes
1 answer

Daemon startup on Debian(existence of /sbin/service)

What is the best way to start a service on Debian through a program? I used to use '/sbin/service start', but I recently came across a system where '/sbin/service' did not exist, so starting the daemon would fail.
Specksynder
  • 795
  • 8
  • 20
0
votes
1 answer

When Im running the android it starts emulator not physical device when react-native run-android

I was running the application over Physical device after only I start to run application without physical device Emulator opened once and after that My MacOS machine never recognize my physical device as a adb device
0
votes
0 answers

start-stop-daemon gracefully end while loop child process on shutdown / restart

So I've got the following for my start-stop-daemon in a service on my ubuntu 20.04 machine: DIR=/var/www/tools/A DAEMON=$DIR/main.py DAEMON_NAME=toolA DAEMON_OPTS="" DAEMON_USER=www-data PIDFILE=/var/run/$DAEMON_NAME.pid .…
Mart
  • 467
  • 4
  • 18