Skip to content

Commit 851484c

Browse files
authored
Merge pull request #514 from StackStorm/fix/mistral-logrotate
Logrotate mistral logs
2 parents 3fc7985 + d6711f7 commit 851484c

File tree

7 files changed

+35
-3
lines changed

7 files changed

+35
-3
lines changed

packages/st2mistral/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ post_install:
3535
pre_install:
3636
install -D conf/policy.json $(DESTDIR)/etc/mistral/policy.json
3737
install -D etc/logging.conf.sample $(DESTDIR)/etc/mistral/logging.conf
38+
install -m644 conf/logrotate.conf $(DESTDIR)/etc/logrotate.d/mistral
3839
install -D etc/wf_trace_logging.conf.sample $(DESTDIR)/etc/mistral/wf_trace_logging.conf
3940
install -D -m644 conf/helpers-sysvinit $(DESTDIR)/opt/stackstorm/mistral/share/sysvinit/helpers
4041
sed -i "s%/var/log/%/var/log/mistral/%" $(DESTDIR)/etc/mistral/*logging.conf
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Mistral API
2+
/var/log/mistral/mistral-api.log {
3+
size 1M
4+
rotate 5
5+
compress
6+
notifempty
7+
missingok
8+
create 644 mistral mistral
9+
postrotate
10+
pkill -USR1 -f mistral.api.wsgi > /dev/null 2>&1 || true
11+
endscript
12+
}
13+
14+
## Mistral Server
15+
/var/log/mistral/mistral-server.log {
16+
size 50M
17+
rotate 10
18+
compress
19+
notifempty
20+
missingok
21+
# Mistral doesn't handle USR1 signal right to re-open log files,
22+
# Sending HUP will re-open the logs, but will stop the running workflows
23+
copytruncate
24+
delaycompress
25+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/logrotate.d/mistral

packages/st2mistral/debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Vcs-Browser: https://github.com/stackstorm/mistral
1111
Package: st2mistral
1212
Architecture: any
1313
Pre-Depends: dpkg (>= 1.16.16), python2.7, adduser
14-
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
14+
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, procps
1515
Description: st2 Mistral workflow service.
1616
Task orchestration and workflow engine with powerful strategies like parallelism, loops, retries,
1717
nested tasks, execution order capabilities. Rules defined in YAML, extended with YAQL expressions.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/etc/mistral
22
/var/log/mistral
33
/var/run/mistral
4+
/etc/logrotate.d

packages/st2mistral/rpm/st2mistral.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Group: System/Management
1616
License: Apache 2.0
1717
Url: https://github.com/StackStorm/mistral
1818
Source0: .
19+
Requires: bash, procps
1920
Provides: openstack-mistral
2021
Summary: st2 Mistral workflow service
2122

@@ -59,6 +60,7 @@ Summary: st2 Mistral workflow service
5960
%{_bindir}/mistral
6061
/opt/stackstorm/mistral
6162
%config(noreplace) %{_sysconfdir}/mistral/*
63+
%config(noreplace) %{_sysconfdir}/logrotate.d/mistral
6264
%attr(755, %{svc_user}, root) %{_localstatedir}/log/mistral
6365
%attr(755, %{svc_user}, root) %{_localstatedir}/run/mistral
6466
%if 0%{?use_systemd}

rake/spec/spec_helper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ class ST2Spec
8484
/opt/stackstorm/packs),
8585
mistral: [
8686
'/etc/mistral',
87+
'/etc/logrotate.d',
88+
'/opt/stackstorm/mistral',
8789
[ '/var/log/mistral', example: Proc.new {|_| be_writable.by('owner')} ]
8890
]
8991
},
9092

9193
package_has_files: {
92-
st2common: %w(/etc/st2/st2.conf),
93-
mistral: %w(/etc/mistral/mistral.conf)
94+
st2common: %w(/etc/st2/st2.conf /etc/logrotate.d/st2),
95+
mistral: %w(/etc/mistral/mistral.conf /etc/logrotate.d/mistral)
9496
},
9597

9698
package_has_users: {

0 commit comments

Comments
 (0)