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
0
votes
0 answers

start-stop-daemon cannot find file but clearly executes it

I'm running a python script on my ubuntu machine which i'd like to daemonize. I use the following to start the daemon: DIR="/var/www/tool" DAEMON="$DIR/main.py" DAEMON_NAME="tool" DAEMON_OPTS="" DAEMON_USER=ROOT log_daemon_msg "Starting system…
Mart
  • 467
  • 4
  • 18
0
votes
0 answers

Buildroot mountpoint busy after executing script

I have a problem with a buildroot/hotplug/start-stop-deamon assembly. I have a script on a usb stick, which is executed via a mdev hotplug handler. The script stays in its read only auto mount location "/media/sda1/update/autorun.sh" cd / /bin/sh…
engelant
  • 161
  • 8
0
votes
0 answers

/sbin/start-stop-daemon --status returns 0 for non-running process

I am using /sbin/start-stop-daemon --status to check the status of process in Ubuntu1804. But found that --status returns 0 for non-running process, which is not expected. > cat /tmp/test.pid >> 28092 > /sbin/start-stop-daemon --status --pidfile…
FaceBro
  • 709
  • 1
  • 10
  • 26
0
votes
2 answers

start-stop-daemon with --background vs running using & option

What is the difference in running a process in background using start-stop-daemon with --background option and using with &?Which option is best and why?
Prasad Roy
  • 43
  • 5
0
votes
0 answers

Hadoop daemon , Datanode missing

I tried clearing /app/Hadoop/temp directory and creating it again and assinging permission chmod and chown, after this datanode appears but when starting terminal again makes datanode disappears.
0
votes
1 answer

Run Superset as Service

I have configured my superset in Virtual env want to run it as a service I have tried using below config but its not working [Unit] Description=superset…
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
  • 6
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
  • 71
  • 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
  • 2,683
  • 14
  • 28
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
  • 129
  • 1
  • 8
0
votes
1 answer

how to create a PID file for a java process

I'm attempting to create a PID file like below: LOCKFILE=/var/lock/ocr-trafficcop.lock PIDFILE=/var/run/ocr-trafficcop.pid JVM_ARGS="-Xms1024M -Xmx2048m -Dspring.config.location=/opt/app/configs/ocr-trafficcop/ -DserviceName=ocr-trafficcop…
Simply Seth
  • 2,638
  • 10
  • 46
  • 66
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
  • 125
  • 1
  • 9
0
votes
1 answer

LaunchDaemons is giving error 127

i have a problem when i run LaunchDaemons this is my .plist:
cickStar
  • 99
  • 1
  • 2
  • 8
0
votes
0 answers

Multiprocessing queue python-daemon

I need linux daemon on python with multiprocessing queue. I allready trying python demonize but it's have an issue with pid's,access rights and start/stop funcs. This is opion through python-daemon package. Programm listing: #file test_daemon.py …
ARCAON
  • 61
  • 1
  • 6
0
votes
1 answer

Linux start-stop-daemon directory error calling shell/python script

I am just getting acquainted with Linux and I cannot seem to get the start-stop-daemon to run a python script due to directory issues. In a linux file structure I have the files: ~/test.txt THIS LINE IS A TEST ~/test.py #!/usr/bin/python import…
Alex JG
  • 3
  • 2