aboutsummaryrefslogtreecommitdiff
path: root/docs/tools
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2021-03-02 14:27:46 +0000
committerKevin Wolf <kwolf@redhat.com>2021-03-08 14:55:18 +0100
commit03d2b412aaf2078425f8472f31c8a9c2340969eb (patch)
tree94d0ec5597e49cc40830a26ed495356daab374bd /docs/tools
parent501a4b3681c90bbcf610fbbd6335c26af30668d7 (diff)
downloadqemu-03d2b412aaf2078425f8472f31c8a9c2340969eb.zip
qemu-03d2b412aaf2078425f8472f31c8a9c2340969eb.tar.gz
qemu-03d2b412aaf2078425f8472f31c8a9c2340969eb.tar.bz2
qemu-storage-daemon: add --pidfile option
Daemons often have a --pidfile option where the pid is written to a file so that scripts can stop the daemon by sending a signal. The pid file also acts as a lock to prevent multiple instances of the daemon from launching for a given pid file. QEMU, qemu-nbd, qemu-ga, virtiofsd, and qemu-pr-helper all support the --pidfile option. Add it to qemu-storage-daemon too. Reported-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20210302142746.170535-1-stefanha@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'docs/tools')
-rw-r--r--docs/tools/qemu-storage-daemon.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/tools/qemu-storage-daemon.rst b/docs/tools/qemu-storage-daemon.rst
index c05b3d3..6ce85f2 100644
--- a/docs/tools/qemu-storage-daemon.rst
+++ b/docs/tools/qemu-storage-daemon.rst
@@ -118,6 +118,20 @@ Standard options:
List object properties with ``<type>,help``. See the :manpage:`qemu(1)`
manual page for a description of the object properties.
+.. option:: --pidfile PATH
+
+ is the path to a file where the daemon writes its pid. This allows scripts to
+ stop the daemon by sending a signal::
+
+ $ kill -SIGTERM $(<path/to/qsd.pid)
+
+ A file lock is applied to the file so only one instance of the daemon can run
+ with a given pid file path. The daemon unlinks its pid file when terminating.
+
+ The pid file is written after chardevs, exports, and NBD servers have been
+ created but before accepting connections. The daemon has started successfully
+ when the pid file is written and clients may begin connecting.
+
Examples
--------
Launch the daemon with QMP monitor socket ``qmp.sock`` so clients can execute