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

Run "launchctl" command under specific user using NSTask in OS X

My application is launching under root and I need to be able to unload processes using NSTask and launchctl Here is a code I do: NSPipe *pipe = [NSPipe pipe]; NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:…
Serhii
  • 1,742
  • 2
  • 25
  • 54
5
votes
2 answers

How to supervise a webserver with daemontools?

How should I script daemontools superviser? I've started to use D. J. Bernsteins' daemontools to keep some processes running and is working fine. But now I need to monitor a couple of additional conditions on those processes and I've failed to find…
pauel
  • 876
  • 10
  • 26
4
votes
1 answer

Starting multiple celery daemons automatically using Jenkins

I have an Ubuntu server set up with 5 different django sites running on it. These are used for testing, so each developer has their own site and database as well as one site for integrated code which is only updated when features are ready. …
mpdaugherty
  • 999
  • 6
  • 19
4
votes
1 answer

Odoo service restart and update using systemctl

Odoo service is started by systemctl start odoo. I am usin Centos. When I want to update my changed *.py code I used to do like this: 1. systemctl stop odoo Then I update my module and database by useing this: 2. ./odoo.py -c openerp-server.conf -u…
fueggit
  • 807
  • 20
  • 41
4
votes
4 answers

Ansible cannot make dir /$HOME/.ansible/cp

I'm getting a very strange error when I run ansible: GATHERING FACTS *************************************************************** fatal: [i-0f55b6a4] => Could not make dir /$HOME/.ansible/cp: [Errno 13] Permission denied: '/$HOME' TASK: [Task…
FrustratedWithFormsDesigner
  • 25,116
  • 30
  • 128
  • 188
4
votes
2 answers

Start & Stop a ScheduledExecutorService in Java EE environment using servlet

We have a requirement where in we need to monitor remote JVM details via JMX using a simple servlet application. So things done till now in a standalone application is 1) Creat a JMX connector & get the Memory data --> done 2) We need to constantly…
3
votes
2 answers

Puma does not start after server reboot

I deployed project with capistrano, but puma does not start after server reboot.. I shoul do -> cap production puma:start every time I tried it: /etc/init.d/myscript #!/bin/sh /etc/init.d/puma_start.sh puma_start.sh #!/bin/bash puma -C…
3
votes
2 answers

Ubuntu upstart will hang on start/stop/etc

I've got a several services on Ubuntu which will start using 'upstart'. They are working as requested, but when I use 'stop/start/restart {myservice}' it will hang (but WILL do as requested). I understand it has something to do with forking. My…
3
votes
1 answer

init.d: starting mplayer via "start-stop-daemon"

with an Ubuntu machine I'd like to run MPlayer like a daemon. In foreground the following configuration is exactly what I need: mplayer -slave -idle -input file=/tmp/mplayercontrol. Now, I wrote the following script: # /etc/init.d/mplayerd ### BEGIN…
Fabio Mora
  • 4,939
  • 2
  • 16
  • 30
3
votes
1 answer

start-stop-daemon and Valgrind

I use start-stop-daemon to start up programs and would like to use it together with Valgrind. This is how I use start-stop-daemon: start-stop-daemon --start --background --exec ${BINPATH}/myPgm -- myPgm This is how I use Valgrind on a standalone…
3
votes
4 answers

How can I redirect process output from a process started with start-stop-daemon on Debian?

There are several questions about this already but none of them seem to work. I have a production system that is currently down and I need to be able to get the stderr output from the daemon quickly to debug it. I thought I could just redirect the…
Pryo
  • 650
  • 1
  • 9
  • 24
3
votes
3 answers

Cannot start mongodb multiple times when using start-stop-daemon?

I've always been testing replicasets by starting multiple mongod processes on the same server (because using multiple serves is more expensive, and I'm merely testing at this point). However, since I've updated mongo to version v2.0.5 I'm getting…
Tom
  • 8,437
  • 26
  • 122
  • 217
2
votes
2 answers

why "systemctl" not working in Ubuntu terminal on Windows?

I need to reload the daemon using systemctl command in ubuntu terminal on window 10. I attached the error I received. Please Help me on this. error: bashdos@yana:~$ systemctl System has not been booted with systemd as init system (PID 1). Can't…
2
votes
2 answers

start-stop-daemon works at command line but doesn't work in /etc/init.d script

I'm trying to get a starter script (for a ruby gem called ar_sendmail) working in /etc/init.d/ar_sendmail: #! /bin/sh echo "in…
Max Williams
  • 30,785
  • 29
  • 115
  • 186
2
votes
2 answers

RHEL7 systemd start mongo services automatically?

I have a RHEL7 server that is part of a Mongo cluster. There are three mongo processes that I would like to be automatically started on system boot. One mongod, one arbiter and one mongos: /usr/bin/mongod -f /etc/mongo_shard001.conf /usr/bin/mongod…
stackoverflows
  • 169
  • 4
  • 16