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
2
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…
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
  • 32,435
  • 31
  • 130
  • 197
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…
2
votes
1 answer

custom linux daemon won't stop using "service stop"

I've written a custom python daemon that runs as a service via an init.d script on ubuntu 14.04. Starting the service works fine, but when I try to do "service monitor stop", the daemon is not terminated. I'm using pyinotify to daemonize a file…
R. W.
  • 357
  • 1
  • 5
  • 9
2
votes
1 answer

start-stop-daemon: pass arguments to application (vertx)

I'm trying to build an upstart configuration that's used in combination with monit. I'd like to pass some arguments to vertx as well (multiple instances of the verticle), but I'm failing to get a proper statement on the shell already, so I think…
DoNuT
  • 463
  • 1
  • 7
  • 23
2
votes
1 answer

LD_PRELOAD which program is target

Is there a way to figure out which program is the one being targeted by a LD_PRELOAD? LD_PRELOAD=/path/to/libstuff.so ./stuff Like when building the libstuff library in C/C++ and when it's preloaded is there a way to figure out that the…
vlieger
  • 25
  • 3
2
votes
2 answers

can't run Daemon::Control perl script as root. @INC not correct (perlbrew)

I've written a Daemon::Control script in perl, which I can start/stop as a service from the user, but now I want to have this run on reboot. When I run as a user all is well, when I run it as root, it fails with Can't locate Mojo/Server/Morbo.pm in…
2
votes
1 answer

Launching command using NSTask returns error

I'd like to launch the following command from my application using NSTask: sudo -u myusername launchctl load /Library/LaunchAgents/com.google.keystone.agent.plist Here is a code I do: NSPipe *pipe = [NSPipe pipe]; NSTask *task = [[NSTask…
Serge
  • 2,031
  • 3
  • 33
  • 56
2
votes
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
  • 3,466
  • 3
  • 22
  • 33
2
votes
1 answer

daemon refusing to execute unsafe program

I want to start a service after my system start, here's my script in /etc/rc.local : daemon /usr/bin/python /usr/local/google/home/yowang/Downloads/ftp.py > /var/log/pyftpd.log 2>&1 Error output at /var/log/pyftpd.log looks like this: daemon:…
WoooHaaaa
  • 19,732
  • 32
  • 90
  • 138
2
votes
1 answer

How to get a python daemon to perform an action on stop

Using code I found here to implement a simple daemon, I'm wondering if there is any way for me to get the daemon to perform an action just before being stopped. The idea is that in my script, I'm using a serial connection to an external device, and…
gromain
  • 222
  • 3
  • 11
1
vote
1 answer

How to redirect the daemon output to pipe with BusyBox's start-stop-daemon?

In my development environment which is an Ubuntu 20.04, the start-stop-daemon tool has the -C --no-close option to prevent closing any file descriptor in use. Using that option I can redirect the output of any program to a pipe as…
Caglayan DOKME
  • 948
  • 8
  • 21
1
vote
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
  • 117
  • 2
  • 11
1
vote
4 answers

Why didn't my init.d start-stop-daemon script start the application on boot, but I can start the service manually?

I thought I finally had managed to write my first init.d script properly but when I went to reboot, the launch didn't happen. The script start-foo looks like this: #! /bin/sh # chkconfig 345 85 60 # description: startup script for foo # processname:…
Kit Sunde
  • 35,972
  • 25
  • 125
  • 179
1
vote
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. The error: bashdos@yana:~$ systemctl System has not been booted with systemd as init system (PID 1). Can't operate.