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
1 answer

Logging error output from a php script called from start-stop-daemon

I'm testing the logging the output of a simple php script being run via the start-stop daemon on Ubuntu. The content of the test script, loop.php, is as follows:
Werner
  • 3,052
  • 1
  • 18
  • 18
0
votes
1 answer

Convert Command line to a service in ubuntu 16.04 LTS

When I am running a command bitcore-node start it starts two services. Screenshot of ps aux is attached. I created a service in /etc/init.d description "Bitcoin Core for Bitcore" author "BitPay, Inc." limit nofile 20000 30000 start on…
0
votes
2 answers

How do I guarantee that I have a process always up and running?

Is it more reliable to use daemontools or supervisord, or that I use crontab that runs a script of mine to keep checking if the process still exists and if not, start it again? What is the best way to guarantee for sure that a process is always…
PedroD
  • 4,310
  • 8
  • 38
  • 75
0
votes
1 answer

Delayed jobs stops after some time

I have an application which relies heavily on delayed jobs. So I have setup two servers, one of which servers up the application (m3.medium ec2 instance) while other one runs my delayed jobs(t2.micro ec2 instance). I have created a start and stop…
Ravi
  • 264
  • 1
  • 12
0
votes
2 answers

Simple daemon process in Ubuntu

I want to start a simple daemon process in Ubuntu, which will write the current time to log file every 5 seconds. start-stop-daemon --start --user root --make-pidfile --pidfile /home/manjesh/test.pid --exec…
Dave
  • 726
  • 3
  • 14
  • 36
0
votes
2 answers

How to Start/Stop Tomcat for normal user except root in Linux CentOS

I just install Tomcat6 in my Linux CentOS and I just want user to Start/Stop Tomcat without permission denied, there only root have no permission to do so. Any solutions? Thanks.
Vin Poh
  • 3
  • 1
0
votes
0 answers

Is there any way to implement stop() for Standalone Spring Boot application as a service/daemon?

I'd like to know how to implement stop() method as Apache Commons Daemon provides on Spring Boot. I read the related documentation from https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html, and it seems that the…
BG. KIM
  • 41
  • 1
  • 2
0
votes
1 answer

Python daemon starts correctly with init-script but fails on startup

I have some python daemons for raspberry pi applications running on startup with init-scripts. The init script runs fine from the console, starts and ends the background process correctly. The script was made autostart with sudo insserv…
Bernd Gewehr
  • 97
  • 1
  • 12
0
votes
0 answers

start-stop-daemon does not start java process

I am trying to execute this script with the "start" option: #!/bin/sh DESC="Jenkins CI Server" NAME=jenkins PIDFILE=$NAME.pid RUN_AS=alex COMMAND="/usr/bin/java" COMMAND_ARGS="-jar jenkins.war" d_start() { start-stop-daemon --start --verbose…
Alex
  • 871
  • 1
  • 8
  • 18
0
votes
1 answer

Run a php script as daemon on raspban

I wrote a working PHP script with an endless while (true) loop as a Websocket server. Could you help me with: starting the PHP script on boot ? start stop the PHP script via ssh ? I read about PHP endless loops running out of memory (ref) is there…
Escounda
  • 21
  • 5
0
votes
0 answers

How to turn a ls loop into different variables?

Let me redo my question: OK, newb here but here is what I am trying to do: I am trying to write an init script that pulls different config files and pass them into different variables. The END result is to have an init script that can start multiple…
E.Z.
  • 119
  • 2
  • 12
0
votes
1 answer

What is the proper way to terminate a script using start-stop-daemon?

I am using a start-stop-daemon to make a INIT script for my script. I am using --make-pidfile cause my script doesn't make its own pid. I can start my script using start and pid file generates with appropriate PID. But the stop function doesn't…
Kamrul Khan
  • 2,940
  • 4
  • 24
  • 48
0
votes
1 answer

start-stop-daemon doesn't detect already running daemon

I tried to copy /etc/init.d/skeleton and modify it to start a program in background. I came up with the following: do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not…
timakro
  • 1,571
  • 12
  • 27
0
votes
0 answers

start-stop-daemon and javaFX program

this is driving me crazy, please could you help with the start-stop-daemon to start a javafx jar file, where I need to issue the following command to start it sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp…
Ossama
  • 2,169
  • 5
  • 38
  • 70
0
votes
1 answer

python daemon not calling other python script

I am using python daemon to check a particular table in mongodb if there is any value it should call another python script. Below is the code what I am trying, but it doesn't call the script. can somebody help me out: import daemon import…
Abhilash Kumar
  • 211
  • 1
  • 8