diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 183713eaee..f2c36edcc3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -111,6 +111,9 @@ Added * Add python 3.10 and 3.11 to the GitHub Actions test matrix. Contributed by @nzlosh, @guzzijones12, and @cognifloyd +* Copy systemd files from st2-packages.git for future packaging via pants. #6303 + Cherry-picked by @cognifloyd + 3.8.1 - December 13, 2023 ------------------------- Fixed diff --git a/packaging/common/systemd/st2api-generator b/packaging/common/systemd/st2api-generator new file mode 100755 index 0000000000..ae6d2e7eed --- /dev/null +++ b/packaging/common/systemd/st2api-generator @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +import configparser +import logging +import time +import sys + +ST2SVC = "st2api" +DEFAULT_IP = "127.0.0.1" +DEFAULT_PORT = "9101" +ST2CFG = "/etc/st2/st2.conf" + +# Systemd passes 3 paths to a generator, normal_dir, early_dir, late_dir. +default_paths = ["/tmp", "/tmp", "/tmp"] +for i, p in enumerate(sys.argv[1:]): + default_paths[i] = p +EARLY_DIR, NORMAL_DIR, LATE_DIR = default_paths + +LOG_TO_DISK = True +LOG_KW = { + "level": logging.DEBUG, + "format": "%(asctime)s - %(levelname)s - %(message)s", +} +if LOG_TO_DISK: + LOG_KW["filename"] = f"{NORMAL_DIR}/{ST2SVC}_generator.log" + +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() + +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser(strict=False) +config.read(ST2CFG) + +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) + +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service +SourcePath={ST2CFG} + +[Socket] +ListenStream={bind_address}:{bind_port} + +[Install] +WantedBy=sockets.target +""" + +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) + +LOG.info(f"{ST2SVC} generated.") diff --git a/packaging/common/systemd/st2auth-generator b/packaging/common/systemd/st2auth-generator new file mode 100755 index 0000000000..f1b017e99b --- /dev/null +++ b/packaging/common/systemd/st2auth-generator @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +import configparser +import logging +import time +import sys + +ST2SVC="st2auth" +DEFAULT_IP="127.0.0.1" +DEFAULT_PORT="9100" +ST2CFG = "/etc/st2/st2.conf" + +# Systemd passes 3 paths to a generator, normal_dir, early_dir, late_dir. +default_paths = ["/tmp", "/tmp", "/tmp"] +for i, p in enumerate(sys.argv[1:]): + default_paths[i] = p +EARLY_DIR, NORMAL_DIR, LATE_DIR = default_paths + +LOG_TO_DISK = True +LOG_KW = { + "level": logging.DEBUG, + "format": "%(asctime)s - %(levelname)s - %(message)s", +} +if LOG_TO_DISK: + LOG_KW["filename"] = f"{NORMAL_DIR}/{ST2SVC}_generator.log" + +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() + +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser(strict=False) +config.read(ST2CFG) + +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) + +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service +SourcePath={ST2CFG} + +[Socket] +ListenStream={bind_address}:{bind_port} + +[Install] +WantedBy=sockets.target +""" + +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) + +LOG.info(f"{ST2SVC} generated.") diff --git a/packaging/common/systemd/st2stream-generator b/packaging/common/systemd/st2stream-generator new file mode 100755 index 0000000000..e7d82e0f44 --- /dev/null +++ b/packaging/common/systemd/st2stream-generator @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +import configparser +import logging +import time +import sys + +ST2SVC="st2stream" +DEFAULT_IP="127.0.0.1" +DEFAULT_PORT="9102" +ST2CFG = "/etc/st2/st2.conf" + +# Systemd passes 3 paths to a generator, normal_dir, early_dir, late_dir. +default_paths = ["/tmp", "/tmp", "/tmp"] +for i, p in enumerate(sys.argv[1:]): + default_paths[i] = p +EARLY_DIR, NORMAL_DIR, LATE_DIR = default_paths + +LOG_TO_DISK = True +LOG_KW = { + "level": logging.DEBUG, + "format": "%(asctime)s - %(levelname)s - %(message)s", +} +if LOG_TO_DISK: + LOG_KW["filename"] = f"{NORMAL_DIR}/{ST2SVC}_generator.log" + +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() + +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser(strict=False) +config.read(ST2CFG) + +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) + +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service +SourcePath={ST2CFG} + +[Socket] +ListenStream={bind_address}:{bind_port} + +[Install] +WantedBy=sockets.target +""" + +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) + +LOG.info(f"{ST2SVC} generated.") diff --git a/packaging/deb/systemd/st2actionrunner.service b/packaging/deb/systemd/st2actionrunner.service new file mode 100644 index 0000000000..e0db64250b --- /dev/null +++ b/packaging/deb/systemd/st2actionrunner.service @@ -0,0 +1,14 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target + +[Service] +Type=oneshot +EnvironmentFile=-/etc/default/st2actionrunner +ExecStart=/bin/bash /opt/stackstorm/st2/bin/runners.sh start +ExecStop=/bin/bash /opt/stackstorm/st2/bin/runners.sh stop +PrivateTmp=true +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2actionrunner@.service b/packaging/deb/systemd/st2actionrunner@.service new file mode 100644 index 0000000000..f77a8707d4 --- /dev/null +++ b/packaging/deb/systemd/st2actionrunner@.service @@ -0,0 +1,21 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target +JoinsNamespaceOf=st2actionrunner.service + +[Service] +Type=simple +User=root +Group=st2packs +UMask=002 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +Environment="WORKERID=%i" +EnvironmentFile=-/etc/default/st2actionrunner +ExecStart=/opt/stackstorm/st2/bin/st2actionrunner $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2api.service b/packaging/deb/systemd/st2api.service new file mode 100644 index 0000000000..1921126db6 --- /dev/null +++ b/packaging/deb/systemd/st2api.service @@ -0,0 +1,19 @@ +[Unit] +Description=StackStorm service st2api +After=network.target st2api.socket +Requires=st2api.socket + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.api.gunicorn.conf --error-logfile /var/log/st2/st2api.log" +EnvironmentFile=-/etc/default/st2api +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2auth.service b/packaging/deb/systemd/st2auth.service new file mode 100644 index 0000000000..54420192f8 --- /dev/null +++ b/packaging/deb/systemd/st2auth.service @@ -0,0 +1,19 @@ +[Unit] +Description=StackStorm service st2auth +After=network.target st2auth.socket +Requires=st2auth.socket + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.auth.gunicorn.conf --error-logfile /var/log/st2/st2auth.log" +EnvironmentFile=-/etc/default/st2auth +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2garbagecollector.service b/packaging/deb/systemd/st2garbagecollector.service new file mode 100644 index 0000000000..5d3061534a --- /dev/null +++ b/packaging/deb/systemd/st2garbagecollector.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2garbagecollector +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/default/st2garbagecollector +ExecStart=/opt/stackstorm/st2/bin/st2garbagecollector $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2notifier.service b/packaging/deb/systemd/st2notifier.service new file mode 100644 index 0000000000..31df3f3411 --- /dev/null +++ b/packaging/deb/systemd/st2notifier.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2notifier +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/default/st2notifier +ExecStart=/opt/stackstorm/st2/bin/st2notifier $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2rulesengine.service b/packaging/deb/systemd/st2rulesengine.service new file mode 100644 index 0000000000..5747154368 --- /dev/null +++ b/packaging/deb/systemd/st2rulesengine.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2rulesengine +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/default/st2rulesengine +ExecStart=/opt/stackstorm/st2/bin/st2rulesengine $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2scheduler.service b/packaging/deb/systemd/st2scheduler.service new file mode 100644 index 0000000000..ff87ab9e3a --- /dev/null +++ b/packaging/deb/systemd/st2scheduler.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2scheduler +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/default/st2scheduler +ExecStart=/opt/stackstorm/st2/bin/st2scheduler $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2sensorcontainer.service b/packaging/deb/systemd/st2sensorcontainer.service new file mode 100644 index 0000000000..67ec0898b6 --- /dev/null +++ b/packaging/deb/systemd/st2sensorcontainer.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2sensorcontainer +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/default/st2sensorcontainer +ExecStart=/opt/stackstorm/st2/bin/st2sensorcontainer $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2stream.service b/packaging/deb/systemd/st2stream.service new file mode 100644 index 0000000000..ade3ba5ddd --- /dev/null +++ b/packaging/deb/systemd/st2stream.service @@ -0,0 +1,19 @@ +[Unit] +Description=StackStorm service st2stream +After=network.target st2stream.socket +Requires=st2stream.socket + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9102 --workers 1 --threads 10 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.stream.gunicorn.conf --error-logfile /var/log/st2/st2stream.log" +EnvironmentFile=-/etc/default/st2stream +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2timersengine.service b/packaging/deb/systemd/st2timersengine.service new file mode 100644 index 0000000000..768b07f30a --- /dev/null +++ b/packaging/deb/systemd/st2timersengine.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2timersengine +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/default/st2timersengine +ExecStart=/opt/stackstorm/st2/bin/st2timersengine $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/deb/systemd/st2workflowengine.service b/packaging/deb/systemd/st2workflowengine.service new file mode 100644 index 0000000000..5c9c96733a --- /dev/null +++ b/packaging/deb/systemd/st2workflowengine.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2workflowengine +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/default/st2workflowengine +ExecStart=/opt/stackstorm/st2/bin/st2workflowengine $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2actionrunner.service b/packaging/rpm/systemd/st2actionrunner.service new file mode 100644 index 0000000000..5d4f4e43e3 --- /dev/null +++ b/packaging/rpm/systemd/st2actionrunner.service @@ -0,0 +1,14 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target + +[Service] +Type=oneshot +EnvironmentFile=-/etc/sysconfig/st2actionrunner +ExecStart=/bin/bash /opt/stackstorm/st2/bin/runners.sh start +ExecStop=/bin/bash /opt/stackstorm/st2/bin/runners.sh stop +PrivateTmp=true +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2actionrunner@.service b/packaging/rpm/systemd/st2actionrunner@.service new file mode 100644 index 0000000000..2e1e971f41 --- /dev/null +++ b/packaging/rpm/systemd/st2actionrunner@.service @@ -0,0 +1,21 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target +JoinsNamespaceOf=st2actionrunner.service + +[Service] +Type=simple +User=root +Group=st2packs +UMask=002 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +Environment="WORKERID=%i" +EnvironmentFile=-/etc/sysconfig/st2actionrunner +ExecStart=/opt/stackstorm/st2/bin/st2actionrunner $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2api.service b/packaging/rpm/systemd/st2api.service new file mode 100644 index 0000000000..1b59b9b9c9 --- /dev/null +++ b/packaging/rpm/systemd/st2api.service @@ -0,0 +1,19 @@ +[Unit] +Description=StackStorm service st2api +After=network.target st2api.socket +Requires=st2api.socket + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.api.gunicorn.conf --error-logfile /var/log/st2/st2api.log" +EnvironmentFile=-/etc/sysconfig/st2api +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2auth.service b/packaging/rpm/systemd/st2auth.service new file mode 100644 index 0000000000..260a785365 --- /dev/null +++ b/packaging/rpm/systemd/st2auth.service @@ -0,0 +1,19 @@ +[Unit] +Description=StackStorm service st2auth +After=network.target st2auth.socket +Requires=st2auth.socket + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.auth.gunicorn.conf --error-logfile /var/log/st2/st2auth.log" +EnvironmentFile=-/etc/sysconfig/st2auth +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2garbagecollector.service b/packaging/rpm/systemd/st2garbagecollector.service new file mode 100644 index 0000000000..62ff423930 --- /dev/null +++ b/packaging/rpm/systemd/st2garbagecollector.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2garbagecollector +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2garbagecollector +ExecStart=/opt/stackstorm/st2/bin/st2garbagecollector $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2notifier.service b/packaging/rpm/systemd/st2notifier.service new file mode 100644 index 0000000000..d0f098955d --- /dev/null +++ b/packaging/rpm/systemd/st2notifier.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2notifier +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2notifier +ExecStart=/opt/stackstorm/st2/bin/st2notifier $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2rulesengine.service b/packaging/rpm/systemd/st2rulesengine.service new file mode 100644 index 0000000000..c2ae7b0bee --- /dev/null +++ b/packaging/rpm/systemd/st2rulesengine.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2rulesengine +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2rulesengine +ExecStart=/opt/stackstorm/st2/bin/st2rulesengine $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2scheduler.service b/packaging/rpm/systemd/st2scheduler.service new file mode 100644 index 0000000000..725b46832b --- /dev/null +++ b/packaging/rpm/systemd/st2scheduler.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2scheduler +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2scheduler +ExecStart=/opt/stackstorm/st2/bin/st2scheduler $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2sensorcontainer.service b/packaging/rpm/systemd/st2sensorcontainer.service new file mode 100644 index 0000000000..d4f0674436 --- /dev/null +++ b/packaging/rpm/systemd/st2sensorcontainer.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2sensorcontainer +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2sensorcontainer +ExecStart=/opt/stackstorm/st2/bin/st2sensorcontainer $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2stream.service b/packaging/rpm/systemd/st2stream.service new file mode 100644 index 0000000000..742cc20384 --- /dev/null +++ b/packaging/rpm/systemd/st2stream.service @@ -0,0 +1,19 @@ +[Unit] +Description=StackStorm service st2stream +After=network.target st2stream.socket +Requires=st2stream.socket + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9102 --workers 1 --threads 10 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.stream.gunicorn.conf --error-logfile /var/log/st2/st2stream.log" +EnvironmentFile=-/etc/sysconfig/st2stream +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2timersengine.service b/packaging/rpm/systemd/st2timersengine.service new file mode 100644 index 0000000000..f48606a710 --- /dev/null +++ b/packaging/rpm/systemd/st2timersengine.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2timersengine +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2timersengine +ExecStart=/opt/stackstorm/st2/bin/st2timersengine $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packaging/rpm/systemd/st2workflowengine.service b/packaging/rpm/systemd/st2workflowengine.service new file mode 100644 index 0000000000..537c20ddd9 --- /dev/null +++ b/packaging/rpm/systemd/st2workflowengine.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2workflowengine +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2workflowengine +ExecStart=/opt/stackstorm/st2/bin/st2workflowengine $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target