From 9fa7de3780ebfd5281775bf0dec125c17d7a12d9 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Fri, 22 Jan 2021 10:23:51 -0500 Subject: [PATCH] LP#1912796: include systemd installation instructions in OpenSRF installation docs. Create an example systemd unit file that can be copied into place and update the README with those instructions. Signed-off-by: Chris Sharp Signed-off-by: Josh Stompro --- README | 16 ++++++++++++++++ examples/websocketd-osrf.service.example | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 examples/websocketd-osrf.service.example diff --git a/README b/README index 73eea14..a1af0ef 100644 --- a/README +++ b/README @@ -493,6 +493,22 @@ sudo -b /usr/local/bin/websocketd --port 7682 --ssl --sslcert=/etc/apache2/ssl/s --sslkey=/etc/apache2/ssl/server.key /openils/bin/osrf-websocket-stdio --------------------------------------------------------------------------- +Optional Systemd Setup +~~~~~~~~~~~~~~~~~~~~~~ + +Websocketd is a standalone program with no daemon mode, but can be implemented as a systemd service. + +Copy /examples/websocket-osrf.service.example into file /lib/systemd/system/websocketd-osrf.service + +Then add & start the service. + +[source,bash] +-------------------------------------- +sudo systemctl daemon-reload +sudo systemctl enable websocketd-osrf +sudo systemctl start websocketd-osrf +-------------------------------------- + Optional: Using a web proxy (Apache 2.4 and above) -------------------------------------------------- When the OpenSRF HTTP Translator runs behind a proxy, Apache must be diff --git a/examples/websocketd-osrf.service.example b/examples/websocketd-osrf.service.example new file mode 100644 index 0000000..18ce640 --- /dev/null +++ b/examples/websocketd-osrf.service.example @@ -0,0 +1,17 @@ +[Unit] +Description=Websocketd OpenSRF Gateway + +[Service] +Type=simple +User=opensrf +Group=opensrf +Environment=PATH=/openils/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +Environment=LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH +ExecStart=/usr/local/bin/websocketd --loglevel error --maxforks 250 --port 7682 /openils/bin/osrf-websocket-stdio + +# modify websocketd command line options to taste +# --sameorigin and --origin=domain1,domain2 flags are also supported for security. + +# On Ubuntu 18.04+, you may also need to include something like this: +[Install] +WantedBy=multi-user.target -- 2.11.0