From e37eae55b81207c5be5937764b78017550e4068a Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Thu, 19 Jul 2018 13:57:03 -0400 Subject: [PATCH 1/2] Add PIDFile to the .service file. This will cause systemd to delete the lock file when the service terminates. This does not do anything if lorax-composer is started on the command line, however. --- systemd/lorax-composer.service | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd/lorax-composer.service b/systemd/lorax-composer.service index 2c6a3428..ab381648 100644 --- a/systemd/lorax-composer.service +++ b/systemd/lorax-composer.service @@ -6,6 +6,7 @@ Wants=network-online.target [Service] User=root Type=simple +PIDFile=/run/lorax-composer.pid ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/lorax-composer.conf ExecStart=/usr/sbin/lorax-composer /var/lib/lorax/composer/blueprints/ From 052828047c1bd66fe660e8a811cd97b6fa7f355a Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Thu, 19 Jul 2018 14:53:32 -0400 Subject: [PATCH 2/2] Document that you shouldn't run lorax-composer twice. --- docs/lorax-composer.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/lorax-composer.rst b/docs/lorax-composer.rst index ae1155ab..69dcc24e 100644 --- a/docs/lorax-composer.rst +++ b/docs/lorax-composer.rst @@ -43,8 +43,13 @@ Quickstart 2. Remove any pre-existing socket directory with ``rm -rf /run/weldr/`` A new directory with correct permissions will be created the first time the server runs. 3. Enable the socket activation with ``systemctl enable lorax-composer.socket - && sudo systemctl start lorax-composer.socket`` or run it directly with - ``lorax-composer /path/to/blueprints/`` + && sudo systemctl start lorax-composer.socket``. + +NOTE: You can also run it directly with ``lorax-composer /path/to/blueprints``. However, +``lorax-composer`` does not react well to being started both on the command line and via +socket activation at the same time. It is therefore recommended that you run it directly +on the command line only for testing or development purposes. For real use or development +of other projects that simply use the API, you should stick to socket activation only. The ``/path/to/blueprints/`` directory is where the blueprints' git repo will be created, and all the blueprints created with the ``/api/v0/blueprints/new``