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.

100 questions
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
  • 298
  • 1
  • 6
  • 18
1
vote
2 answers

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
  • 737
  • 5
  • 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
  • 115
  • 2
  • 10
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
  • 813
  • 9
  • 20
0
votes
0 answers

start-stop-daemon not running

I have a script file using start-stop-daemon: trap "" 1 ( echo "INFO Starting $BinName application" cd ${APPLICATION_ROOT} if [ -e ${DEVOUT} ]; then mv ${DEVOUT} ${DEVOUTOLD} fi if [ -e ${DEVERR} ]; then mv…
pinxpoong
  • 11
  • 1
0
votes
0 answers

start-stop-daemon: cannot execute binary file

i need to deploy my angular application using nginx server for some tests. i copied nginx image and all needed config from docker as i cannot download it directly (company restrictions) i copied sbin, lib, config ... in a folder that i can manage…
sr123
  • 85
  • 1
  • 11
0
votes
1 answer

start-stop-daemon run with external script condition

I need know how run a service with start-stop-daemon with external script condition. Similar to what is done in a systemctl .service file, for example: NOTE: I need to do the same as the ExecCondition parameter does [Unit] Description=My…
Luis Cruz
  • 11
  • 3
0
votes
1 answer

Do you know how to make the system automatically restart daemon service?

I have made a daemon service in linux server. It is running well. The service file is stargate.service (in…
David
  • 3,538
  • 9
  • 39
  • 50
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
Apatoallo
  • 45
  • 3
0
votes
0 answers

How to troubleshoot services in Rapsberry Pi 3B

I have never done a service before in linux perse, but I been trying to make a service using a Pi. I used 2 different approaches to create a service. The first approach was using the systemctl using as base the code posted near the end of…
CodeAndvil
  • 15
  • 1
  • 7
0
votes
1 answer

start-stop-daemon error write to disk (some text)

Have C++ server program that writes logs to disk. Starting it from php script shell_exec("start-stop-daemon -Sbvx /home/my_server.out"); inside this program: ofstream log_file("/home/log.txt"); log_file << "some_log\n"; But there is no any log…
nefton
  • 101
  • 3
0
votes
2 answers

Can't read stdout output of external commands after deamonizing Python script

I wrote a RPC server foo in Python that I deamonized with start-stop-daemon --start --quiet --background \ --make-pidfile \ --pidfile /var/run/foo.pid \ -- /opt/foo Everything works fine except…
Simon Fromme
  • 3,104
  • 18
  • 30
0
votes
0 answers

Celeryd with django

I've been trying to run a celeryd (celery 3.1.25) service for my django project, but when I define CELERYD_USER="www-data" CELERYD_GROUP="www-data" in /etc/default/celeryd which seems to be used a lot, I get the following: celery init v10.1. Using…
unicorn
  • 139
  • 1
  • 9
0
votes
2 answers

Start service with start-stop-daemon on Ubuntu 16.04 with timeout

I have /etc/init.d/stream proces with start/stop/restart options. It's run ffmpeg with daemon options taken from /etc/default/stream DAEMON_OPTIONS. Start at background (-b) crate pid (/var/run/stream/stream.pid) etc. How could I add timeout 60…
Topper
  • 481
  • 3
  • 18