This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 969
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4807 from open-craft/agrendalath/xenial-log-sync-…
…on-exit Fix syncing logs when shutting down a server
- Loading branch information
Showing
5 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
start on stopped supervisor | ||
description "sync tracking logs on supervisor shutdown" | ||
script | ||
/usr/sbin/logrotate -f /etc/logrotate.d/hourly/tracking.log | ||
/usr/sbin/logrotate -f /etc/logrotate.d/hourly/edx-services | ||
"{{ COMMON_OBJECT_STORE_LOG_SYNC_ON_EXIT }}" | ||
end script |
11 changes: 11 additions & 0 deletions
11
playbooks/roles/vhost/templates/etc/systemd/system/sync-logs-on-exit.service.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Synchronizes logs on exit | ||
After=rsyslog.service | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=true | ||
ExecStop=/edx/bin/sync-logs-on-exit | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
/usr/sbin/logrotate -f /etc/logrotate.d/hourly/tracking.log | ||
/usr/sbin/logrotate -f /etc/logrotate.d/hourly/edx-services |