From 18aabe85d547f517733f4e362e96e935620c9f8c Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Thu, 20 Aug 2015 23:02:32 +0300 Subject: [PATCH 01/50] st2api includes systemd unit Cherry-picked from StackStorm/st2-packages@b574093443cda3256f4ccbdb4731e561f91daeb7 --- sources/st2api/rpm/st2api.service | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/st2api/rpm/st2api.service diff --git a/sources/st2api/rpm/st2api.service b/sources/st2api/rpm/st2api.service new file mode 100644 index 0000000000..5e428d8f9e --- /dev/null +++ b/sources/st2api/rpm/st2api.service @@ -0,0 +1,16 @@ +[Unit] +Description=StackStorm service st2api +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +ExecStart=/usr/bin/st2api --config-file /etc/st2/st2.conf +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From fdafacdd7bcf3a9178170bbdb90c66f9332fca3b Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Tue, 25 Aug 2015 18:47:17 +0300 Subject: [PATCH 02/50] st2actions with all system services Cherry-picked from StackStorm/st2-packages@abd7ddecf0062ea04ec5dd6b9ff599ca52b63323 --- sources/st2actions/rpm/st2actionrunner.service | 13 +++++++++++++ .../st2actions/rpm/st2actionrunner@.service | 17 +++++++++++++++++ sources/st2actions/rpm/st2notifier.service | 18 ++++++++++++++++++ sources/st2auth/rpm/st2auth.service | 18 ++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 sources/st2actions/rpm/st2actionrunner.service create mode 100644 sources/st2actions/rpm/st2actionrunner@.service create mode 100644 sources/st2actions/rpm/st2notifier.service create mode 100644 sources/st2auth/rpm/st2auth.service diff --git a/sources/st2actions/rpm/st2actionrunner.service b/sources/st2actions/rpm/st2actionrunner.service new file mode 100644 index 0000000000..e9028990cb --- /dev/null +++ b/sources/st2actions/rpm/st2actionrunner.service @@ -0,0 +1,13 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target + +[Service] +Type=oneshot +EnvironmentFile=-/etc/sysconfig/st2actionrunner +ExecStart=/bin/bash /usr/share/python/st2actions/bin/runners.sh start +ExecStop=/bin/bash /usr/share/python/st2actions/bin/runners.sh start stop +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2actions/rpm/st2actionrunner@.service b/sources/st2actions/rpm/st2actionrunner@.service new file mode 100644 index 0000000000..8410ea6152 --- /dev/null +++ b/sources/st2actions/rpm/st2actionrunner@.service @@ -0,0 +1,17 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target + +[Service] +Type=simple +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +Environment="WORKERID=%i" +EnvironmentFile=-/etc/sysconfig/st2actionrunner +ExecStart=/usr/bin/st2actionrunner $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2actions/rpm/st2notifier.service b/sources/st2actions/rpm/st2notifier.service new file mode 100644 index 0000000000..9787c9a246 --- /dev/null +++ b/sources/st2actions/rpm/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=/usr/bin/st2notifier $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2auth/rpm/st2auth.service b/sources/st2auth/rpm/st2auth.service new file mode 100644 index 0000000000..c007c4d404 --- /dev/null +++ b/sources/st2auth/rpm/st2auth.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2auth +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=/etc/sysconfig/st2notifier +ExecStart=/usr/bin/st2auth ${DAEMON_ARGS} +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From 025daaf7d42efcf08e4542e5849aa50faa43b714 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Tue, 25 Aug 2015 22:45:21 +0300 Subject: [PATCH 03/50] finalizing rpm packages specs Cherry-picked from StackStorm/st2-packages@7bded3b38267cd6e11bbd84db79eb0693de4e90f --- sources/st2actions/rpm/st2actionrunner.service | 2 +- sources/st2api/rpm/st2api.service | 4 +++- sources/st2auth/rpm/st2auth.service | 4 ++-- sources/st2reactor/rpm/st2reactor.service | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 sources/st2reactor/rpm/st2reactor.service diff --git a/sources/st2actions/rpm/st2actionrunner.service b/sources/st2actions/rpm/st2actionrunner.service index e9028990cb..29e0bb356c 100644 --- a/sources/st2actions/rpm/st2actionrunner.service +++ b/sources/st2actions/rpm/st2actionrunner.service @@ -6,7 +6,7 @@ After=network.target Type=oneshot EnvironmentFile=-/etc/sysconfig/st2actionrunner ExecStart=/bin/bash /usr/share/python/st2actions/bin/runners.sh start -ExecStop=/bin/bash /usr/share/python/st2actions/bin/runners.sh start stop +ExecStop=/bin/bash /usr/share/python/st2actions/bin/runners.sh stop RemainAfterExit=true [Install] diff --git a/sources/st2api/rpm/st2api.service b/sources/st2api/rpm/st2api.service index 5e428d8f9e..4e1b10d1fe 100644 --- a/sources/st2api/rpm/st2api.service +++ b/sources/st2api/rpm/st2api.service @@ -6,7 +6,9 @@ After=network.target Type=simple User=st2 Group=st2 -ExecStart=/usr/bin/st2api --config-file /etc/st2/st2.conf +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2api +ExecStart=/usr/bin/st2api $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/sources/st2auth/rpm/st2auth.service b/sources/st2auth/rpm/st2auth.service index c007c4d404..f950da23e6 100644 --- a/sources/st2auth/rpm/st2auth.service +++ b/sources/st2auth/rpm/st2auth.service @@ -7,8 +7,8 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=/etc/sysconfig/st2notifier -ExecStart=/usr/bin/st2auth ${DAEMON_ARGS} +EnvironmentFile=-/etc/sysconfig/st2auth +ExecStart=/usr/bin/st2auth $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/sources/st2reactor/rpm/st2reactor.service b/sources/st2reactor/rpm/st2reactor.service new file mode 100644 index 0000000000..b4c15e79ed --- /dev/null +++ b/sources/st2reactor/rpm/st2reactor.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2reactor +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2reactor +ExecStart=/usr/bin/st2reactor $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From 166b587e8dcd9281a81f8f1f9dd474b2deb9ce3d Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Tue, 25 Aug 2015 23:37:51 +0300 Subject: [PATCH 04/50] removed linking of package services to /usr/bin Cherry-picked from StackStorm/st2-packages@b042223e10f9cd3178b41502e785db34b37f5d20 --- sources/st2actions/rpm/st2actionrunner@.service | 2 +- sources/st2actions/rpm/st2notifier.service | 2 +- sources/st2api/rpm/st2api.service | 2 +- sources/st2auth/rpm/st2auth.service | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/st2actions/rpm/st2actionrunner@.service b/sources/st2actions/rpm/st2actionrunner@.service index 8410ea6152..25187d3962 100644 --- a/sources/st2actions/rpm/st2actionrunner@.service +++ b/sources/st2actions/rpm/st2actionrunner@.service @@ -7,7 +7,7 @@ Type=simple Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" Environment="WORKERID=%i" EnvironmentFile=-/etc/sysconfig/st2actionrunner -ExecStart=/usr/bin/st2actionrunner $DAEMON_ARGS +ExecStart=/usr/share/python/st2actions/bin/st2actionrunner $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/sources/st2actions/rpm/st2notifier.service b/sources/st2actions/rpm/st2notifier.service index 9787c9a246..57f9a51786 100644 --- a/sources/st2actions/rpm/st2notifier.service +++ b/sources/st2actions/rpm/st2notifier.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2notifier -ExecStart=/usr/bin/st2notifier $DAEMON_ARGS +ExecStart=/usr/share/python/st2actions/bin/st2notifier $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/sources/st2api/rpm/st2api.service b/sources/st2api/rpm/st2api.service index 4e1b10d1fe..e3d3c669e3 100644 --- a/sources/st2api/rpm/st2api.service +++ b/sources/st2api/rpm/st2api.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2api -ExecStart=/usr/bin/st2api $DAEMON_ARGS +ExecStart=/usr/share/python/st2api/bin/st2api $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/sources/st2auth/rpm/st2auth.service b/sources/st2auth/rpm/st2auth.service index f950da23e6..cf77b43ecf 100644 --- a/sources/st2auth/rpm/st2auth.service +++ b/sources/st2auth/rpm/st2auth.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/bin/st2auth $DAEMON_ARGS +ExecStart=/usr/share/python/st2auth/bin/st2auth $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure From 0ebb38d2d63e28ee6708795a40c13fadbd5e0a80 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Tue, 25 Aug 2015 23:36:04 +0300 Subject: [PATCH 05/50] reactor services fixed in rpm package Cherry-picked from StackStorm/st2-packages@79b460534d8f5ae4961c0dbb6b1a8a56763d977b --- ...2reactor.service => st2rulesengine.service} | 6 +++--- .../st2reactor/rpm/st2sensorcontainer.service | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) rename sources/st2reactor/rpm/{st2reactor.service => st2rulesengine.service} (58%) create mode 100644 sources/st2reactor/rpm/st2sensorcontainer.service diff --git a/sources/st2reactor/rpm/st2reactor.service b/sources/st2reactor/rpm/st2rulesengine.service similarity index 58% rename from sources/st2reactor/rpm/st2reactor.service rename to sources/st2reactor/rpm/st2rulesengine.service index b4c15e79ed..8319f19382 100644 --- a/sources/st2reactor/rpm/st2reactor.service +++ b/sources/st2reactor/rpm/st2rulesengine.service @@ -1,5 +1,5 @@ [Unit] -Description=StackStorm service st2reactor +Description=StackStorm service st2rulesengine After=network.target [Service] @@ -7,8 +7,8 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2reactor -ExecStart=/usr/bin/st2reactor $DAEMON_ARGS +EnvironmentFile=-/etc/sysconfig/st2rulesengine +ExecStart=/usr/share/python/st2reactor/bin/st2rulesengine $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/sources/st2reactor/rpm/st2sensorcontainer.service b/sources/st2reactor/rpm/st2sensorcontainer.service new file mode 100644 index 0000000000..0a054f13e5 --- /dev/null +++ b/sources/st2reactor/rpm/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=/usr/share/python/st2reactor/bin/st2sensorcontainer $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From de4ddfa85d475428f9b42a519675824c98059087 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Tue, 8 Sep 2015 16:57:48 +0300 Subject: [PATCH 06/50] added systemd services for rpm st2bundle Cherry-picked from StackStorm/st2-packages@941de2fedbac3ad332cab569cba716ff18d5e963 --- sources/st2bundle/rpm/st2actionrunner.service | 13 +++++++++++++ sources/st2bundle/rpm/st2actionrunner@.service | 17 +++++++++++++++++ sources/st2bundle/rpm/st2api.service | 18 ++++++++++++++++++ sources/st2bundle/rpm/st2auth.service | 18 ++++++++++++++++++ sources/st2bundle/rpm/st2notifier.service | 18 ++++++++++++++++++ sources/st2bundle/rpm/st2rulesengine.service | 18 ++++++++++++++++++ .../st2bundle/rpm/st2sensorcontainer.service | 18 ++++++++++++++++++ 7 files changed, 120 insertions(+) create mode 100644 sources/st2bundle/rpm/st2actionrunner.service create mode 100644 sources/st2bundle/rpm/st2actionrunner@.service create mode 100644 sources/st2bundle/rpm/st2api.service create mode 100644 sources/st2bundle/rpm/st2auth.service create mode 100644 sources/st2bundle/rpm/st2notifier.service create mode 100644 sources/st2bundle/rpm/st2rulesengine.service create mode 100644 sources/st2bundle/rpm/st2sensorcontainer.service diff --git a/sources/st2bundle/rpm/st2actionrunner.service b/sources/st2bundle/rpm/st2actionrunner.service new file mode 100644 index 0000000000..6122865223 --- /dev/null +++ b/sources/st2bundle/rpm/st2actionrunner.service @@ -0,0 +1,13 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target + +[Service] +Type=oneshot +EnvironmentFile=-/etc/sysconfig/st2actionrunner +ExecStart=/bin/bash /usr/share/python/st2/bin/runners.sh start +ExecStop=/bin/bash /usr/share/python/st2/bin/runners.sh stop +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2bundle/rpm/st2actionrunner@.service b/sources/st2bundle/rpm/st2actionrunner@.service new file mode 100644 index 0000000000..34ebfb2154 --- /dev/null +++ b/sources/st2bundle/rpm/st2actionrunner@.service @@ -0,0 +1,17 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target + +[Service] +Type=simple +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +Environment="WORKERID=%i" +EnvironmentFile=-/etc/sysconfig/st2actionrunner +ExecStart=/usr/share/python/st2/bin/st2actionrunner $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2bundle/rpm/st2api.service b/sources/st2bundle/rpm/st2api.service new file mode 100644 index 0000000000..fd01aaaf16 --- /dev/null +++ b/sources/st2bundle/rpm/st2api.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2api +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2api +ExecStart=/usr/share/python/st2/bin/st2api $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2bundle/rpm/st2auth.service b/sources/st2bundle/rpm/st2auth.service new file mode 100644 index 0000000000..3e06e59b44 --- /dev/null +++ b/sources/st2bundle/rpm/st2auth.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2auth +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" +EnvironmentFile=-/etc/sysconfig/st2auth +ExecStart=/usr/share/python/st2/bin/st2auth $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2bundle/rpm/st2notifier.service b/sources/st2bundle/rpm/st2notifier.service new file mode 100644 index 0000000000..093d879eaf --- /dev/null +++ b/sources/st2bundle/rpm/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=/usr/share/python/st2/bin/st2notifier $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2bundle/rpm/st2rulesengine.service b/sources/st2bundle/rpm/st2rulesengine.service new file mode 100644 index 0000000000..e625dd6177 --- /dev/null +++ b/sources/st2bundle/rpm/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=/usr/share/python/st2/bin/st2rulesengine $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/sources/st2bundle/rpm/st2sensorcontainer.service b/sources/st2bundle/rpm/st2sensorcontainer.service new file mode 100644 index 0000000000..b1bd224c96 --- /dev/null +++ b/sources/st2bundle/rpm/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=/usr/share/python/st2/bin/st2sensorcontainer $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From e10a5568a3e5bab6b3d4990cebd2b4c12754b670 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Thu, 10 Sep 2015 20:13:53 +0300 Subject: [PATCH 07/50] moving sources to st2 directory Cherry-picked from StackStorm/st2-packages@f2d180832150f457ced2adee9efd8a53ea52274b --- {sources => st2}/st2actions/rpm/st2actionrunner.service | 0 {sources => st2}/st2actions/rpm/st2actionrunner@.service | 0 {sources => st2}/st2actions/rpm/st2notifier.service | 0 {sources => st2}/st2api/rpm/st2api.service | 0 {sources => st2}/st2auth/rpm/st2auth.service | 0 {sources => st2}/st2bundle/rpm/st2actionrunner.service | 0 {sources => st2}/st2bundle/rpm/st2actionrunner@.service | 0 {sources => st2}/st2bundle/rpm/st2api.service | 0 {sources => st2}/st2bundle/rpm/st2auth.service | 0 {sources => st2}/st2bundle/rpm/st2notifier.service | 0 {sources => st2}/st2bundle/rpm/st2rulesengine.service | 0 {sources => st2}/st2bundle/rpm/st2sensorcontainer.service | 0 {sources => st2}/st2reactor/rpm/st2rulesengine.service | 0 {sources => st2}/st2reactor/rpm/st2sensorcontainer.service | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename {sources => st2}/st2actions/rpm/st2actionrunner.service (100%) rename {sources => st2}/st2actions/rpm/st2actionrunner@.service (100%) rename {sources => st2}/st2actions/rpm/st2notifier.service (100%) rename {sources => st2}/st2api/rpm/st2api.service (100%) rename {sources => st2}/st2auth/rpm/st2auth.service (100%) rename {sources => st2}/st2bundle/rpm/st2actionrunner.service (100%) rename {sources => st2}/st2bundle/rpm/st2actionrunner@.service (100%) rename {sources => st2}/st2bundle/rpm/st2api.service (100%) rename {sources => st2}/st2bundle/rpm/st2auth.service (100%) rename {sources => st2}/st2bundle/rpm/st2notifier.service (100%) rename {sources => st2}/st2bundle/rpm/st2rulesengine.service (100%) rename {sources => st2}/st2bundle/rpm/st2sensorcontainer.service (100%) rename {sources => st2}/st2reactor/rpm/st2rulesengine.service (100%) rename {sources => st2}/st2reactor/rpm/st2sensorcontainer.service (100%) diff --git a/sources/st2actions/rpm/st2actionrunner.service b/st2/st2actions/rpm/st2actionrunner.service similarity index 100% rename from sources/st2actions/rpm/st2actionrunner.service rename to st2/st2actions/rpm/st2actionrunner.service diff --git a/sources/st2actions/rpm/st2actionrunner@.service b/st2/st2actions/rpm/st2actionrunner@.service similarity index 100% rename from sources/st2actions/rpm/st2actionrunner@.service rename to st2/st2actions/rpm/st2actionrunner@.service diff --git a/sources/st2actions/rpm/st2notifier.service b/st2/st2actions/rpm/st2notifier.service similarity index 100% rename from sources/st2actions/rpm/st2notifier.service rename to st2/st2actions/rpm/st2notifier.service diff --git a/sources/st2api/rpm/st2api.service b/st2/st2api/rpm/st2api.service similarity index 100% rename from sources/st2api/rpm/st2api.service rename to st2/st2api/rpm/st2api.service diff --git a/sources/st2auth/rpm/st2auth.service b/st2/st2auth/rpm/st2auth.service similarity index 100% rename from sources/st2auth/rpm/st2auth.service rename to st2/st2auth/rpm/st2auth.service diff --git a/sources/st2bundle/rpm/st2actionrunner.service b/st2/st2bundle/rpm/st2actionrunner.service similarity index 100% rename from sources/st2bundle/rpm/st2actionrunner.service rename to st2/st2bundle/rpm/st2actionrunner.service diff --git a/sources/st2bundle/rpm/st2actionrunner@.service b/st2/st2bundle/rpm/st2actionrunner@.service similarity index 100% rename from sources/st2bundle/rpm/st2actionrunner@.service rename to st2/st2bundle/rpm/st2actionrunner@.service diff --git a/sources/st2bundle/rpm/st2api.service b/st2/st2bundle/rpm/st2api.service similarity index 100% rename from sources/st2bundle/rpm/st2api.service rename to st2/st2bundle/rpm/st2api.service diff --git a/sources/st2bundle/rpm/st2auth.service b/st2/st2bundle/rpm/st2auth.service similarity index 100% rename from sources/st2bundle/rpm/st2auth.service rename to st2/st2bundle/rpm/st2auth.service diff --git a/sources/st2bundle/rpm/st2notifier.service b/st2/st2bundle/rpm/st2notifier.service similarity index 100% rename from sources/st2bundle/rpm/st2notifier.service rename to st2/st2bundle/rpm/st2notifier.service diff --git a/sources/st2bundle/rpm/st2rulesengine.service b/st2/st2bundle/rpm/st2rulesengine.service similarity index 100% rename from sources/st2bundle/rpm/st2rulesengine.service rename to st2/st2bundle/rpm/st2rulesengine.service diff --git a/sources/st2bundle/rpm/st2sensorcontainer.service b/st2/st2bundle/rpm/st2sensorcontainer.service similarity index 100% rename from sources/st2bundle/rpm/st2sensorcontainer.service rename to st2/st2bundle/rpm/st2sensorcontainer.service diff --git a/sources/st2reactor/rpm/st2rulesengine.service b/st2/st2reactor/rpm/st2rulesengine.service similarity index 100% rename from sources/st2reactor/rpm/st2rulesengine.service rename to st2/st2reactor/rpm/st2rulesengine.service diff --git a/sources/st2reactor/rpm/st2sensorcontainer.service b/st2/st2reactor/rpm/st2sensorcontainer.service similarity index 100% rename from sources/st2reactor/rpm/st2sensorcontainer.service rename to st2/st2reactor/rpm/st2sensorcontainer.service From 6b6738faea53a1baeb4c5af3ef7dea6882c37f02 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Fri, 30 Oct 2015 20:41:02 +0300 Subject: [PATCH 08/50] moving all packages into packages/ Cherry-picked from StackStorm/st2-packages@02e88684f8535cf10f9a05cfa7502c95bbd4546d --- {st2 => packages}/st2actions/rpm/st2actionrunner.service | 0 {st2 => packages}/st2actions/rpm/st2actionrunner@.service | 0 {st2 => packages}/st2actions/rpm/st2notifier.service | 0 {st2 => packages}/st2api/rpm/st2api.service | 0 {st2 => packages}/st2auth/rpm/st2auth.service | 0 {st2 => packages}/st2bundle/rpm/st2actionrunner.service | 0 {st2 => packages}/st2bundle/rpm/st2actionrunner@.service | 0 {st2 => packages}/st2bundle/rpm/st2api.service | 0 {st2 => packages}/st2bundle/rpm/st2auth.service | 0 {st2 => packages}/st2bundle/rpm/st2notifier.service | 0 {st2 => packages}/st2bundle/rpm/st2rulesengine.service | 0 {st2 => packages}/st2bundle/rpm/st2sensorcontainer.service | 0 {st2 => packages}/st2reactor/rpm/st2rulesengine.service | 0 {st2 => packages}/st2reactor/rpm/st2sensorcontainer.service | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename {st2 => packages}/st2actions/rpm/st2actionrunner.service (100%) rename {st2 => packages}/st2actions/rpm/st2actionrunner@.service (100%) rename {st2 => packages}/st2actions/rpm/st2notifier.service (100%) rename {st2 => packages}/st2api/rpm/st2api.service (100%) rename {st2 => packages}/st2auth/rpm/st2auth.service (100%) rename {st2 => packages}/st2bundle/rpm/st2actionrunner.service (100%) rename {st2 => packages}/st2bundle/rpm/st2actionrunner@.service (100%) rename {st2 => packages}/st2bundle/rpm/st2api.service (100%) rename {st2 => packages}/st2bundle/rpm/st2auth.service (100%) rename {st2 => packages}/st2bundle/rpm/st2notifier.service (100%) rename {st2 => packages}/st2bundle/rpm/st2rulesengine.service (100%) rename {st2 => packages}/st2bundle/rpm/st2sensorcontainer.service (100%) rename {st2 => packages}/st2reactor/rpm/st2rulesengine.service (100%) rename {st2 => packages}/st2reactor/rpm/st2sensorcontainer.service (100%) diff --git a/st2/st2actions/rpm/st2actionrunner.service b/packages/st2actions/rpm/st2actionrunner.service similarity index 100% rename from st2/st2actions/rpm/st2actionrunner.service rename to packages/st2actions/rpm/st2actionrunner.service diff --git a/st2/st2actions/rpm/st2actionrunner@.service b/packages/st2actions/rpm/st2actionrunner@.service similarity index 100% rename from st2/st2actions/rpm/st2actionrunner@.service rename to packages/st2actions/rpm/st2actionrunner@.service diff --git a/st2/st2actions/rpm/st2notifier.service b/packages/st2actions/rpm/st2notifier.service similarity index 100% rename from st2/st2actions/rpm/st2notifier.service rename to packages/st2actions/rpm/st2notifier.service diff --git a/st2/st2api/rpm/st2api.service b/packages/st2api/rpm/st2api.service similarity index 100% rename from st2/st2api/rpm/st2api.service rename to packages/st2api/rpm/st2api.service diff --git a/st2/st2auth/rpm/st2auth.service b/packages/st2auth/rpm/st2auth.service similarity index 100% rename from st2/st2auth/rpm/st2auth.service rename to packages/st2auth/rpm/st2auth.service diff --git a/st2/st2bundle/rpm/st2actionrunner.service b/packages/st2bundle/rpm/st2actionrunner.service similarity index 100% rename from st2/st2bundle/rpm/st2actionrunner.service rename to packages/st2bundle/rpm/st2actionrunner.service diff --git a/st2/st2bundle/rpm/st2actionrunner@.service b/packages/st2bundle/rpm/st2actionrunner@.service similarity index 100% rename from st2/st2bundle/rpm/st2actionrunner@.service rename to packages/st2bundle/rpm/st2actionrunner@.service diff --git a/st2/st2bundle/rpm/st2api.service b/packages/st2bundle/rpm/st2api.service similarity index 100% rename from st2/st2bundle/rpm/st2api.service rename to packages/st2bundle/rpm/st2api.service diff --git a/st2/st2bundle/rpm/st2auth.service b/packages/st2bundle/rpm/st2auth.service similarity index 100% rename from st2/st2bundle/rpm/st2auth.service rename to packages/st2bundle/rpm/st2auth.service diff --git a/st2/st2bundle/rpm/st2notifier.service b/packages/st2bundle/rpm/st2notifier.service similarity index 100% rename from st2/st2bundle/rpm/st2notifier.service rename to packages/st2bundle/rpm/st2notifier.service diff --git a/st2/st2bundle/rpm/st2rulesengine.service b/packages/st2bundle/rpm/st2rulesengine.service similarity index 100% rename from st2/st2bundle/rpm/st2rulesengine.service rename to packages/st2bundle/rpm/st2rulesengine.service diff --git a/st2/st2bundle/rpm/st2sensorcontainer.service b/packages/st2bundle/rpm/st2sensorcontainer.service similarity index 100% rename from st2/st2bundle/rpm/st2sensorcontainer.service rename to packages/st2bundle/rpm/st2sensorcontainer.service diff --git a/st2/st2reactor/rpm/st2rulesengine.service b/packages/st2reactor/rpm/st2rulesengine.service similarity index 100% rename from st2/st2reactor/rpm/st2rulesengine.service rename to packages/st2reactor/rpm/st2rulesengine.service diff --git a/st2/st2reactor/rpm/st2sensorcontainer.service b/packages/st2reactor/rpm/st2sensorcontainer.service similarity index 100% rename from st2/st2reactor/rpm/st2sensorcontainer.service rename to packages/st2reactor/rpm/st2sensorcontainer.service From 2421938316d3f37eced8b540bbfc7f0b2febbefd Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 22 Dec 2015 15:12:08 +0100 Subject: [PATCH 09/50] Add files for the new st2garbagecollector service which is, for now, located in st2reactor package. Cherry-picked from StackStorm/st2-packages@57d773556e7dc1a1a085e1fbf6926afeb9f5d988 --- .../st2reactor/rpm/st2garbagecollector.service | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/st2reactor/rpm/st2garbagecollector.service diff --git a/packages/st2reactor/rpm/st2garbagecollector.service b/packages/st2reactor/rpm/st2garbagecollector.service new file mode 100644 index 0000000000..87cb590ebe --- /dev/null +++ b/packages/st2reactor/rpm/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=/usr/share/python/st2reactor/bin/st2garbagecollector $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From 48b575641ef3ca33aded6106ae000b8f23c92cca Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 22 Dec 2015 21:17:31 +0100 Subject: [PATCH 10/50] Also copy garbage collector init files to st2bundle directory. Cherry-picked from StackStorm/st2-packages@a1ec293e45bbf6fb7a6cddc413b3f2709e2231d1 --- .../st2bundle/rpm/st2garbagecollector.service | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/st2bundle/rpm/st2garbagecollector.service diff --git a/packages/st2bundle/rpm/st2garbagecollector.service b/packages/st2bundle/rpm/st2garbagecollector.service new file mode 100644 index 0000000000..87cb590ebe --- /dev/null +++ b/packages/st2bundle/rpm/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=/usr/share/python/st2reactor/bin/st2garbagecollector $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From 44f03f62b7e9f000d8cf21574415d9d7831eb514 Mon Sep 17 00:00:00 2001 From: Lakshmi Kannan Date: Thu, 14 Jan 2016 14:05:03 -0800 Subject: [PATCH 11/50] Fix the binary paths for garbage collector Cherry-picked from StackStorm/st2-packages@0e7bcdefa0c814d55972522e00952a5d98681640 --- packages/st2bundle/rpm/st2garbagecollector.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/st2bundle/rpm/st2garbagecollector.service b/packages/st2bundle/rpm/st2garbagecollector.service index 87cb590ebe..a2156c6750 100644 --- a/packages/st2bundle/rpm/st2garbagecollector.service +++ b/packages/st2bundle/rpm/st2garbagecollector.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2garbagecollector -ExecStart=/usr/share/python/st2reactor/bin/st2garbagecollector $DAEMON_ARGS +ExecStart=/usr/share/python/st2/bin/st2garbagecollector $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure From 1d1cc854cbe9254edf072afc37f498fc1b71db8a Mon Sep 17 00:00:00 2001 From: Kirill Enykeev Date: Fri, 22 Jan 2016 20:43:38 +0600 Subject: [PATCH 12/50] Add gunicorn and uwsgi to init files Cherry-picked from StackStorm/st2-packages@860a219e5f1721aeee233d6741d558fd5da4d6eb --- packages/st2api/rpm/st2api.service | 3 +-- packages/st2auth/rpm/st2auth.service | 3 +-- packages/st2bundle/rpm/st2api.service | 3 +-- packages/st2bundle/rpm/st2auth.service | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/st2api/rpm/st2api.service b/packages/st2api/rpm/st2api.service index e3d3c669e3..9663a49f57 100644 --- a/packages/st2api/rpm/st2api.service +++ b/packages/st2api/rpm/st2api.service @@ -6,9 +6,8 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2api -ExecStart=/usr/share/python/st2api/bin/st2api $DAEMON_ARGS +ExecStart=/usr/share/python/st2api/bin/gunicorn_pecan /usr/share/python/st2api/lib/python2.7/site-packages/st2api/gunicorn_config.py -k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1 TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2auth/rpm/st2auth.service b/packages/st2auth/rpm/st2auth.service index cf77b43ecf..14b52c0d49 100644 --- a/packages/st2auth/rpm/st2auth.service +++ b/packages/st2auth/rpm/st2auth.service @@ -6,9 +6,8 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/share/python/st2auth/bin/st2auth $DAEMON_ARGS +ExecStart=/usr/share/python/st2auth/bin/uwsgi --ini /etc/uwsgi.d/st2auth.ini TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2bundle/rpm/st2api.service b/packages/st2bundle/rpm/st2api.service index fd01aaaf16..9f08f6cad6 100644 --- a/packages/st2bundle/rpm/st2api.service +++ b/packages/st2bundle/rpm/st2api.service @@ -6,9 +6,8 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2api -ExecStart=/usr/share/python/st2/bin/st2api $DAEMON_ARGS +ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py -k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1 TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2bundle/rpm/st2auth.service b/packages/st2bundle/rpm/st2auth.service index 3e06e59b44..7352db4a01 100644 --- a/packages/st2bundle/rpm/st2auth.service +++ b/packages/st2bundle/rpm/st2auth.service @@ -6,9 +6,8 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/share/python/st2/bin/st2auth $DAEMON_ARGS +ExecStart=/usr/share/python/st2/bin/uwsgi --ini /etc/uwsgi.d/st2auth.ini TimeoutSec=60 PrivateTmp=true Restart=on-failure From a06e044bc4defc8f255b236aa437b3ad5abf308c Mon Sep 17 00:00:00 2001 From: Kirill Enykeev Date: Mon, 25 Jan 2016 14:57:00 +0600 Subject: [PATCH 13/50] Start st2auth as gunicorn Cherry-picked from StackStorm/st2-packages@2c355bba9a295d1ef5d532970414ce7ef697e3e7 --- packages/st2auth/rpm/st2auth.service | 2 +- packages/st2bundle/rpm/st2auth.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/st2auth/rpm/st2auth.service b/packages/st2auth/rpm/st2auth.service index 14b52c0d49..b84b8fec18 100644 --- a/packages/st2auth/rpm/st2auth.service +++ b/packages/st2auth/rpm/st2auth.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/share/python/st2auth/bin/uwsgi --ini /etc/uwsgi.d/st2auth.ini +ExecStart=/usr/share/python/st2auth/bin/gunicorn_pecan /usr/share/python/st2auth/lib/python2.7/site-packages/st2auth/gunicorn_config.py -k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1 TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2bundle/rpm/st2auth.service b/packages/st2bundle/rpm/st2auth.service index 7352db4a01..556f1d9f9f 100644 --- a/packages/st2bundle/rpm/st2auth.service +++ b/packages/st2bundle/rpm/st2auth.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/share/python/st2/bin/uwsgi --ini /etc/uwsgi.d/st2auth.ini +ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py -k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1 TimeoutSec=60 PrivateTmp=true Restart=on-failure From 460f73482bba67cac8896bfb36d36ad7148aef73 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Wed, 20 Jan 2016 22:04:54 +0700 Subject: [PATCH 14/50] removing apparently "FAR FUTURE PREOPTIMIZATION" Cherry-picked from StackStorm/st2-packages@e545ab048cde8389e6699295bf34a2d5b561dbac --- .../st2actions/rpm/st2actionrunner.service | 13 ------------- .../st2actions/rpm/st2actionrunner@.service | 17 ----------------- packages/st2actions/rpm/st2notifier.service | 18 ------------------ packages/st2api/rpm/st2api.service | 17 ----------------- packages/st2auth/rpm/st2auth.service | 17 ----------------- .../st2reactor/rpm/st2garbagecollector.service | 18 ------------------ packages/st2reactor/rpm/st2rulesengine.service | 18 ------------------ .../st2reactor/rpm/st2sensorcontainer.service | 18 ------------------ 8 files changed, 136 deletions(-) delete mode 100644 packages/st2actions/rpm/st2actionrunner.service delete mode 100644 packages/st2actions/rpm/st2actionrunner@.service delete mode 100644 packages/st2actions/rpm/st2notifier.service delete mode 100644 packages/st2api/rpm/st2api.service delete mode 100644 packages/st2auth/rpm/st2auth.service delete mode 100644 packages/st2reactor/rpm/st2garbagecollector.service delete mode 100644 packages/st2reactor/rpm/st2rulesengine.service delete mode 100644 packages/st2reactor/rpm/st2sensorcontainer.service diff --git a/packages/st2actions/rpm/st2actionrunner.service b/packages/st2actions/rpm/st2actionrunner.service deleted file mode 100644 index 29e0bb356c..0000000000 --- a/packages/st2actions/rpm/st2actionrunner.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=StackStorm service st2actionrunner -After=network.target - -[Service] -Type=oneshot -EnvironmentFile=-/etc/sysconfig/st2actionrunner -ExecStart=/bin/bash /usr/share/python/st2actions/bin/runners.sh start -ExecStop=/bin/bash /usr/share/python/st2actions/bin/runners.sh stop -RemainAfterExit=true - -[Install] -WantedBy=multi-user.target diff --git a/packages/st2actions/rpm/st2actionrunner@.service b/packages/st2actions/rpm/st2actionrunner@.service deleted file mode 100644 index 25187d3962..0000000000 --- a/packages/st2actions/rpm/st2actionrunner@.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=StackStorm service st2actionrunner -After=network.target - -[Service] -Type=simple -Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -Environment="WORKERID=%i" -EnvironmentFile=-/etc/sysconfig/st2actionrunner -ExecStart=/usr/share/python/st2actions/bin/st2actionrunner $DAEMON_ARGS -TimeoutSec=60 -PrivateTmp=true -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/packages/st2actions/rpm/st2notifier.service b/packages/st2actions/rpm/st2notifier.service deleted file mode 100644 index 57f9a51786..0000000000 --- a/packages/st2actions/rpm/st2notifier.service +++ /dev/null @@ -1,18 +0,0 @@ -[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=/usr/share/python/st2actions/bin/st2notifier $DAEMON_ARGS -TimeoutSec=60 -PrivateTmp=true -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/packages/st2api/rpm/st2api.service b/packages/st2api/rpm/st2api.service deleted file mode 100644 index 9663a49f57..0000000000 --- a/packages/st2api/rpm/st2api.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=StackStorm service st2api -After=network.target - -[Service] -Type=simple -User=st2 -Group=st2 -EnvironmentFile=-/etc/sysconfig/st2api -ExecStart=/usr/share/python/st2api/bin/gunicorn_pecan /usr/share/python/st2api/lib/python2.7/site-packages/st2api/gunicorn_config.py -k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1 -TimeoutSec=60 -PrivateTmp=true -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/packages/st2auth/rpm/st2auth.service b/packages/st2auth/rpm/st2auth.service deleted file mode 100644 index b84b8fec18..0000000000 --- a/packages/st2auth/rpm/st2auth.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=StackStorm service st2auth -After=network.target - -[Service] -Type=simple -User=st2 -Group=st2 -EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/share/python/st2auth/bin/gunicorn_pecan /usr/share/python/st2auth/lib/python2.7/site-packages/st2auth/gunicorn_config.py -k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1 -TimeoutSec=60 -PrivateTmp=true -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/packages/st2reactor/rpm/st2garbagecollector.service b/packages/st2reactor/rpm/st2garbagecollector.service deleted file mode 100644 index 87cb590ebe..0000000000 --- a/packages/st2reactor/rpm/st2garbagecollector.service +++ /dev/null @@ -1,18 +0,0 @@ -[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=/usr/share/python/st2reactor/bin/st2garbagecollector $DAEMON_ARGS -TimeoutSec=60 -PrivateTmp=true -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/packages/st2reactor/rpm/st2rulesengine.service b/packages/st2reactor/rpm/st2rulesengine.service deleted file mode 100644 index 8319f19382..0000000000 --- a/packages/st2reactor/rpm/st2rulesengine.service +++ /dev/null @@ -1,18 +0,0 @@ -[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=/usr/share/python/st2reactor/bin/st2rulesengine $DAEMON_ARGS -TimeoutSec=60 -PrivateTmp=true -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/packages/st2reactor/rpm/st2sensorcontainer.service b/packages/st2reactor/rpm/st2sensorcontainer.service deleted file mode 100644 index 0a054f13e5..0000000000 --- a/packages/st2reactor/rpm/st2sensorcontainer.service +++ /dev/null @@ -1,18 +0,0 @@ -[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=/usr/share/python/st2reactor/bin/st2sensorcontainer $DAEMON_ARGS -TimeoutSec=60 -PrivateTmp=true -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target From 4c8a885df7c37dafbb90959ead9ed6746c77b34c Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Wed, 27 Jan 2016 22:17:08 +0700 Subject: [PATCH 15/50] fixing hardcoded arguments for st2auth, st2api services Cherry-picked from StackStorm/st2-packages@4014717b059cba85ad180161e4fedb1232f20081 --- packages/st2bundle/rpm/st2api.service | 3 ++- packages/st2bundle/rpm/st2auth.service | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/st2bundle/rpm/st2api.service b/packages/st2bundle/rpm/st2api.service index 9f08f6cad6..b856a4c051 100644 --- a/packages/st2bundle/rpm/st2api.service +++ b/packages/st2bundle/rpm/st2api.service @@ -6,8 +6,9 @@ After=network.target Type=simple User=st2 Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1" EnvironmentFile=-/etc/sysconfig/st2api -ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py -k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1 +ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2bundle/rpm/st2auth.service b/packages/st2bundle/rpm/st2auth.service index 556f1d9f9f..bdc77783d1 100644 --- a/packages/st2bundle/rpm/st2auth.service +++ b/packages/st2bundle/rpm/st2auth.service @@ -6,8 +6,9 @@ After=network.target Type=simple User=st2 Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1" EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py -k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1 +ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure From 5a85eba77174cb794d2f30a75ea1ea43c0101707 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Sat, 30 Jan 2016 14:39:15 +0700 Subject: [PATCH 16/50] st2bundle renamed to st2 Cherry-picked from StackStorm/st2-packages@b74e98fb22652d8f2da6ac2643106c83aff2d3b7 --- packages/{st2bundle => st2}/rpm/st2actionrunner.service | 0 packages/{st2bundle => st2}/rpm/st2actionrunner@.service | 0 packages/{st2bundle => st2}/rpm/st2api.service | 0 packages/{st2bundle => st2}/rpm/st2auth.service | 0 packages/{st2bundle => st2}/rpm/st2garbagecollector.service | 0 packages/{st2bundle => st2}/rpm/st2notifier.service | 0 packages/{st2bundle => st2}/rpm/st2rulesengine.service | 0 packages/{st2bundle => st2}/rpm/st2sensorcontainer.service | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename packages/{st2bundle => st2}/rpm/st2actionrunner.service (100%) rename packages/{st2bundle => st2}/rpm/st2actionrunner@.service (100%) rename packages/{st2bundle => st2}/rpm/st2api.service (100%) rename packages/{st2bundle => st2}/rpm/st2auth.service (100%) rename packages/{st2bundle => st2}/rpm/st2garbagecollector.service (100%) rename packages/{st2bundle => st2}/rpm/st2notifier.service (100%) rename packages/{st2bundle => st2}/rpm/st2rulesengine.service (100%) rename packages/{st2bundle => st2}/rpm/st2sensorcontainer.service (100%) diff --git a/packages/st2bundle/rpm/st2actionrunner.service b/packages/st2/rpm/st2actionrunner.service similarity index 100% rename from packages/st2bundle/rpm/st2actionrunner.service rename to packages/st2/rpm/st2actionrunner.service diff --git a/packages/st2bundle/rpm/st2actionrunner@.service b/packages/st2/rpm/st2actionrunner@.service similarity index 100% rename from packages/st2bundle/rpm/st2actionrunner@.service rename to packages/st2/rpm/st2actionrunner@.service diff --git a/packages/st2bundle/rpm/st2api.service b/packages/st2/rpm/st2api.service similarity index 100% rename from packages/st2bundle/rpm/st2api.service rename to packages/st2/rpm/st2api.service diff --git a/packages/st2bundle/rpm/st2auth.service b/packages/st2/rpm/st2auth.service similarity index 100% rename from packages/st2bundle/rpm/st2auth.service rename to packages/st2/rpm/st2auth.service diff --git a/packages/st2bundle/rpm/st2garbagecollector.service b/packages/st2/rpm/st2garbagecollector.service similarity index 100% rename from packages/st2bundle/rpm/st2garbagecollector.service rename to packages/st2/rpm/st2garbagecollector.service diff --git a/packages/st2bundle/rpm/st2notifier.service b/packages/st2/rpm/st2notifier.service similarity index 100% rename from packages/st2bundle/rpm/st2notifier.service rename to packages/st2/rpm/st2notifier.service diff --git a/packages/st2bundle/rpm/st2rulesengine.service b/packages/st2/rpm/st2rulesengine.service similarity index 100% rename from packages/st2bundle/rpm/st2rulesengine.service rename to packages/st2/rpm/st2rulesengine.service diff --git a/packages/st2bundle/rpm/st2sensorcontainer.service b/packages/st2/rpm/st2sensorcontainer.service similarity index 100% rename from packages/st2bundle/rpm/st2sensorcontainer.service rename to packages/st2/rpm/st2sensorcontainer.service From e98906a121ce63dad301fa6e3f7462ae1fd1a770 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Sat, 30 Jan 2016 15:54:37 +0700 Subject: [PATCH 17/50] other code rewrites /usr/share/python to /opt/stackstorm Cherry-picked from StackStorm/st2-packages@15f8906ca2f47fe9e7ec07c688497aba6b06542b --- packages/st2/rpm/st2actionrunner.service | 4 ++-- packages/st2/rpm/st2actionrunner@.service | 2 +- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- packages/st2/rpm/st2garbagecollector.service | 2 +- packages/st2/rpm/st2notifier.service | 2 +- packages/st2/rpm/st2rulesengine.service | 2 +- packages/st2/rpm/st2sensorcontainer.service | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/st2/rpm/st2actionrunner.service b/packages/st2/rpm/st2actionrunner.service index 6122865223..4e00cdf9a0 100644 --- a/packages/st2/rpm/st2actionrunner.service +++ b/packages/st2/rpm/st2actionrunner.service @@ -5,8 +5,8 @@ After=network.target [Service] Type=oneshot EnvironmentFile=-/etc/sysconfig/st2actionrunner -ExecStart=/bin/bash /usr/share/python/st2/bin/runners.sh start -ExecStop=/bin/bash /usr/share/python/st2/bin/runners.sh stop +ExecStart=/bin/bash /opt/stackstorm/st2/bin/runners.sh start +ExecStop=/bin/bash /opt/stackstorm/st2/bin/runners.sh stop RemainAfterExit=true [Install] diff --git a/packages/st2/rpm/st2actionrunner@.service b/packages/st2/rpm/st2actionrunner@.service index 34ebfb2154..68db3fcc20 100644 --- a/packages/st2/rpm/st2actionrunner@.service +++ b/packages/st2/rpm/st2actionrunner@.service @@ -7,7 +7,7 @@ Type=simple Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" Environment="WORKERID=%i" EnvironmentFile=-/etc/sysconfig/st2actionrunner -ExecStart=/usr/share/python/st2/bin/st2actionrunner $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/st2actionrunner $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index b856a4c051..d13b4a1729 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1" EnvironmentFile=-/etc/sysconfig/st2api -ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index bdc77783d1..29755d5012 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1" EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/usr/share/python/st2/bin/gunicorn_pecan /usr/share/python/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2garbagecollector.service b/packages/st2/rpm/st2garbagecollector.service index a2156c6750..62ff423930 100644 --- a/packages/st2/rpm/st2garbagecollector.service +++ b/packages/st2/rpm/st2garbagecollector.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2garbagecollector -ExecStart=/usr/share/python/st2/bin/st2garbagecollector $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/st2garbagecollector $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2notifier.service b/packages/st2/rpm/st2notifier.service index 093d879eaf..d0f098955d 100644 --- a/packages/st2/rpm/st2notifier.service +++ b/packages/st2/rpm/st2notifier.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2notifier -ExecStart=/usr/share/python/st2/bin/st2notifier $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/st2notifier $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2rulesengine.service b/packages/st2/rpm/st2rulesengine.service index e625dd6177..c2ae7b0bee 100644 --- a/packages/st2/rpm/st2rulesengine.service +++ b/packages/st2/rpm/st2rulesengine.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2rulesengine -ExecStart=/usr/share/python/st2/bin/st2rulesengine $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/st2rulesengine $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2sensorcontainer.service b/packages/st2/rpm/st2sensorcontainer.service index b1bd224c96..d4f0674436 100644 --- a/packages/st2/rpm/st2sensorcontainer.service +++ b/packages/st2/rpm/st2sensorcontainer.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" EnvironmentFile=-/etc/sysconfig/st2sensorcontainer -ExecStart=/usr/share/python/st2/bin/st2sensorcontainer $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/st2sensorcontainer $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure From 302523d47a0647b7ad64bfbfea92d1b7639e4117 Mon Sep 17 00:00:00 2001 From: armab Date: Fri, 12 Feb 2016 15:25:35 +0200 Subject: [PATCH 18/50] Fix gunicorn graceful timeout Cherry-picked from StackStorm/st2-packages@8833a2901c83904b4f207283876fe1d8b3faf18d --- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index d13b4a1729..fb88e562e6 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1" +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1 --graceful-timeout 10" EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index 29755d5012..4b85408b70 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1" +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1 --graceful-timeout 10" EnvironmentFile=-/etc/sysconfig/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 From 690c0613165d1ca3af8c3ae5073073bf9a749577 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Feb 2016 11:38:22 +0100 Subject: [PATCH 19/50] Add config files and other stuff for st2stream service. Cherry-picked from StackStorm/st2-packages@f55903d7d624db55e4e68802e326c106d152ebea --- packages/st2/rpm/st2stream.service | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/st2/rpm/st2stream.service diff --git a/packages/st2/rpm/st2stream.service b/packages/st2/rpm/st2stream.service new file mode 100644 index 0000000000..c29cd5b212 --- /dev/null +++ b/packages/st2/rpm/st2stream.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2stream +After=network.target + +[Service] +Type=simple +User=st2 +Group=st2 +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9102 --workers 2 --threads 10 --graceful-timeout 10 --timeout 30" +EnvironmentFile=-/etc/sysconfig/st2stream +ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From b7d9c30c1b99ec5a1a7eb5d9b93f1c9af20d824d Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Feb 2016 14:31:29 +0100 Subject: [PATCH 20/50] Update st2api and st2auth to use sync gunicorn workers with 1 process and 1 thread. This should fix performance issues we were seeing. Cherry-picked from StackStorm/st2-packages@2eaa09148fbf6a536607a64bc04c82aeeafd486f --- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index fb88e562e6..65658715c6 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --threads 10 --workers 1 --graceful-timeout 10" +Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index 4b85408b70..6357a22909 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --threads 10 --workers 1 --graceful-timeout 10" +Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 From 4c239592bc94ec8550a92b15abce11fe676db9a3 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Feb 2016 14:34:34 +0100 Subject: [PATCH 21/50] For now use 1 worker, this should be plenty. Cherry-picked from StackStorm/st2-packages@b4d092752741e08f6211213ef0aaba5102d60707 --- packages/st2/rpm/st2stream.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/st2/rpm/st2stream.service b/packages/st2/rpm/st2stream.service index c29cd5b212..07cc48863c 100644 --- a/packages/st2/rpm/st2stream.service +++ b/packages/st2/rpm/st2stream.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9102 --workers 2 --threads 10 --graceful-timeout 10 --timeout 30" +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9102 --workers 1 --threads 10 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 From 6311e69e9bb6c2a01f3ce80a69f449eb11a1103c Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Feb 2016 17:56:04 +0100 Subject: [PATCH 22/50] Use 2 worker processes for st2api. It seems to work better, even on smaller, 2GB vms. Cherry-picked from StackStorm/st2-packages@d02bb2bb624c3755924a715c3472a029cd6e0b80 --- packages/st2/rpm/st2api.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index 65658715c6..0622388464 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" +Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9101 --workers 2 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 From 25dca39317ab1b3293d8f2cbfaa13dff930a805b Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Wed, 2 Mar 2016 15:45:25 +0700 Subject: [PATCH 23/50] running actionrunner as root:st2packs with umask 002 to provide group writeable access Cherry-picked from StackStorm/st2-packages@0fcda8833f33b1a07f2f02a2f613753237d10640 --- packages/st2/rpm/st2actionrunner@.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/st2/rpm/st2actionrunner@.service b/packages/st2/rpm/st2actionrunner@.service index 68db3fcc20..86a68afd8d 100644 --- a/packages/st2/rpm/st2actionrunner@.service +++ b/packages/st2/rpm/st2actionrunner@.service @@ -4,6 +4,9 @@ After=network.target [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 From 086e8522812ea419b27a8d0c2046a561ca8e2413 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Fri, 4 Mar 2016 15:02:18 +0700 Subject: [PATCH 24/50] set number of workers for st2api == 1 Cherry-picked from StackStorm/st2-packages@c7488bbc86de4803d06f341e5892606bef81d147 --- packages/st2/rpm/st2api.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index 0622388464..65658715c6 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9101 --workers 2 --threads 1 --graceful-timeout 10 --timeout 30" +Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 From 6c878fa1f02cbb85711789e670b8906a9f0ce153 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 20 Apr 2016 19:44:35 +0200 Subject: [PATCH 25/50] Switch back to eventlet based gunicorn worker for st2api and st2auth. Cherry-picked from StackStorm/st2-packages@a90a164e620408f63f4a2994e7300fe07ca18da7 --- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index 65658715c6..fddaf88039 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index 6357a22909..e72cc317a9 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=st2 Group=st2 -Environment="DAEMON_ARGS=-k sync -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" +Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 From 4f95843393f6331f1f2aaae8cf8e90ba59b93640 Mon Sep 17 00:00:00 2001 From: Kirill Izotov Date: Wed, 13 Jul 2016 14:41:57 +0700 Subject: [PATCH 26/50] Add service files to deb Cherry-picked from StackStorm/st2-packages@4fe371c70dd4debb32fd7ccb45289b6f342d438d --- packages/st2/debian/st2actionrunner.service | 13 ++++++++++++ packages/st2/debian/st2actionrunner@.service | 20 +++++++++++++++++++ packages/st2/debian/st2api.service | 18 +++++++++++++++++ packages/st2/debian/st2auth.service | 18 +++++++++++++++++ .../st2/debian/st2garbagecollector.service | 18 +++++++++++++++++ packages/st2/debian/st2notifier.service | 18 +++++++++++++++++ packages/st2/debian/st2rulesengine.service | 18 +++++++++++++++++ .../st2/debian/st2sensorcontainer.service | 18 +++++++++++++++++ packages/st2/debian/st2stream.service | 18 +++++++++++++++++ 9 files changed, 159 insertions(+) create mode 100644 packages/st2/debian/st2actionrunner.service create mode 100644 packages/st2/debian/st2actionrunner@.service create mode 100644 packages/st2/debian/st2api.service create mode 100644 packages/st2/debian/st2auth.service create mode 100644 packages/st2/debian/st2garbagecollector.service create mode 100644 packages/st2/debian/st2notifier.service create mode 100644 packages/st2/debian/st2rulesengine.service create mode 100644 packages/st2/debian/st2sensorcontainer.service create mode 100644 packages/st2/debian/st2stream.service diff --git a/packages/st2/debian/st2actionrunner.service b/packages/st2/debian/st2actionrunner.service new file mode 100644 index 0000000000..4e00cdf9a0 --- /dev/null +++ b/packages/st2/debian/st2actionrunner.service @@ -0,0 +1,13 @@ +[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 +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target diff --git a/packages/st2/debian/st2actionrunner@.service b/packages/st2/debian/st2actionrunner@.service new file mode 100644 index 0000000000..86a68afd8d --- /dev/null +++ b/packages/st2/debian/st2actionrunner@.service @@ -0,0 +1,20 @@ +[Unit] +Description=StackStorm service st2actionrunner +After=network.target + +[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/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service new file mode 100644 index 0000000000..fddaf88039 --- /dev/null +++ b/packages/st2/debian/st2api.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2api +After=network.target + +[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" +EnvironmentFile=-/etc/sysconfig/st2api +ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service new file mode 100644 index 0000000000..e72cc317a9 --- /dev/null +++ b/packages/st2/debian/st2auth.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2auth +After=network.target + +[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" +EnvironmentFile=-/etc/sysconfig/st2auth +ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/packages/st2/debian/st2garbagecollector.service b/packages/st2/debian/st2garbagecollector.service new file mode 100644 index 0000000000..62ff423930 --- /dev/null +++ b/packages/st2/debian/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/packages/st2/debian/st2notifier.service b/packages/st2/debian/st2notifier.service new file mode 100644 index 0000000000..d0f098955d --- /dev/null +++ b/packages/st2/debian/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/packages/st2/debian/st2rulesengine.service b/packages/st2/debian/st2rulesengine.service new file mode 100644 index 0000000000..c2ae7b0bee --- /dev/null +++ b/packages/st2/debian/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/packages/st2/debian/st2sensorcontainer.service b/packages/st2/debian/st2sensorcontainer.service new file mode 100644 index 0000000000..d4f0674436 --- /dev/null +++ b/packages/st2/debian/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/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service new file mode 100644 index 0000000000..07cc48863c --- /dev/null +++ b/packages/st2/debian/st2stream.service @@ -0,0 +1,18 @@ +[Unit] +Description=StackStorm service st2stream +After=network.target + +[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" +EnvironmentFile=-/etc/sysconfig/st2stream +ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS +TimeoutSec=60 +PrivateTmp=true +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target From 9b7bd60af095b4e8c9c1107b210f114183a9b531 Mon Sep 17 00:00:00 2001 From: Kirill Izotov Date: Mon, 25 Jul 2016 10:09:35 +0700 Subject: [PATCH 27/50] Fix default env directory Cherry-picked from StackStorm/st2-packages@2e5c358e26d340e45957e8d954f32281baddb932 --- packages/st2/debian/st2actionrunner.service | 2 +- packages/st2/debian/st2actionrunner@.service | 2 +- packages/st2/debian/st2api.service | 2 +- packages/st2/debian/st2auth.service | 2 +- packages/st2/debian/st2garbagecollector.service | 2 +- packages/st2/debian/st2notifier.service | 2 +- packages/st2/debian/st2rulesengine.service | 2 +- packages/st2/debian/st2sensorcontainer.service | 2 +- packages/st2/debian/st2stream.service | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/st2/debian/st2actionrunner.service b/packages/st2/debian/st2actionrunner.service index 4e00cdf9a0..8f8ff33bde 100644 --- a/packages/st2/debian/st2actionrunner.service +++ b/packages/st2/debian/st2actionrunner.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=oneshot -EnvironmentFile=-/etc/sysconfig/st2actionrunner +EnvironmentFile=-/etc/default/st2actionrunner ExecStart=/bin/bash /opt/stackstorm/st2/bin/runners.sh start ExecStop=/bin/bash /opt/stackstorm/st2/bin/runners.sh stop RemainAfterExit=true diff --git a/packages/st2/debian/st2actionrunner@.service b/packages/st2/debian/st2actionrunner@.service index 86a68afd8d..dbc8f993b5 100644 --- a/packages/st2/debian/st2actionrunner@.service +++ b/packages/st2/debian/st2actionrunner@.service @@ -9,7 +9,7 @@ Group=st2packs UMask=002 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" Environment="WORKERID=%i" -EnvironmentFile=-/etc/sysconfig/st2actionrunner +EnvironmentFile=-/etc/default/st2actionrunner ExecStart=/opt/stackstorm/st2/bin/st2actionrunner $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index fddaf88039..6170680a04 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/sysconfig/st2api +EnvironmentFile=-/etc/default/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index e72cc317a9..800bcc8002 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/sysconfig/st2auth +EnvironmentFile=-/etc/default/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2garbagecollector.service b/packages/st2/debian/st2garbagecollector.service index 62ff423930..5d3061534a 100644 --- a/packages/st2/debian/st2garbagecollector.service +++ b/packages/st2/debian/st2garbagecollector.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2garbagecollector +EnvironmentFile=-/etc/default/st2garbagecollector ExecStart=/opt/stackstorm/st2/bin/st2garbagecollector $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2notifier.service b/packages/st2/debian/st2notifier.service index d0f098955d..31df3f3411 100644 --- a/packages/st2/debian/st2notifier.service +++ b/packages/st2/debian/st2notifier.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2notifier +EnvironmentFile=-/etc/default/st2notifier ExecStart=/opt/stackstorm/st2/bin/st2notifier $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2rulesengine.service b/packages/st2/debian/st2rulesengine.service index c2ae7b0bee..5747154368 100644 --- a/packages/st2/debian/st2rulesengine.service +++ b/packages/st2/debian/st2rulesengine.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2rulesengine +EnvironmentFile=-/etc/default/st2rulesengine ExecStart=/opt/stackstorm/st2/bin/st2rulesengine $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2sensorcontainer.service b/packages/st2/debian/st2sensorcontainer.service index d4f0674436..67ec0898b6 100644 --- a/packages/st2/debian/st2sensorcontainer.service +++ b/packages/st2/debian/st2sensorcontainer.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2sensorcontainer +EnvironmentFile=-/etc/default/st2sensorcontainer ExecStart=/opt/stackstorm/st2/bin/st2sensorcontainer $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index 07cc48863c..1d89d30cb6 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/sysconfig/st2stream +EnvironmentFile=-/etc/default/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true From 09d73520cc7a483a2dcdf16d185d571c89d13bfc Mon Sep 17 00:00:00 2001 From: Kirill Enykeev Date: Tue, 26 Jul 2016 11:41:10 +0700 Subject: [PATCH 28/50] Revert "Fixes for recent build container changes" Cherry-picked from StackStorm/st2-packages@94a6cf7a76ffb0dbfdc7dd81decd48b7349df525 --- packages/st2/debian/st2actionrunner.service | 2 +- packages/st2/debian/st2actionrunner@.service | 2 +- packages/st2/debian/st2api.service | 2 +- packages/st2/debian/st2auth.service | 2 +- packages/st2/debian/st2garbagecollector.service | 2 +- packages/st2/debian/st2notifier.service | 2 +- packages/st2/debian/st2rulesengine.service | 2 +- packages/st2/debian/st2sensorcontainer.service | 2 +- packages/st2/debian/st2stream.service | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/st2/debian/st2actionrunner.service b/packages/st2/debian/st2actionrunner.service index 8f8ff33bde..4e00cdf9a0 100644 --- a/packages/st2/debian/st2actionrunner.service +++ b/packages/st2/debian/st2actionrunner.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=oneshot -EnvironmentFile=-/etc/default/st2actionrunner +EnvironmentFile=-/etc/sysconfig/st2actionrunner ExecStart=/bin/bash /opt/stackstorm/st2/bin/runners.sh start ExecStop=/bin/bash /opt/stackstorm/st2/bin/runners.sh stop RemainAfterExit=true diff --git a/packages/st2/debian/st2actionrunner@.service b/packages/st2/debian/st2actionrunner@.service index dbc8f993b5..86a68afd8d 100644 --- a/packages/st2/debian/st2actionrunner@.service +++ b/packages/st2/debian/st2actionrunner@.service @@ -9,7 +9,7 @@ Group=st2packs UMask=002 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" Environment="WORKERID=%i" -EnvironmentFile=-/etc/default/st2actionrunner +EnvironmentFile=-/etc/sysconfig/st2actionrunner ExecStart=/opt/stackstorm/st2/bin/st2actionrunner $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index 6170680a04..fddaf88039 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/default/st2api +EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index 800bcc8002..e72cc317a9 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/default/st2auth +EnvironmentFile=-/etc/sysconfig/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2garbagecollector.service b/packages/st2/debian/st2garbagecollector.service index 5d3061534a..62ff423930 100644 --- a/packages/st2/debian/st2garbagecollector.service +++ b/packages/st2/debian/st2garbagecollector.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/default/st2garbagecollector +EnvironmentFile=-/etc/sysconfig/st2garbagecollector ExecStart=/opt/stackstorm/st2/bin/st2garbagecollector $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2notifier.service b/packages/st2/debian/st2notifier.service index 31df3f3411..d0f098955d 100644 --- a/packages/st2/debian/st2notifier.service +++ b/packages/st2/debian/st2notifier.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/default/st2notifier +EnvironmentFile=-/etc/sysconfig/st2notifier ExecStart=/opt/stackstorm/st2/bin/st2notifier $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2rulesengine.service b/packages/st2/debian/st2rulesengine.service index 5747154368..c2ae7b0bee 100644 --- a/packages/st2/debian/st2rulesengine.service +++ b/packages/st2/debian/st2rulesengine.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/default/st2rulesengine +EnvironmentFile=-/etc/sysconfig/st2rulesengine ExecStart=/opt/stackstorm/st2/bin/st2rulesengine $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2sensorcontainer.service b/packages/st2/debian/st2sensorcontainer.service index 67ec0898b6..d4f0674436 100644 --- a/packages/st2/debian/st2sensorcontainer.service +++ b/packages/st2/debian/st2sensorcontainer.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/default/st2sensorcontainer +EnvironmentFile=-/etc/sysconfig/st2sensorcontainer ExecStart=/opt/stackstorm/st2/bin/st2sensorcontainer $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index 1d89d30cb6..07cc48863c 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/default/st2stream +EnvironmentFile=-/etc/sysconfig/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true From e064086fc7faaf4d98636db0e1a029fe2596c78e Mon Sep 17 00:00:00 2001 From: armab Date: Wed, 3 Aug 2016 14:42:24 +0300 Subject: [PATCH 29/50] Use correct environment path for debian family systems Cherry-picked from StackStorm/st2-packages@cf0669b848693ab42b095b5979354cc2eb6b6fe9 --- packages/st2/debian/st2actionrunner.service | 2 +- packages/st2/debian/st2actionrunner@.service | 2 +- packages/st2/debian/st2api.service | 2 +- packages/st2/debian/st2auth.service | 2 +- packages/st2/debian/st2garbagecollector.service | 2 +- packages/st2/debian/st2notifier.service | 2 +- packages/st2/debian/st2rulesengine.service | 2 +- packages/st2/debian/st2sensorcontainer.service | 2 +- packages/st2/debian/st2stream.service | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/st2/debian/st2actionrunner.service b/packages/st2/debian/st2actionrunner.service index 4e00cdf9a0..8f8ff33bde 100644 --- a/packages/st2/debian/st2actionrunner.service +++ b/packages/st2/debian/st2actionrunner.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=oneshot -EnvironmentFile=-/etc/sysconfig/st2actionrunner +EnvironmentFile=-/etc/default/st2actionrunner ExecStart=/bin/bash /opt/stackstorm/st2/bin/runners.sh start ExecStop=/bin/bash /opt/stackstorm/st2/bin/runners.sh stop RemainAfterExit=true diff --git a/packages/st2/debian/st2actionrunner@.service b/packages/st2/debian/st2actionrunner@.service index 86a68afd8d..dbc8f993b5 100644 --- a/packages/st2/debian/st2actionrunner@.service +++ b/packages/st2/debian/st2actionrunner@.service @@ -9,7 +9,7 @@ Group=st2packs UMask=002 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" Environment="WORKERID=%i" -EnvironmentFile=-/etc/sysconfig/st2actionrunner +EnvironmentFile=-/etc/default/st2actionrunner ExecStart=/opt/stackstorm/st2/bin/st2actionrunner $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index fddaf88039..6170680a04 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/sysconfig/st2api +EnvironmentFile=-/etc/default/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index e72cc317a9..800bcc8002 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/sysconfig/st2auth +EnvironmentFile=-/etc/default/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2garbagecollector.service b/packages/st2/debian/st2garbagecollector.service index 62ff423930..5d3061534a 100644 --- a/packages/st2/debian/st2garbagecollector.service +++ b/packages/st2/debian/st2garbagecollector.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2garbagecollector +EnvironmentFile=-/etc/default/st2garbagecollector ExecStart=/opt/stackstorm/st2/bin/st2garbagecollector $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2notifier.service b/packages/st2/debian/st2notifier.service index d0f098955d..31df3f3411 100644 --- a/packages/st2/debian/st2notifier.service +++ b/packages/st2/debian/st2notifier.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2notifier +EnvironmentFile=-/etc/default/st2notifier ExecStart=/opt/stackstorm/st2/bin/st2notifier $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2rulesengine.service b/packages/st2/debian/st2rulesengine.service index c2ae7b0bee..5747154368 100644 --- a/packages/st2/debian/st2rulesengine.service +++ b/packages/st2/debian/st2rulesengine.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2rulesengine +EnvironmentFile=-/etc/default/st2rulesengine ExecStart=/opt/stackstorm/st2/bin/st2rulesengine $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2sensorcontainer.service b/packages/st2/debian/st2sensorcontainer.service index d4f0674436..67ec0898b6 100644 --- a/packages/st2/debian/st2sensorcontainer.service +++ b/packages/st2/debian/st2sensorcontainer.service @@ -7,7 +7,7 @@ Type=simple User=st2 Group=st2 Environment="DAEMON_ARGS=--config-file /etc/st2/st2.conf" -EnvironmentFile=-/etc/sysconfig/st2sensorcontainer +EnvironmentFile=-/etc/default/st2sensorcontainer ExecStart=/opt/stackstorm/st2/bin/st2sensorcontainer $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index 07cc48863c..1d89d30cb6 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -7,7 +7,7 @@ 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" -EnvironmentFile=-/etc/sysconfig/st2stream +EnvironmentFile=-/etc/default/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true From c52aed3b3ec7273557f975c3713ea39304c438a3 Mon Sep 17 00:00:00 2001 From: Kirill Izotov Date: Fri, 17 Feb 2017 12:51:33 +0700 Subject: [PATCH 30/50] Update unit files for new REST services Cherry-picked from StackStorm/st2-packages@ab0d3121559269a4a8419945d3f57a4ae7470424 --- packages/st2/debian/st2api.service | 2 +- packages/st2/debian/st2auth.service | 2 +- packages/st2/debian/st2stream.service | 2 +- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- packages/st2/rpm/st2stream.service | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index 6170680a04..aa0b89d4aa 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/default/st2api -ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index 800bcc8002..a71e3e4a74 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/default/st2auth -ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index 1d89d30cb6..410c0f79eb 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9102 --workers 1 --threads 10 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/default/st2stream -ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index fddaf88039..afe4c7483b 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2api -ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2api/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index e72cc317a9..1d2d3d50d0 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2auth -ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2auth/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure diff --git a/packages/st2/rpm/st2stream.service b/packages/st2/rpm/st2stream.service index 07cc48863c..1c526d139d 100644 --- a/packages/st2/rpm/st2stream.service +++ b/packages/st2/rpm/st2stream.service @@ -8,7 +8,7 @@ User=st2 Group=st2 Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9102 --workers 1 --threads 10 --graceful-timeout 10 --timeout 30" EnvironmentFile=-/etc/sysconfig/st2stream -ExecStart=/opt/stackstorm/st2/bin/gunicorn_pecan /opt/stackstorm/st2/lib/python2.7/site-packages/st2stream/gunicorn_config.py $DAEMON_ARGS +ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS TimeoutSec=60 PrivateTmp=true Restart=on-failure From 0e25bf1455752eea830c8b9a4e10aeba9cac0328 Mon Sep 17 00:00:00 2001 From: armab Date: Mon, 6 Mar 2017 17:38:24 +0200 Subject: [PATCH 31/50] Add systemd socket files for Xenial Cherry-picked from StackStorm/st2-packages@c73984a802690f46b9a3528c97dc889188d8b4a6 --- packages/st2/debian/st2api.service | 3 ++- packages/st2/debian/st2api.socket | 9 +++++++++ packages/st2/debian/st2auth.service | 3 ++- packages/st2/debian/st2auth.socket | 9 +++++++++ packages/st2/debian/st2stream.service | 3 ++- packages/st2/debian/st2stream.socket | 9 +++++++++ 6 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 packages/st2/debian/st2api.socket create mode 100644 packages/st2/debian/st2auth.socket create mode 100644 packages/st2/debian/st2stream.socket diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index aa0b89d4aa..b1eba284df 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2api -After=network.target +After=network.target st2api.socket +Requires=st2api.socket [Service] Type=simple diff --git a/packages/st2/debian/st2api.socket b/packages/st2/debian/st2api.socket new file mode 100644 index 0000000000..ed32dec55a --- /dev/null +++ b/packages/st2/debian/st2api.socket @@ -0,0 +1,9 @@ +[Unit] +Description=StackStorm st2api Socket +PartOf=st2api.service + +[Socket] +ListenStream=127.0.0.1:9101 + +[Install] +WantedBy=sockets.target diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index a71e3e4a74..5f80dfd768 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2auth -After=network.target +After=network.target st2auth.socket +Requires=st2auth.socket [Service] Type=simple diff --git a/packages/st2/debian/st2auth.socket b/packages/st2/debian/st2auth.socket new file mode 100644 index 0000000000..63d7d1d4ec --- /dev/null +++ b/packages/st2/debian/st2auth.socket @@ -0,0 +1,9 @@ +[Unit] +Description=StackStorm st2auth Socket +PartOf=st2auth.service + +[Socket] +ListenStream=127.0.0.1:9100 + +[Install] +WantedBy=sockets.target diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index 410c0f79eb..9e95eaa42d 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2stream -After=network.target +After=network.target st2stream.socket +Requires=st2stream.socket [Service] Type=simple diff --git a/packages/st2/debian/st2stream.socket b/packages/st2/debian/st2stream.socket new file mode 100644 index 0000000000..56571e8713 --- /dev/null +++ b/packages/st2/debian/st2stream.socket @@ -0,0 +1,9 @@ +[Unit] +Description=StackStorm st2stream Socket +PartOf=st2stream.service + +[Socket] +ListenStream=127.0.0.1:9102 + +[Install] +WantedBy=sockets.target From 97a789d7822a994d69c20e22a70d9b2bd29339bc Mon Sep 17 00:00:00 2001 From: armab Date: Mon, 13 Mar 2017 18:17:52 +0200 Subject: [PATCH 32/50] Add systemd socket files for EL7 Cherry-picked from StackStorm/st2-packages@294536f0df6f6c065d1f051d31e37fa3ebfa9d58 --- packages/st2/rpm/st2api.service | 3 ++- packages/st2/rpm/st2api.socket | 9 +++++++++ packages/st2/rpm/st2auth.service | 3 ++- packages/st2/rpm/st2auth.socket | 9 +++++++++ packages/st2/rpm/st2stream.service | 3 ++- packages/st2/rpm/st2stream.socket | 9 +++++++++ 6 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 packages/st2/rpm/st2api.socket create mode 100644 packages/st2/rpm/st2auth.socket create mode 100644 packages/st2/rpm/st2stream.socket diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index afe4c7483b..38b8af9831 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2api -After=network.target +After=network.target st2api.socket +Requires=st2api.socket [Service] Type=simple diff --git a/packages/st2/rpm/st2api.socket b/packages/st2/rpm/st2api.socket new file mode 100644 index 0000000000..ed32dec55a --- /dev/null +++ b/packages/st2/rpm/st2api.socket @@ -0,0 +1,9 @@ +[Unit] +Description=StackStorm st2api Socket +PartOf=st2api.service + +[Socket] +ListenStream=127.0.0.1:9101 + +[Install] +WantedBy=sockets.target diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index 1d2d3d50d0..c824235ef6 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2auth -After=network.target +After=network.target st2auth.socket +Requires=st2auth.socket [Service] Type=simple diff --git a/packages/st2/rpm/st2auth.socket b/packages/st2/rpm/st2auth.socket new file mode 100644 index 0000000000..63d7d1d4ec --- /dev/null +++ b/packages/st2/rpm/st2auth.socket @@ -0,0 +1,9 @@ +[Unit] +Description=StackStorm st2auth Socket +PartOf=st2auth.service + +[Socket] +ListenStream=127.0.0.1:9100 + +[Install] +WantedBy=sockets.target diff --git a/packages/st2/rpm/st2stream.service b/packages/st2/rpm/st2stream.service index 1c526d139d..eaaf66f7a9 100644 --- a/packages/st2/rpm/st2stream.service +++ b/packages/st2/rpm/st2stream.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2stream -After=network.target +After=network.target st2stream.socket +Requires=st2stream.socket [Service] Type=simple diff --git a/packages/st2/rpm/st2stream.socket b/packages/st2/rpm/st2stream.socket new file mode 100644 index 0000000000..56571e8713 --- /dev/null +++ b/packages/st2/rpm/st2stream.socket @@ -0,0 +1,9 @@ +[Unit] +Description=StackStorm st2stream Socket +PartOf=st2stream.service + +[Socket] +ListenStream=127.0.0.1:9102 + +[Install] +WantedBy=sockets.target From 797a84a067f505ece2af7fd2f9ffb6c498cbed74 Mon Sep 17 00:00:00 2001 From: Kirill Izotov Date: Tue, 25 Apr 2017 14:28:48 +0700 Subject: [PATCH 33/50] Share private /tmp folder between actionrunner instances Cherry-picked from StackStorm/st2-packages@72a93c6200bc43a14b67f43ecd77f852beeecc07 --- packages/st2/debian/st2actionrunner.service | 1 + packages/st2/debian/st2actionrunner@.service | 1 + packages/st2/rpm/st2actionrunner.service | 1 + packages/st2/rpm/st2actionrunner@.service | 1 + 4 files changed, 4 insertions(+) diff --git a/packages/st2/debian/st2actionrunner.service b/packages/st2/debian/st2actionrunner.service index 8f8ff33bde..e0db64250b 100644 --- a/packages/st2/debian/st2actionrunner.service +++ b/packages/st2/debian/st2actionrunner.service @@ -7,6 +7,7 @@ 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] diff --git a/packages/st2/debian/st2actionrunner@.service b/packages/st2/debian/st2actionrunner@.service index dbc8f993b5..f77a8707d4 100644 --- a/packages/st2/debian/st2actionrunner@.service +++ b/packages/st2/debian/st2actionrunner@.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2actionrunner After=network.target +JoinsNamespaceOf=st2actionrunner.service [Service] Type=simple diff --git a/packages/st2/rpm/st2actionrunner.service b/packages/st2/rpm/st2actionrunner.service index 4e00cdf9a0..5d4f4e43e3 100644 --- a/packages/st2/rpm/st2actionrunner.service +++ b/packages/st2/rpm/st2actionrunner.service @@ -7,6 +7,7 @@ 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] diff --git a/packages/st2/rpm/st2actionrunner@.service b/packages/st2/rpm/st2actionrunner@.service index 86a68afd8d..2e1e971f41 100644 --- a/packages/st2/rpm/st2actionrunner@.service +++ b/packages/st2/rpm/st2actionrunner@.service @@ -1,6 +1,7 @@ [Unit] Description=StackStorm service st2actionrunner After=network.target +JoinsNamespaceOf=st2actionrunner.service [Service] Type=simple From ae60541a0830696f65c00dd620bcebe282e89642 Mon Sep 17 00:00:00 2001 From: Lakshmi Kannan Date: Mon, 18 Jun 2018 14:48:00 -0400 Subject: [PATCH 34/50] Add init files for all OSes for st2timersengine [ci skip] Cherry-picked from StackStorm/st2-packages@b9144ae742842801a1c5142d053d4b6bf6d8d6e7 --- packages/st2/debian/st2timersengine.service | 18 ++++++++++++++++++ packages/st2/rpm/st2timersengine.sevice | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 packages/st2/debian/st2timersengine.service create mode 100644 packages/st2/rpm/st2timersengine.sevice diff --git a/packages/st2/debian/st2timersengine.service b/packages/st2/debian/st2timersengine.service new file mode 100644 index 0000000000..768b07f30a --- /dev/null +++ b/packages/st2/debian/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/packages/st2/rpm/st2timersengine.sevice b/packages/st2/rpm/st2timersengine.sevice new file mode 100644 index 0000000000..f48606a710 --- /dev/null +++ b/packages/st2/rpm/st2timersengine.sevice @@ -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 From 5e66153efdd0e42f5fe861c0866f38c5715a06ca Mon Sep 17 00:00:00 2001 From: Lakshmi Kannan Date: Tue, 19 Jun 2018 15:24:00 -0400 Subject: [PATCH 35/50] Typo in service file name Cherry-picked from StackStorm/st2-packages@ec7a3df0f9fbe5b448668e5c7f3d5337f5f83baa --- .../st2/rpm/{st2timersengine.sevice => st2timersengine.service} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/st2/rpm/{st2timersengine.sevice => st2timersengine.service} (100%) diff --git a/packages/st2/rpm/st2timersengine.sevice b/packages/st2/rpm/st2timersengine.service similarity index 100% rename from packages/st2/rpm/st2timersengine.sevice rename to packages/st2/rpm/st2timersengine.service From 45634637a1a00b200d7ab6737220e2c316d548be Mon Sep 17 00:00:00 2001 From: Winson Chan Date: Thu, 21 Jun 2018 02:49:48 +0000 Subject: [PATCH 36/50] Add st2workflowengine service Add systemd service files for st2workflowengine. Cherry-picked from StackStorm/st2-packages@cef2f1252ba9b068fde8de586096a1930418e18d --- packages/st2/debian/st2workflowengine.service | 18 ++++++++++++++++++ packages/st2/rpm/st2workflowengine.service | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 packages/st2/debian/st2workflowengine.service create mode 100644 packages/st2/rpm/st2workflowengine.service diff --git a/packages/st2/debian/st2workflowengine.service b/packages/st2/debian/st2workflowengine.service new file mode 100644 index 0000000000..5c9c96733a --- /dev/null +++ b/packages/st2/debian/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/packages/st2/rpm/st2workflowengine.service b/packages/st2/rpm/st2workflowengine.service new file mode 100644 index 0000000000..537c20ddd9 --- /dev/null +++ b/packages/st2/rpm/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 From 0931407d3fc7461969809670358d469d98c47c94 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 27 Jun 2018 13:37:11 +0200 Subject: [PATCH 37/50] Install and use special gunicorn logging config file for all gunicorn API based services. This way we don't miss various log messages generated by gunicorn worker processes. Corresponding StackStorm/st2 change: https://github.com/StackStorm/st2/pull/4206 Cherry-picked from StackStorm/st2-packages@1c1a704de290f02994bfe5515f5b6ef60747ba0b --- packages/st2/debian/st2api.service | 2 +- packages/st2/debian/st2auth.service | 2 +- packages/st2/debian/st2stream.service | 2 +- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- packages/st2/rpm/st2stream.service | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index b1eba284df..7d7ca502c8 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -7,7 +7,7 @@ Requires=st2api.socket 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" +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" EnvironmentFile=-/etc/default/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index 5f80dfd768..9c51f5a1e0 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -7,7 +7,7 @@ Requires=st2auth.socket 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" +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" EnvironmentFile=-/etc/default/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index 9e95eaa42d..6ac666d8f3 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -7,7 +7,7 @@ Requires=st2stream.socket 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" +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" EnvironmentFile=-/etc/default/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index 38b8af9831..ed8666157d 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -7,7 +7,7 @@ Requires=st2api.socket 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" +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" EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index c824235ef6..389444c633 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -7,7 +7,7 @@ Requires=st2auth.socket 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" +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" EnvironmentFile=-/etc/sysconfig/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2stream.service b/packages/st2/rpm/st2stream.service index eaaf66f7a9..0c52dd3238 100644 --- a/packages/st2/rpm/st2stream.service +++ b/packages/st2/rpm/st2stream.service @@ -7,7 +7,7 @@ Requires=st2stream.socket 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" +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" EnvironmentFile=-/etc/sysconfig/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS TimeoutSec=60 From bd07ef32cc99c5d26ac9333869b9bf5191013c6a Mon Sep 17 00:00:00 2001 From: bigmstone Date: Mon, 8 Oct 2018 22:50:43 -0500 Subject: [PATCH 38/50] Adding scheduler Cherry-picked from StackStorm/st2-packages@0dfb95c2b5c85b46070d51470e78e56f90d66422 --- packages/st2/debian/st2scheduler.service | 18 ++++++++++++++++++ packages/st2/rpm/st2scheduler.service | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 packages/st2/debian/st2scheduler.service create mode 100644 packages/st2/rpm/st2scheduler.service diff --git a/packages/st2/debian/st2scheduler.service b/packages/st2/debian/st2scheduler.service new file mode 100644 index 0000000000..ff87ab9e3a --- /dev/null +++ b/packages/st2/debian/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/packages/st2/rpm/st2scheduler.service b/packages/st2/rpm/st2scheduler.service new file mode 100644 index 0000000000..725b46832b --- /dev/null +++ b/packages/st2/rpm/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 From c782c218be53c286f4400e71b34e3d531b3e79fa Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 8 Apr 2019 10:02:10 +0200 Subject: [PATCH 39/50] Make sure we log gunicorn st2api,st2auth,st2stream errors to a log file. Previously they were simply ignored. Cherry-picked from StackStorm/st2-packages@7ed01d65ee9e07b98263dd57a41c33da13ca7722 --- packages/st2/debian/st2api.service | 2 +- packages/st2/debian/st2auth.service | 2 +- packages/st2/debian/st2stream.service | 2 +- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- packages/st2/rpm/st2stream.service | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index 7d7ca502c8..9a06a319f7 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -7,7 +7,7 @@ Requires=st2api.socket 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" +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.gunicorn.error.log" EnvironmentFile=-/etc/default/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index 9c51f5a1e0..50a741007d 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -7,7 +7,7 @@ Requires=st2auth.socket 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" +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.gunicorn.error.log" EnvironmentFile=-/etc/default/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index 6ac666d8f3..cc3235b053 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -7,7 +7,7 @@ Requires=st2stream.socket 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" +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.gunicorn.error.log" EnvironmentFile=-/etc/default/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index ed8666157d..aeda7fd803 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -7,7 +7,7 @@ Requires=st2api.socket 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" +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.gunicorn.error.log" EnvironmentFile=-/etc/sysconfig/st2api ExecStart=/opt/stackstorm/st2/bin/gunicorn st2api.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index 389444c633..2c995669bb 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -7,7 +7,7 @@ Requires=st2auth.socket 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" +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.gunicorn.error.log" EnvironmentFile=-/etc/sysconfig/st2auth ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS TimeoutSec=60 diff --git a/packages/st2/rpm/st2stream.service b/packages/st2/rpm/st2stream.service index 0c52dd3238..e155922060 100644 --- a/packages/st2/rpm/st2stream.service +++ b/packages/st2/rpm/st2stream.service @@ -7,7 +7,7 @@ Requires=st2stream.socket 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" +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.gunicorn.error.log" EnvironmentFile=-/etc/sysconfig/st2stream ExecStart=/opt/stackstorm/st2/bin/gunicorn st2stream.wsgi:application $DAEMON_ARGS TimeoutSec=60 From c1593ac42fd9010da43338d22535e76ac05b35d2 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 8 Apr 2019 10:20:53 +0200 Subject: [PATCH 40/50] We can log gunicorn error logs to the existing API service log file. Cherry-picked from StackStorm/st2-packages@fe50ab82630ca199b4216fb27369f0be5d2bfdba --- packages/st2/debian/st2api.service | 2 +- packages/st2/debian/st2auth.service | 2 +- packages/st2/debian/st2stream.service | 2 +- packages/st2/rpm/st2api.service | 2 +- packages/st2/rpm/st2auth.service | 2 +- packages/st2/rpm/st2stream.service | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/st2/debian/st2api.service b/packages/st2/debian/st2api.service index 9a06a319f7..1921126db6 100644 --- a/packages/st2/debian/st2api.service +++ b/packages/st2/debian/st2api.service @@ -7,7 +7,7 @@ Requires=st2api.socket 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.gunicorn.error.log" +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 diff --git a/packages/st2/debian/st2auth.service b/packages/st2/debian/st2auth.service index 50a741007d..54420192f8 100644 --- a/packages/st2/debian/st2auth.service +++ b/packages/st2/debian/st2auth.service @@ -7,7 +7,7 @@ Requires=st2auth.socket 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.gunicorn.error.log" +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 diff --git a/packages/st2/debian/st2stream.service b/packages/st2/debian/st2stream.service index cc3235b053..ade3ba5ddd 100644 --- a/packages/st2/debian/st2stream.service +++ b/packages/st2/debian/st2stream.service @@ -7,7 +7,7 @@ Requires=st2stream.socket 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.gunicorn.error.log" +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 diff --git a/packages/st2/rpm/st2api.service b/packages/st2/rpm/st2api.service index aeda7fd803..1b59b9b9c9 100644 --- a/packages/st2/rpm/st2api.service +++ b/packages/st2/rpm/st2api.service @@ -7,7 +7,7 @@ Requires=st2api.socket 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.gunicorn.error.log" +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 diff --git a/packages/st2/rpm/st2auth.service b/packages/st2/rpm/st2auth.service index 2c995669bb..260a785365 100644 --- a/packages/st2/rpm/st2auth.service +++ b/packages/st2/rpm/st2auth.service @@ -7,7 +7,7 @@ Requires=st2auth.socket 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.gunicorn.error.log" +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 diff --git a/packages/st2/rpm/st2stream.service b/packages/st2/rpm/st2stream.service index e155922060..742cc20384 100644 --- a/packages/st2/rpm/st2stream.service +++ b/packages/st2/rpm/st2stream.service @@ -7,7 +7,7 @@ Requires=st2stream.socket 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.gunicorn.error.log" +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 From 0aab4a48bb5280109d0a5156949d2a3e7a8b32e6 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 13 Jun 2021 10:54:28 +0200 Subject: [PATCH 41/50] Move static socket unit definitions to generators Cherry-picked from StackStorm/st2-packages@7c40c653d4504ded35df2e17229ef484a1cdc6da --- packages/st2/debian/st2api-generator | 48 +++++++++++++++++++++++++ packages/st2/debian/st2api.socket | 9 ----- packages/st2/debian/st2auth-generator | 48 +++++++++++++++++++++++++ packages/st2/debian/st2auth.socket | 9 ----- packages/st2/debian/st2stream-generator | 48 +++++++++++++++++++++++++ packages/st2/debian/st2stream.socket | 9 ----- packages/st2/rpm/st2api-generator | 48 +++++++++++++++++++++++++ packages/st2/rpm/st2api.socket | 9 ----- packages/st2/rpm/st2auth-generator | 48 +++++++++++++++++++++++++ packages/st2/rpm/st2auth.socket | 9 ----- packages/st2/rpm/st2stream-generator | 48 +++++++++++++++++++++++++ packages/st2/rpm/st2stream.socket | 9 ----- 12 files changed, 288 insertions(+), 54 deletions(-) create mode 100644 packages/st2/debian/st2api-generator delete mode 100644 packages/st2/debian/st2api.socket create mode 100644 packages/st2/debian/st2auth-generator delete mode 100644 packages/st2/debian/st2auth.socket create mode 100644 packages/st2/debian/st2stream-generator delete mode 100644 packages/st2/debian/st2stream.socket create mode 100644 packages/st2/rpm/st2api-generator delete mode 100644 packages/st2/rpm/st2api.socket create mode 100644 packages/st2/rpm/st2auth-generator delete mode 100644 packages/st2/rpm/st2auth.socket create mode 100644 packages/st2/rpm/st2stream-generator delete mode 100644 packages/st2/rpm/st2stream.socket diff --git a/packages/st2/debian/st2api-generator b/packages/st2/debian/st2api-generator new file mode 100644 index 0000000000..f4c7a42765 --- /dev/null +++ b/packages/st2/debian/st2api-generator @@ -0,0 +1,48 @@ +#!/bin/bash + +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +ST2SVC="st2api" +DEFAULT_IP="127.0.0.1" +DEFFALT_PORT="9101" + +function nolog() { + true +} + +function debug() { + echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +} + +function writef() { + # cat with bash here document requires write access to a tmp directory which is unavailable when + # generators are run during boot because the root filesystem is mounted readonly, so we use echo. + echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" +} + +function log() { + # call nolog / debug to enable/disable logging. + nolog "$1" +} + +log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" + +BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) +log "Host bind='${BIND_HOST}'" + +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +log "Host port='${BIND_PORT}'" + +writef "[Unit]" +writef "Description=StackStorm ${ST2SVC} Socket generated by $0" +writef "PartOf=${ST2SVC}.service" +writef "" +writef "[Socket]" +writef "ListenStream=${BIND_HOST}:${BIND_PORT}" +writef "" +writef "[Install]" +writef "WantedBy=sockets.target" + +log "${ST2SVC} generated." diff --git a/packages/st2/debian/st2api.socket b/packages/st2/debian/st2api.socket deleted file mode 100644 index ed32dec55a..0000000000 --- a/packages/st2/debian/st2api.socket +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=StackStorm st2api Socket -PartOf=st2api.service - -[Socket] -ListenStream=127.0.0.1:9101 - -[Install] -WantedBy=sockets.target diff --git a/packages/st2/debian/st2auth-generator b/packages/st2/debian/st2auth-generator new file mode 100644 index 0000000000..a0ba6bd953 --- /dev/null +++ b/packages/st2/debian/st2auth-generator @@ -0,0 +1,48 @@ +#!/bin/bash + +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +ST2SVC="st2auth" +DEFAULT_IP="127.0.0.1" +DEFFALT_PORT="9100" + +function nolog() { + true +} + +function debug() { + echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +} + +function writef() { + # cat with bash here document requires write access to a tmp directory which is unavailable when + # generators are run during boot because the root filesystem is mounted readonly, so we use echo. + echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" +} + +function log() { + # call nolog / debug to enable/disable logging. + nolog "$1" +} + +log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" + +BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) +log "Host bind='${BIND_HOST}'" + +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +log "Host port='${BIND_PORT}'" + +writef "[Unit]" +writef "Description=StackStorm ${ST2SVC} Socket generated by $0" +writef "PartOf=${ST2SVC}.service" +writef "" +writef "[Socket]" +writef "ListenStream=${BIND_HOST}:${BIND_PORT}" +writef "" +writef "[Install]" +writef "WantedBy=sockets.target" + +log "${ST2SVC} generated." diff --git a/packages/st2/debian/st2auth.socket b/packages/st2/debian/st2auth.socket deleted file mode 100644 index 63d7d1d4ec..0000000000 --- a/packages/st2/debian/st2auth.socket +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=StackStorm st2auth Socket -PartOf=st2auth.service - -[Socket] -ListenStream=127.0.0.1:9100 - -[Install] -WantedBy=sockets.target diff --git a/packages/st2/debian/st2stream-generator b/packages/st2/debian/st2stream-generator new file mode 100644 index 0000000000..5ca2065d70 --- /dev/null +++ b/packages/st2/debian/st2stream-generator @@ -0,0 +1,48 @@ +#!/bin/bash + +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +ST2SVC="st2stream" +DEFAULT_IP="127.0.0.1" +DEFFALT_PORT="9102" + +function nolog() { + true +} + +function debug() { + echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +} + +function writef() { + # cat with bash here document requires write access to a tmp directory which is unavailable when + # generators are run during boot because the root filesystem is mounted readonly, so we use echo. + echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" +} + +function log() { + # call nolog / debug to enable/disable logging. + nolog "$1" +} + +log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" + +BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) +log "Host bind='${BIND_HOST}'" + +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +log "Host port='${BIND_PORT}'" + +writef "[Unit]" +writef "Description=StackStorm ${ST2SVC} Socket generated by $0" +writef "PartOf=${ST2SVC}.service" +writef "" +writef "[Socket]" +writef "ListenStream=${BIND_HOST}:${BIND_PORT}" +writef "" +writef "[Install]" +writef "WantedBy=sockets.target" + +log "${ST2SVC} generated." diff --git a/packages/st2/debian/st2stream.socket b/packages/st2/debian/st2stream.socket deleted file mode 100644 index 56571e8713..0000000000 --- a/packages/st2/debian/st2stream.socket +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=StackStorm st2stream Socket -PartOf=st2stream.service - -[Socket] -ListenStream=127.0.0.1:9102 - -[Install] -WantedBy=sockets.target diff --git a/packages/st2/rpm/st2api-generator b/packages/st2/rpm/st2api-generator new file mode 100644 index 0000000000..f4c7a42765 --- /dev/null +++ b/packages/st2/rpm/st2api-generator @@ -0,0 +1,48 @@ +#!/bin/bash + +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +ST2SVC="st2api" +DEFAULT_IP="127.0.0.1" +DEFFALT_PORT="9101" + +function nolog() { + true +} + +function debug() { + echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +} + +function writef() { + # cat with bash here document requires write access to a tmp directory which is unavailable when + # generators are run during boot because the root filesystem is mounted readonly, so we use echo. + echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" +} + +function log() { + # call nolog / debug to enable/disable logging. + nolog "$1" +} + +log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" + +BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) +log "Host bind='${BIND_HOST}'" + +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +log "Host port='${BIND_PORT}'" + +writef "[Unit]" +writef "Description=StackStorm ${ST2SVC} Socket generated by $0" +writef "PartOf=${ST2SVC}.service" +writef "" +writef "[Socket]" +writef "ListenStream=${BIND_HOST}:${BIND_PORT}" +writef "" +writef "[Install]" +writef "WantedBy=sockets.target" + +log "${ST2SVC} generated." diff --git a/packages/st2/rpm/st2api.socket b/packages/st2/rpm/st2api.socket deleted file mode 100644 index ed32dec55a..0000000000 --- a/packages/st2/rpm/st2api.socket +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=StackStorm st2api Socket -PartOf=st2api.service - -[Socket] -ListenStream=127.0.0.1:9101 - -[Install] -WantedBy=sockets.target diff --git a/packages/st2/rpm/st2auth-generator b/packages/st2/rpm/st2auth-generator new file mode 100644 index 0000000000..a0ba6bd953 --- /dev/null +++ b/packages/st2/rpm/st2auth-generator @@ -0,0 +1,48 @@ +#!/bin/bash + +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +ST2SVC="st2auth" +DEFAULT_IP="127.0.0.1" +DEFFALT_PORT="9100" + +function nolog() { + true +} + +function debug() { + echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +} + +function writef() { + # cat with bash here document requires write access to a tmp directory which is unavailable when + # generators are run during boot because the root filesystem is mounted readonly, so we use echo. + echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" +} + +function log() { + # call nolog / debug to enable/disable logging. + nolog "$1" +} + +log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" + +BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) +log "Host bind='${BIND_HOST}'" + +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +log "Host port='${BIND_PORT}'" + +writef "[Unit]" +writef "Description=StackStorm ${ST2SVC} Socket generated by $0" +writef "PartOf=${ST2SVC}.service" +writef "" +writef "[Socket]" +writef "ListenStream=${BIND_HOST}:${BIND_PORT}" +writef "" +writef "[Install]" +writef "WantedBy=sockets.target" + +log "${ST2SVC} generated." diff --git a/packages/st2/rpm/st2auth.socket b/packages/st2/rpm/st2auth.socket deleted file mode 100644 index 63d7d1d4ec..0000000000 --- a/packages/st2/rpm/st2auth.socket +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=StackStorm st2auth Socket -PartOf=st2auth.service - -[Socket] -ListenStream=127.0.0.1:9100 - -[Install] -WantedBy=sockets.target diff --git a/packages/st2/rpm/st2stream-generator b/packages/st2/rpm/st2stream-generator new file mode 100644 index 0000000000..5ca2065d70 --- /dev/null +++ b/packages/st2/rpm/st2stream-generator @@ -0,0 +1,48 @@ +#!/bin/bash + +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +ST2SVC="st2stream" +DEFAULT_IP="127.0.0.1" +DEFFALT_PORT="9102" + +function nolog() { + true +} + +function debug() { + echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +} + +function writef() { + # cat with bash here document requires write access to a tmp directory which is unavailable when + # generators are run during boot because the root filesystem is mounted readonly, so we use echo. + echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" +} + +function log() { + # call nolog / debug to enable/disable logging. + nolog "$1" +} + +log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" + +BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) +log "Host bind='${BIND_HOST}'" + +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +log "Host port='${BIND_PORT}'" + +writef "[Unit]" +writef "Description=StackStorm ${ST2SVC} Socket generated by $0" +writef "PartOf=${ST2SVC}.service" +writef "" +writef "[Socket]" +writef "ListenStream=${BIND_HOST}:${BIND_PORT}" +writef "" +writef "[Install]" +writef "WantedBy=sockets.target" + +log "${ST2SVC} generated." diff --git a/packages/st2/rpm/st2stream.socket b/packages/st2/rpm/st2stream.socket deleted file mode 100644 index 56571e8713..0000000000 --- a/packages/st2/rpm/st2stream.socket +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=StackStorm st2stream Socket -PartOf=st2stream.service - -[Socket] -ListenStream=127.0.0.1:9102 - -[Install] -WantedBy=sockets.target From f4eb6a88e7661036a5daa462f3256af976e3f7d8 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 14 Jun 2021 01:43:44 +0200 Subject: [PATCH 42/50] Fix typo Cherry-picked from StackStorm/st2-packages@b3a8c467d4b906ec082f509e604f5b8a82a7e719 --- packages/st2/debian/st2api-generator | 4 ++-- packages/st2/debian/st2auth-generator | 4 ++-- packages/st2/debian/st2stream-generator | 4 ++-- packages/st2/rpm/st2api-generator | 4 ++-- packages/st2/rpm/st2auth-generator | 4 ++-- packages/st2/rpm/st2stream-generator | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/st2/debian/st2api-generator b/packages/st2/debian/st2api-generator index f4c7a42765..0a0bb417e8 100644 --- a/packages/st2/debian/st2api-generator +++ b/packages/st2/debian/st2api-generator @@ -6,7 +6,7 @@ LATE_DIR=${3:-/tmp} ST2SVC="st2api" DEFAULT_IP="127.0.0.1" -DEFFALT_PORT="9101" +DEFAULT_PORT="9101" function nolog() { true @@ -32,7 +32,7 @@ log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${L BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) log "Host bind='${BIND_HOST}'" -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) log "Host port='${BIND_PORT}'" writef "[Unit]" diff --git a/packages/st2/debian/st2auth-generator b/packages/st2/debian/st2auth-generator index a0ba6bd953..b3a77e4827 100644 --- a/packages/st2/debian/st2auth-generator +++ b/packages/st2/debian/st2auth-generator @@ -6,7 +6,7 @@ LATE_DIR=${3:-/tmp} ST2SVC="st2auth" DEFAULT_IP="127.0.0.1" -DEFFALT_PORT="9100" +DEFAULT_PORT="9100" function nolog() { true @@ -32,7 +32,7 @@ log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${L BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) log "Host bind='${BIND_HOST}'" -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) log "Host port='${BIND_PORT}'" writef "[Unit]" diff --git a/packages/st2/debian/st2stream-generator b/packages/st2/debian/st2stream-generator index 5ca2065d70..444686b5f3 100644 --- a/packages/st2/debian/st2stream-generator +++ b/packages/st2/debian/st2stream-generator @@ -6,7 +6,7 @@ LATE_DIR=${3:-/tmp} ST2SVC="st2stream" DEFAULT_IP="127.0.0.1" -DEFFALT_PORT="9102" +DEFAULT_PORT="9102" function nolog() { true @@ -32,7 +32,7 @@ log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${L BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) log "Host bind='${BIND_HOST}'" -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) log "Host port='${BIND_PORT}'" writef "[Unit]" diff --git a/packages/st2/rpm/st2api-generator b/packages/st2/rpm/st2api-generator index f4c7a42765..0a0bb417e8 100644 --- a/packages/st2/rpm/st2api-generator +++ b/packages/st2/rpm/st2api-generator @@ -6,7 +6,7 @@ LATE_DIR=${3:-/tmp} ST2SVC="st2api" DEFAULT_IP="127.0.0.1" -DEFFALT_PORT="9101" +DEFAULT_PORT="9101" function nolog() { true @@ -32,7 +32,7 @@ log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${L BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) log "Host bind='${BIND_HOST}'" -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) log "Host port='${BIND_PORT}'" writef "[Unit]" diff --git a/packages/st2/rpm/st2auth-generator b/packages/st2/rpm/st2auth-generator index a0ba6bd953..b3a77e4827 100644 --- a/packages/st2/rpm/st2auth-generator +++ b/packages/st2/rpm/st2auth-generator @@ -6,7 +6,7 @@ LATE_DIR=${3:-/tmp} ST2SVC="st2auth" DEFAULT_IP="127.0.0.1" -DEFFALT_PORT="9100" +DEFAULT_PORT="9100" function nolog() { true @@ -32,7 +32,7 @@ log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${L BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) log "Host bind='${BIND_HOST}'" -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) log "Host port='${BIND_PORT}'" writef "[Unit]" diff --git a/packages/st2/rpm/st2stream-generator b/packages/st2/rpm/st2stream-generator index 5ca2065d70..444686b5f3 100644 --- a/packages/st2/rpm/st2stream-generator +++ b/packages/st2/rpm/st2stream-generator @@ -6,7 +6,7 @@ LATE_DIR=${3:-/tmp} ST2SVC="st2stream" DEFAULT_IP="127.0.0.1" -DEFFALT_PORT="9102" +DEFAULT_PORT="9102" function nolog() { true @@ -32,7 +32,7 @@ log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${L BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) log "Host bind='${BIND_HOST}'" -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFFALT_PORT}) +BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) log "Host port='${BIND_PORT}'" writef "[Unit]" From 4b421917532427ba4fb9f48b60e8ee84739a610b Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 22 Aug 2021 11:51:33 +0200 Subject: [PATCH 43/50] Fixed logging and formatting in systemd socket generators. Cherry-picked from StackStorm/st2-packages@0c384b78b22e4d7e303c2f382413d2664a864375 --- packages/st2/debian/st2api-generator | 28 +++++++++++-------------- packages/st2/debian/st2auth-generator | 28 +++++++++++-------------- packages/st2/debian/st2stream-generator | 28 +++++++++++-------------- packages/st2/rpm/st2api-generator | 28 +++++++++++-------------- packages/st2/rpm/st2auth-generator | 28 +++++++++++-------------- packages/st2/rpm/st2stream-generator | 28 +++++++++++-------------- 6 files changed, 72 insertions(+), 96 deletions(-) diff --git a/packages/st2/debian/st2api-generator b/packages/st2/debian/st2api-generator index 0a0bb417e8..6bc1544264 100644 --- a/packages/st2/debian/st2api-generator +++ b/packages/st2/debian/st2api-generator @@ -1,18 +1,10 @@ #!/bin/bash -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} - ST2SVC="st2api" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9101" -function nolog() { - true -} - -function debug() { +function log() { echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log } @@ -22,18 +14,22 @@ function writef() { echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" } -function log() { - # call nolog / debug to enable/disable logging. - nolog "$1" +function debug() { + # true to enable logging or false to disable it. + true && log "$1" } -log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -log "Host bind='${BIND_HOST}'" +debug "Host bind='${BIND_HOST}'" BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -log "Host port='${BIND_PORT}'" +debug "Host port='${BIND_PORT}'" writef "[Unit]" writef "Description=StackStorm ${ST2SVC} Socket generated by $0" @@ -45,4 +41,4 @@ writef "" writef "[Install]" writef "WantedBy=sockets.target" -log "${ST2SVC} generated." +debug "${ST2SVC} generated." diff --git a/packages/st2/debian/st2auth-generator b/packages/st2/debian/st2auth-generator index b3a77e4827..e1663cad8d 100644 --- a/packages/st2/debian/st2auth-generator +++ b/packages/st2/debian/st2auth-generator @@ -1,18 +1,10 @@ #!/bin/bash -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} - ST2SVC="st2auth" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9100" -function nolog() { - true -} - -function debug() { +function log() { echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log } @@ -22,18 +14,22 @@ function writef() { echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" } -function log() { - # call nolog / debug to enable/disable logging. - nolog "$1" +function debug() { + # true to enable logging or false to disable it. + true && log "$1" } -log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -log "Host bind='${BIND_HOST}'" +debug "Host bind='${BIND_HOST}'" BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -log "Host port='${BIND_PORT}'" +debug "Host port='${BIND_PORT}'" writef "[Unit]" writef "Description=StackStorm ${ST2SVC} Socket generated by $0" @@ -45,4 +41,4 @@ writef "" writef "[Install]" writef "WantedBy=sockets.target" -log "${ST2SVC} generated." +debug "${ST2SVC} generated." diff --git a/packages/st2/debian/st2stream-generator b/packages/st2/debian/st2stream-generator index 444686b5f3..24064a3cde 100644 --- a/packages/st2/debian/st2stream-generator +++ b/packages/st2/debian/st2stream-generator @@ -1,18 +1,10 @@ #!/bin/bash -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} - ST2SVC="st2stream" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9102" -function nolog() { - true -} - -function debug() { +function log() { echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log } @@ -22,18 +14,22 @@ function writef() { echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" } -function log() { - # call nolog / debug to enable/disable logging. - nolog "$1" +function debug() { + # true to enable logging or false to disable it. + true && log "$1" } -log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -log "Host bind='${BIND_HOST}'" +debug "Host bind='${BIND_HOST}'" BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -log "Host port='${BIND_PORT}'" +debug "Host port='${BIND_PORT}'" writef "[Unit]" writef "Description=StackStorm ${ST2SVC} Socket generated by $0" @@ -45,4 +41,4 @@ writef "" writef "[Install]" writef "WantedBy=sockets.target" -log "${ST2SVC} generated." +debug "${ST2SVC} generated." diff --git a/packages/st2/rpm/st2api-generator b/packages/st2/rpm/st2api-generator index 0a0bb417e8..6bc1544264 100644 --- a/packages/st2/rpm/st2api-generator +++ b/packages/st2/rpm/st2api-generator @@ -1,18 +1,10 @@ #!/bin/bash -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} - ST2SVC="st2api" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9101" -function nolog() { - true -} - -function debug() { +function log() { echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log } @@ -22,18 +14,22 @@ function writef() { echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" } -function log() { - # call nolog / debug to enable/disable logging. - nolog "$1" +function debug() { + # true to enable logging or false to disable it. + true && log "$1" } -log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -log "Host bind='${BIND_HOST}'" +debug "Host bind='${BIND_HOST}'" BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -log "Host port='${BIND_PORT}'" +debug "Host port='${BIND_PORT}'" writef "[Unit]" writef "Description=StackStorm ${ST2SVC} Socket generated by $0" @@ -45,4 +41,4 @@ writef "" writef "[Install]" writef "WantedBy=sockets.target" -log "${ST2SVC} generated." +debug "${ST2SVC} generated." diff --git a/packages/st2/rpm/st2auth-generator b/packages/st2/rpm/st2auth-generator index b3a77e4827..e1663cad8d 100644 --- a/packages/st2/rpm/st2auth-generator +++ b/packages/st2/rpm/st2auth-generator @@ -1,18 +1,10 @@ #!/bin/bash -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} - ST2SVC="st2auth" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9100" -function nolog() { - true -} - -function debug() { +function log() { echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log } @@ -22,18 +14,22 @@ function writef() { echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" } -function log() { - # call nolog / debug to enable/disable logging. - nolog "$1" +function debug() { + # true to enable logging or false to disable it. + true && log "$1" } -log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -log "Host bind='${BIND_HOST}'" +debug "Host bind='${BIND_HOST}'" BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -log "Host port='${BIND_PORT}'" +debug "Host port='${BIND_PORT}'" writef "[Unit]" writef "Description=StackStorm ${ST2SVC} Socket generated by $0" @@ -45,4 +41,4 @@ writef "" writef "[Install]" writef "WantedBy=sockets.target" -log "${ST2SVC} generated." +debug "${ST2SVC} generated." diff --git a/packages/st2/rpm/st2stream-generator b/packages/st2/rpm/st2stream-generator index 444686b5f3..24064a3cde 100644 --- a/packages/st2/rpm/st2stream-generator +++ b/packages/st2/rpm/st2stream-generator @@ -1,18 +1,10 @@ #!/bin/bash -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} - ST2SVC="st2stream" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9102" -function nolog() { - true -} - -function debug() { +function log() { echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log } @@ -22,18 +14,22 @@ function writef() { echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" } -function log() { - # call nolog / debug to enable/disable logging. - nolog "$1" +function debug() { + # true to enable logging or false to disable it. + true && log "$1" } -log "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +NORMAL_DIR=${1:-/tmp} +EARLY_DIR=${2:-/tmp} +LATE_DIR=${3:-/tmp} + +debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -log "Host bind='${BIND_HOST}'" +debug "Host bind='${BIND_HOST}'" BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -log "Host port='${BIND_PORT}'" +debug "Host port='${BIND_PORT}'" writef "[Unit]" writef "Description=StackStorm ${ST2SVC} Socket generated by $0" @@ -45,4 +41,4 @@ writef "" writef "[Install]" writef "WantedBy=sockets.target" -log "${ST2SVC} generated." +debug "${ST2SVC} generated." From da3f69a97393d972031b91af28777882f6e8e780 Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 22 Sep 2021 11:22:51 +0200 Subject: [PATCH 44/50] Rewrite generator using python3 Cherry-picked from StackStorm/st2-packages@0b01d67e23186baf5e806d517c1de638bf4e9144 --- packages/st2/debian/st2api-generator | 81 ++++++++++++++----------- packages/st2/debian/st2auth-generator | 73 ++++++++++++---------- packages/st2/debian/st2stream-generator | 73 ++++++++++++---------- packages/st2/rpm/st2api-generator | 81 ++++++++++++++----------- packages/st2/rpm/st2auth-generator | 73 ++++++++++++---------- packages/st2/rpm/st2stream-generator | 73 ++++++++++++---------- 6 files changed, 260 insertions(+), 194 deletions(-) diff --git a/packages/st2/debian/st2api-generator b/packages/st2/debian/st2api-generator index 6bc1544264..6af3eebe4b 100644 --- a/packages/st2/debian/st2api-generator +++ b/packages/st2/debian/st2api-generator @@ -1,44 +1,55 @@ -#!/bin/bash - -ST2SVC="st2api" -DEFAULT_IP="127.0.0.1" -DEFAULT_PORT="9101" - -function log() { - echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +#!/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" -function writef() { - # cat with bash here document requires write access to a tmp directory which is unavailable when - # generators are run during boot because the root filesystem is mounted readonly, so we use echo. - echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" -} +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() -function debug() { - # true to enable logging or false to disable it. - true && log "$1" -} +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser() +config.read(ST2CFG) -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) -debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service -BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -debug "Host bind='${BIND_HOST}'" +[Socket] +ListenStream={bind_address}:{bind_port} -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -debug "Host port='${BIND_PORT}'" +[Install] +WantedBy=sockets.target +""" -writef "[Unit]" -writef "Description=StackStorm ${ST2SVC} Socket generated by $0" -writef "PartOf=${ST2SVC}.service" -writef "" -writef "[Socket]" -writef "ListenStream=${BIND_HOST}:${BIND_PORT}" -writef "" -writef "[Install]" -writef "WantedBy=sockets.target" +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) -debug "${ST2SVC} generated." +LOG.info(f"{ST2SVC} generated.") diff --git a/packages/st2/debian/st2auth-generator b/packages/st2/debian/st2auth-generator index e1663cad8d..8864cd1f60 100644 --- a/packages/st2/debian/st2auth-generator +++ b/packages/st2/debian/st2auth-generator @@ -1,44 +1,55 @@ -#!/bin/bash +#!/usr/bin/env python3 +import configparser +import logging +import time +import sys ST2SVC="st2auth" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9100" - -function log() { - echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +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" -function writef() { - # cat with bash here document requires write access to a tmp directory which is unavailable when - # generators are run during boot because the root filesystem is mounted readonly, so we use echo. - echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" -} +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() -function debug() { - # true to enable logging or false to disable it. - true && log "$1" -} +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser() +config.read(ST2CFG) -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) -debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service -BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -debug "Host bind='${BIND_HOST}'" +[Socket] +ListenStream={bind_address}:{bind_port} -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -debug "Host port='${BIND_PORT}'" +[Install] +WantedBy=sockets.target +""" -writef "[Unit]" -writef "Description=StackStorm ${ST2SVC} Socket generated by $0" -writef "PartOf=${ST2SVC}.service" -writef "" -writef "[Socket]" -writef "ListenStream=${BIND_HOST}:${BIND_PORT}" -writef "" -writef "[Install]" -writef "WantedBy=sockets.target" +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) -debug "${ST2SVC} generated." +LOG.info(f"{ST2SVC} generated.") diff --git a/packages/st2/debian/st2stream-generator b/packages/st2/debian/st2stream-generator index 24064a3cde..957a6b1113 100644 --- a/packages/st2/debian/st2stream-generator +++ b/packages/st2/debian/st2stream-generator @@ -1,44 +1,55 @@ -#!/bin/bash +#!/usr/bin/env python3 +import configparser +import logging +import time +import sys ST2SVC="st2stream" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9102" - -function log() { - echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +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" -function writef() { - # cat with bash here document requires write access to a tmp directory which is unavailable when - # generators are run during boot because the root filesystem is mounted readonly, so we use echo. - echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" -} +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() -function debug() { - # true to enable logging or false to disable it. - true && log "$1" -} +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser() +config.read(ST2CFG) -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) -debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service -BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -debug "Host bind='${BIND_HOST}'" +[Socket] +ListenStream={bind_address}:{bind_port} -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -debug "Host port='${BIND_PORT}'" +[Install] +WantedBy=sockets.target +""" -writef "[Unit]" -writef "Description=StackStorm ${ST2SVC} Socket generated by $0" -writef "PartOf=${ST2SVC}.service" -writef "" -writef "[Socket]" -writef "ListenStream=${BIND_HOST}:${BIND_PORT}" -writef "" -writef "[Install]" -writef "WantedBy=sockets.target" +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) -debug "${ST2SVC} generated." +LOG.info(f"{ST2SVC} generated.") diff --git a/packages/st2/rpm/st2api-generator b/packages/st2/rpm/st2api-generator index 6bc1544264..6af3eebe4b 100644 --- a/packages/st2/rpm/st2api-generator +++ b/packages/st2/rpm/st2api-generator @@ -1,44 +1,55 @@ -#!/bin/bash - -ST2SVC="st2api" -DEFAULT_IP="127.0.0.1" -DEFAULT_PORT="9101" - -function log() { - echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +#!/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" -function writef() { - # cat with bash here document requires write access to a tmp directory which is unavailable when - # generators are run during boot because the root filesystem is mounted readonly, so we use echo. - echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" -} +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() -function debug() { - # true to enable logging or false to disable it. - true && log "$1" -} +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser() +config.read(ST2CFG) -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) -debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service -BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -debug "Host bind='${BIND_HOST}'" +[Socket] +ListenStream={bind_address}:{bind_port} -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -debug "Host port='${BIND_PORT}'" +[Install] +WantedBy=sockets.target +""" -writef "[Unit]" -writef "Description=StackStorm ${ST2SVC} Socket generated by $0" -writef "PartOf=${ST2SVC}.service" -writef "" -writef "[Socket]" -writef "ListenStream=${BIND_HOST}:${BIND_PORT}" -writef "" -writef "[Install]" -writef "WantedBy=sockets.target" +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) -debug "${ST2SVC} generated." +LOG.info(f"{ST2SVC} generated.") diff --git a/packages/st2/rpm/st2auth-generator b/packages/st2/rpm/st2auth-generator index e1663cad8d..8864cd1f60 100644 --- a/packages/st2/rpm/st2auth-generator +++ b/packages/st2/rpm/st2auth-generator @@ -1,44 +1,55 @@ -#!/bin/bash +#!/usr/bin/env python3 +import configparser +import logging +import time +import sys ST2SVC="st2auth" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9100" - -function log() { - echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +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" -function writef() { - # cat with bash here document requires write access to a tmp directory which is unavailable when - # generators are run during boot because the root filesystem is mounted readonly, so we use echo. - echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" -} +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() -function debug() { - # true to enable logging or false to disable it. - true && log "$1" -} +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser() +config.read(ST2CFG) -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) -debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service -BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -debug "Host bind='${BIND_HOST}'" +[Socket] +ListenStream={bind_address}:{bind_port} -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -debug "Host port='${BIND_PORT}'" +[Install] +WantedBy=sockets.target +""" -writef "[Unit]" -writef "Description=StackStorm ${ST2SVC} Socket generated by $0" -writef "PartOf=${ST2SVC}.service" -writef "" -writef "[Socket]" -writef "ListenStream=${BIND_HOST}:${BIND_PORT}" -writef "" -writef "[Install]" -writef "WantedBy=sockets.target" +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) -debug "${ST2SVC} generated." +LOG.info(f"{ST2SVC} generated.") diff --git a/packages/st2/rpm/st2stream-generator b/packages/st2/rpm/st2stream-generator index 24064a3cde..957a6b1113 100644 --- a/packages/st2/rpm/st2stream-generator +++ b/packages/st2/rpm/st2stream-generator @@ -1,44 +1,55 @@ -#!/bin/bash +#!/usr/bin/env python3 +import configparser +import logging +import time +import sys ST2SVC="st2stream" DEFAULT_IP="127.0.0.1" DEFAULT_PORT="9102" - -function log() { - echo "$(/bin/date) - ${1}" | /usr/bin/tee -a ${NORMAL_DIR}/${ST2SVC}_generator.log +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" -function writef() { - # cat with bash here document requires write access to a tmp directory which is unavailable when - # generators are run during boot because the root filesystem is mounted readonly, so we use echo. - echo "$1" >> "${NORMAL_DIR}/${ST2SVC}.socket" -} +logging.basicConfig(**LOG_KW) +LOG = logging.getLogger() -function debug() { - # true to enable logging or false to disable it. - true && log "$1" -} +LOG.debug( + f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" +) + +config = configparser.ConfigParser() +config.read(ST2CFG) -NORMAL_DIR=${1:-/tmp} -EARLY_DIR=${2:-/tmp} -LATE_DIR=${3:-/tmp} +section = ST2SVC[3:] +bind_address = config[section].get("host", DEFAULT_IP) +bind_port = config[section].get("port", DEFAULT_PORT) -debug "Supplied directories: Early='${EARLY_DIR}' Normal='${NORMAL_DIR}' Late='${LATE_DIR}'" +contents = f"""[Unit] +# Generated by {sys.argv[0]} at {time.asctime(time.localtime())} +Description=StackStorm {ST2SVC} Socket. +PartOf={ST2SVC}.service -BIND_HOST=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} host 2>/dev/null || echo ${DEFAULT_IP}) -debug "Host bind='${BIND_HOST}'" +[Socket] +ListenStream={bind_address}:{bind_port} -BIND_PORT=$(/usr/bin/crudini --get /etc/st2/st2.conf ${ST2SVC:3} port 2>/dev/null || echo ${DEFAULT_PORT}) -debug "Host port='${BIND_PORT}'" +[Install] +WantedBy=sockets.target +""" -writef "[Unit]" -writef "Description=StackStorm ${ST2SVC} Socket generated by $0" -writef "PartOf=${ST2SVC}.service" -writef "" -writef "[Socket]" -writef "ListenStream=${BIND_HOST}:${BIND_PORT}" -writef "" -writef "[Install]" -writef "WantedBy=sockets.target" +with open(f"{NORMAL_DIR}/{ST2SVC}.socket", "w") as f: + f.write(contents) -debug "${ST2SVC} generated." +LOG.info(f"{ST2SVC} generated.") From 2a85be4107d4b4895ef4a5cc4e7bade50672a33e Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 22 Sep 2021 21:58:47 +0200 Subject: [PATCH 45/50] Set executable for generators Cherry-picked from StackStorm/st2-packages@a9a47e5cdb95c92cff3a8f7292cc42d86e940cf4 --- packages/st2/debian/st2api-generator | 0 packages/st2/debian/st2auth-generator | 0 packages/st2/debian/st2stream-generator | 0 packages/st2/rpm/st2api-generator | 0 packages/st2/rpm/st2auth-generator | 0 packages/st2/rpm/st2stream-generator | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 packages/st2/debian/st2api-generator mode change 100644 => 100755 packages/st2/debian/st2auth-generator mode change 100644 => 100755 packages/st2/debian/st2stream-generator mode change 100644 => 100755 packages/st2/rpm/st2api-generator mode change 100644 => 100755 packages/st2/rpm/st2auth-generator mode change 100644 => 100755 packages/st2/rpm/st2stream-generator diff --git a/packages/st2/debian/st2api-generator b/packages/st2/debian/st2api-generator old mode 100644 new mode 100755 diff --git a/packages/st2/debian/st2auth-generator b/packages/st2/debian/st2auth-generator old mode 100644 new mode 100755 diff --git a/packages/st2/debian/st2stream-generator b/packages/st2/debian/st2stream-generator old mode 100644 new mode 100755 diff --git a/packages/st2/rpm/st2api-generator b/packages/st2/rpm/st2api-generator old mode 100644 new mode 100755 diff --git a/packages/st2/rpm/st2auth-generator b/packages/st2/rpm/st2auth-generator old mode 100644 new mode 100755 diff --git a/packages/st2/rpm/st2stream-generator b/packages/st2/rpm/st2stream-generator old mode 100644 new mode 100755 From 600fa102b31c38b79f88d412b6bf81ab5a3bb3d3 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sat, 2 Oct 2021 23:58:04 -0500 Subject: [PATCH 46/50] rpm: Rely on %default_install to install *-generator from debian files Cherry-picked from StackStorm/st2-packages@61ffa9ffa606838661980595dc5700a425e6a4bf --- packages/st2/rpm/st2api-generator | 55 ---------------------------- packages/st2/rpm/st2auth-generator | 55 ---------------------------- packages/st2/rpm/st2stream-generator | 55 ---------------------------- 3 files changed, 165 deletions(-) delete mode 100755 packages/st2/rpm/st2api-generator delete mode 100755 packages/st2/rpm/st2auth-generator delete mode 100755 packages/st2/rpm/st2stream-generator diff --git a/packages/st2/rpm/st2api-generator b/packages/st2/rpm/st2api-generator deleted file mode 100755 index 6af3eebe4b..0000000000 --- a/packages/st2/rpm/st2api-generator +++ /dev/null @@ -1,55 +0,0 @@ -#!/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() -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 - -[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/packages/st2/rpm/st2auth-generator b/packages/st2/rpm/st2auth-generator deleted file mode 100755 index 8864cd1f60..0000000000 --- a/packages/st2/rpm/st2auth-generator +++ /dev/null @@ -1,55 +0,0 @@ -#!/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() -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 - -[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/packages/st2/rpm/st2stream-generator b/packages/st2/rpm/st2stream-generator deleted file mode 100755 index 957a6b1113..0000000000 --- a/packages/st2/rpm/st2stream-generator +++ /dev/null @@ -1,55 +0,0 @@ -#!/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() -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 - -[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.") From 014b934daeeac6848d618858e667ac7f3d45b6b2 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 6 Oct 2021 18:37:28 -0500 Subject: [PATCH 47/50] Add SourcPath= to generated .socket files Cherry-picked from StackStorm/st2-packages@864c4d70569866df2b6d8c0656fe06a779089179 --- packages/st2/debian/st2api-generator | 1 + packages/st2/debian/st2auth-generator | 1 + packages/st2/debian/st2stream-generator | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/st2/debian/st2api-generator b/packages/st2/debian/st2api-generator index 6af3eebe4b..10de67c2aa 100755 --- a/packages/st2/debian/st2api-generator +++ b/packages/st2/debian/st2api-generator @@ -41,6 +41,7 @@ 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} diff --git a/packages/st2/debian/st2auth-generator b/packages/st2/debian/st2auth-generator index 8864cd1f60..f4346c8528 100755 --- a/packages/st2/debian/st2auth-generator +++ b/packages/st2/debian/st2auth-generator @@ -41,6 +41,7 @@ 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} diff --git a/packages/st2/debian/st2stream-generator b/packages/st2/debian/st2stream-generator index 957a6b1113..e42d04fec0 100755 --- a/packages/st2/debian/st2stream-generator +++ b/packages/st2/debian/st2stream-generator @@ -41,6 +41,7 @@ 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} From d7ecc8a54798a8c60c9b695efab989abc43689bb Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 10 Oct 2021 12:17:47 +0200 Subject: [PATCH 48/50] Relax ini parsing to allow duplicate entries. Cherry-picked from StackStorm/st2-packages@b054f4b5e2bb0d699718de6b258b4175e3de36a5 --- packages/st2/debian/st2api-generator | 2 +- packages/st2/debian/st2auth-generator | 2 +- packages/st2/debian/st2stream-generator | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/st2/debian/st2api-generator b/packages/st2/debian/st2api-generator index 10de67c2aa..ae6d2e7eed 100755 --- a/packages/st2/debian/st2api-generator +++ b/packages/st2/debian/st2api-generator @@ -30,7 +30,7 @@ LOG.debug( f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" ) -config = configparser.ConfigParser() +config = configparser.ConfigParser(strict=False) config.read(ST2CFG) section = ST2SVC[3:] diff --git a/packages/st2/debian/st2auth-generator b/packages/st2/debian/st2auth-generator index f4346c8528..f1b017e99b 100755 --- a/packages/st2/debian/st2auth-generator +++ b/packages/st2/debian/st2auth-generator @@ -30,7 +30,7 @@ LOG.debug( f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" ) -config = configparser.ConfigParser() +config = configparser.ConfigParser(strict=False) config.read(ST2CFG) section = ST2SVC[3:] diff --git a/packages/st2/debian/st2stream-generator b/packages/st2/debian/st2stream-generator index e42d04fec0..e7d82e0f44 100755 --- a/packages/st2/debian/st2stream-generator +++ b/packages/st2/debian/st2stream-generator @@ -30,7 +30,7 @@ LOG.debug( f"Systemd directories: Early='{EARLY_DIR}' Normal='{NORMAL_DIR}' Late='{LATE_DIR}'" ) -config = configparser.ConfigParser() +config = configparser.ConfigParser(strict=False) config.read(ST2CFG) section = ST2SVC[3:] From 7a16dcb74fdd21063c827bf253e2d5c5aa7199a4 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 13 Apr 2023 00:34:33 -0500 Subject: [PATCH 49/50] Reorganize systemd files cherry-picked from st2-packages.git This prepares for pants-based packaging. --- .../st2/debian => packaging/common/systemd}/st2api-generator | 0 .../st2/debian => packaging/common/systemd}/st2auth-generator | 0 .../st2/debian => packaging/common/systemd}/st2stream-generator | 0 .../st2/debian => packaging/deb/systemd}/st2actionrunner.service | 0 .../st2/debian => packaging/deb/systemd}/st2actionrunner@.service | 0 {packages/st2/debian => packaging/deb/systemd}/st2api.service | 0 {packages/st2/debian => packaging/deb/systemd}/st2auth.service | 0 .../debian => packaging/deb/systemd}/st2garbagecollector.service | 0 .../st2/debian => packaging/deb/systemd}/st2notifier.service | 0 .../st2/debian => packaging/deb/systemd}/st2rulesengine.service | 0 .../st2/debian => packaging/deb/systemd}/st2scheduler.service | 0 .../debian => packaging/deb/systemd}/st2sensorcontainer.service | 0 {packages/st2/debian => packaging/deb/systemd}/st2stream.service | 0 .../st2/debian => packaging/deb/systemd}/st2timersengine.service | 0 .../debian => packaging/deb/systemd}/st2workflowengine.service | 0 .../st2/rpm => packaging/rpm/systemd}/st2actionrunner.service | 0 .../st2/rpm => packaging/rpm/systemd}/st2actionrunner@.service | 0 {packages/st2/rpm => packaging/rpm/systemd}/st2api.service | 0 {packages/st2/rpm => packaging/rpm/systemd}/st2auth.service | 0 .../st2/rpm => packaging/rpm/systemd}/st2garbagecollector.service | 0 {packages/st2/rpm => packaging/rpm/systemd}/st2notifier.service | 0 .../st2/rpm => packaging/rpm/systemd}/st2rulesengine.service | 0 {packages/st2/rpm => packaging/rpm/systemd}/st2scheduler.service | 0 .../st2/rpm => packaging/rpm/systemd}/st2sensorcontainer.service | 0 {packages/st2/rpm => packaging/rpm/systemd}/st2stream.service | 0 .../st2/rpm => packaging/rpm/systemd}/st2timersengine.service | 0 .../st2/rpm => packaging/rpm/systemd}/st2workflowengine.service | 0 27 files changed, 0 insertions(+), 0 deletions(-) rename {packages/st2/debian => packaging/common/systemd}/st2api-generator (100%) rename {packages/st2/debian => packaging/common/systemd}/st2auth-generator (100%) rename {packages/st2/debian => packaging/common/systemd}/st2stream-generator (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2actionrunner.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2actionrunner@.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2api.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2auth.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2garbagecollector.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2notifier.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2rulesengine.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2scheduler.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2sensorcontainer.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2stream.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2timersengine.service (100%) rename {packages/st2/debian => packaging/deb/systemd}/st2workflowengine.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2actionrunner.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2actionrunner@.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2api.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2auth.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2garbagecollector.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2notifier.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2rulesengine.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2scheduler.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2sensorcontainer.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2stream.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2timersengine.service (100%) rename {packages/st2/rpm => packaging/rpm/systemd}/st2workflowengine.service (100%) diff --git a/packages/st2/debian/st2api-generator b/packaging/common/systemd/st2api-generator similarity index 100% rename from packages/st2/debian/st2api-generator rename to packaging/common/systemd/st2api-generator diff --git a/packages/st2/debian/st2auth-generator b/packaging/common/systemd/st2auth-generator similarity index 100% rename from packages/st2/debian/st2auth-generator rename to packaging/common/systemd/st2auth-generator diff --git a/packages/st2/debian/st2stream-generator b/packaging/common/systemd/st2stream-generator similarity index 100% rename from packages/st2/debian/st2stream-generator rename to packaging/common/systemd/st2stream-generator diff --git a/packages/st2/debian/st2actionrunner.service b/packaging/deb/systemd/st2actionrunner.service similarity index 100% rename from packages/st2/debian/st2actionrunner.service rename to packaging/deb/systemd/st2actionrunner.service diff --git a/packages/st2/debian/st2actionrunner@.service b/packaging/deb/systemd/st2actionrunner@.service similarity index 100% rename from packages/st2/debian/st2actionrunner@.service rename to packaging/deb/systemd/st2actionrunner@.service diff --git a/packages/st2/debian/st2api.service b/packaging/deb/systemd/st2api.service similarity index 100% rename from packages/st2/debian/st2api.service rename to packaging/deb/systemd/st2api.service diff --git a/packages/st2/debian/st2auth.service b/packaging/deb/systemd/st2auth.service similarity index 100% rename from packages/st2/debian/st2auth.service rename to packaging/deb/systemd/st2auth.service diff --git a/packages/st2/debian/st2garbagecollector.service b/packaging/deb/systemd/st2garbagecollector.service similarity index 100% rename from packages/st2/debian/st2garbagecollector.service rename to packaging/deb/systemd/st2garbagecollector.service diff --git a/packages/st2/debian/st2notifier.service b/packaging/deb/systemd/st2notifier.service similarity index 100% rename from packages/st2/debian/st2notifier.service rename to packaging/deb/systemd/st2notifier.service diff --git a/packages/st2/debian/st2rulesengine.service b/packaging/deb/systemd/st2rulesengine.service similarity index 100% rename from packages/st2/debian/st2rulesengine.service rename to packaging/deb/systemd/st2rulesengine.service diff --git a/packages/st2/debian/st2scheduler.service b/packaging/deb/systemd/st2scheduler.service similarity index 100% rename from packages/st2/debian/st2scheduler.service rename to packaging/deb/systemd/st2scheduler.service diff --git a/packages/st2/debian/st2sensorcontainer.service b/packaging/deb/systemd/st2sensorcontainer.service similarity index 100% rename from packages/st2/debian/st2sensorcontainer.service rename to packaging/deb/systemd/st2sensorcontainer.service diff --git a/packages/st2/debian/st2stream.service b/packaging/deb/systemd/st2stream.service similarity index 100% rename from packages/st2/debian/st2stream.service rename to packaging/deb/systemd/st2stream.service diff --git a/packages/st2/debian/st2timersengine.service b/packaging/deb/systemd/st2timersengine.service similarity index 100% rename from packages/st2/debian/st2timersengine.service rename to packaging/deb/systemd/st2timersengine.service diff --git a/packages/st2/debian/st2workflowengine.service b/packaging/deb/systemd/st2workflowengine.service similarity index 100% rename from packages/st2/debian/st2workflowengine.service rename to packaging/deb/systemd/st2workflowengine.service diff --git a/packages/st2/rpm/st2actionrunner.service b/packaging/rpm/systemd/st2actionrunner.service similarity index 100% rename from packages/st2/rpm/st2actionrunner.service rename to packaging/rpm/systemd/st2actionrunner.service diff --git a/packages/st2/rpm/st2actionrunner@.service b/packaging/rpm/systemd/st2actionrunner@.service similarity index 100% rename from packages/st2/rpm/st2actionrunner@.service rename to packaging/rpm/systemd/st2actionrunner@.service diff --git a/packages/st2/rpm/st2api.service b/packaging/rpm/systemd/st2api.service similarity index 100% rename from packages/st2/rpm/st2api.service rename to packaging/rpm/systemd/st2api.service diff --git a/packages/st2/rpm/st2auth.service b/packaging/rpm/systemd/st2auth.service similarity index 100% rename from packages/st2/rpm/st2auth.service rename to packaging/rpm/systemd/st2auth.service diff --git a/packages/st2/rpm/st2garbagecollector.service b/packaging/rpm/systemd/st2garbagecollector.service similarity index 100% rename from packages/st2/rpm/st2garbagecollector.service rename to packaging/rpm/systemd/st2garbagecollector.service diff --git a/packages/st2/rpm/st2notifier.service b/packaging/rpm/systemd/st2notifier.service similarity index 100% rename from packages/st2/rpm/st2notifier.service rename to packaging/rpm/systemd/st2notifier.service diff --git a/packages/st2/rpm/st2rulesengine.service b/packaging/rpm/systemd/st2rulesengine.service similarity index 100% rename from packages/st2/rpm/st2rulesengine.service rename to packaging/rpm/systemd/st2rulesengine.service diff --git a/packages/st2/rpm/st2scheduler.service b/packaging/rpm/systemd/st2scheduler.service similarity index 100% rename from packages/st2/rpm/st2scheduler.service rename to packaging/rpm/systemd/st2scheduler.service diff --git a/packages/st2/rpm/st2sensorcontainer.service b/packaging/rpm/systemd/st2sensorcontainer.service similarity index 100% rename from packages/st2/rpm/st2sensorcontainer.service rename to packaging/rpm/systemd/st2sensorcontainer.service diff --git a/packages/st2/rpm/st2stream.service b/packaging/rpm/systemd/st2stream.service similarity index 100% rename from packages/st2/rpm/st2stream.service rename to packaging/rpm/systemd/st2stream.service diff --git a/packages/st2/rpm/st2timersengine.service b/packaging/rpm/systemd/st2timersengine.service similarity index 100% rename from packages/st2/rpm/st2timersengine.service rename to packaging/rpm/systemd/st2timersengine.service diff --git a/packages/st2/rpm/st2workflowengine.service b/packaging/rpm/systemd/st2workflowengine.service similarity index 100% rename from packages/st2/rpm/st2workflowengine.service rename to packaging/rpm/systemd/st2workflowengine.service From e92e1ccef790bedd4853bcd65e0aab480d93ec08 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sat, 15 Feb 2025 22:54:30 -0600 Subject: [PATCH 50/50] add changelog entry --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b23c33ac83..47650d85dd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -108,6 +108,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