Skip to content

Commit

Permalink
Merge branch '2523-alert-tracks-systemd' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Jan 8, 2024
2 parents 6b002d5 + 6d51507 commit ba802cf
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 324 deletions.
101 changes: 0 additions & 101 deletions config/alert-tracks-debian.example

This file was deleted.

23 changes: 23 additions & 0 deletions config/alert-tracks.service.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# systemd service unit for Alaveteli Alert Tracks daemon
#
[Unit]
Description=<%= daemon_name %> sends Alaveteli email alerts as required
After=syslog.target network.target

[Service]
Type=simple
Environment=PATH="<%= ruby_path %>:/usr/local/bin:/usr/bin:/bin"
<% unless rails_env_defined? -%>
Environment=RAILS_ENV=<%= rails_env %>
<% end -%>
User=<%= user %>
WorkingDirectory=<%= vhost_dir %>/<%= vcspath %>
ExecStart=<%= vhost_dir %>/<%= vcspath %>/script/runner TrackMailer.alert_tracks_loop
StandardOutput=append:<%= vhost_dir %>/<%= vcspath %>/log/<%= daemon_name %>.log
StandardError=inherit
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion config/crontab-example
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ MAILTO=<%= mailto %>
31 * * * * <%= user %> <%= vhost_dir %>/<%= vcspath %>/commonlib/bin/run-with-lockfile.sh -n <%= vhost_dir %>/load-mail-server-logs.lock <%= vhost_dir %>/<%= vcspath %>/script/load-mail-server-logs || echo "stalled?"

# Once a day, early morning
31 1 * * * <%= user %> <%= vhost_dir %>/<%= vcspath %>/commonlib/bin/run-with-lockfile.sh -n <%= vhost_dir %>/change-xapian-database.lock "<%= vhost_dir %>/<%= vcspath %>/script/compact-xapian-database production <%= site %>" || echo "stalled?"
31 1 * * * <%= user %> <%= vhost_dir %>/<%= vcspath %>/commonlib/bin/run-with-lockfile.sh -n <%= vhost_dir %>/change-xapian-database.lock "<%= vhost_dir %>/<%= vcspath %>/script/compact-xapian-database production" || echo "stalled?"
0 0 * * * <%= user %> <%= vhost_dir %>/<%= vcspath %>/commonlib/bin/run-with-lockfile.sh -n <%= vhost_dir %>/delete-expired-embargoes.lock <%= vhost_dir %>/<%= vcspath %>/script/delete-expired-embargoes || echo "stalled?"
23 4 * * * <%= user %> <%= vhost_dir %>/<%= vcspath %>/commonlib/bin/run-with-lockfile.sh -n <%= vhost_dir %>/delete-old-things.lock <%= vhost_dir %>/<%= vcspath %>/script/delete-old-things || echo "stalled?"
0 5 * * * <%= user %> <%= vhost_dir %>/<%= vcspath %>/commonlib/bin/run-with-lockfile.sh -n <%= vhost_dir %>/update-overdue-info-request-events.lock <%= vhost_dir %>/<%= vcspath %>/script/update-overdue-info-request-events || echo "stalled?"
Expand Down
101 changes: 0 additions & 101 deletions config/poll-for-incoming-debian.example

This file was deleted.

23 changes: 23 additions & 0 deletions config/poll-for-incoming.service.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# systemd service unit for Alaveteli imcoming mail poller daemon
#
[Unit]
Description=<%= daemon_name %> imports incoming mail into Alaveteli as required
After=syslog.target network.target

[Service]
Type=simple
Environment=PATH="<%= ruby_path %>:/usr/local/bin:/usr/bin:/bin"
<% unless rails_env_defined? -%>
Environment=RAILS_ENV=<%= rails_env %>
<% end -%>
User=<%= user %>
WorkingDirectory=<%= vhost_dir %>/<%= vcspath %>
ExecStart=<%= vhost_dir %>/<%= vcspath %>/script/runner AlaveteliMailPoller.poll_for_incoming_loop
StandardOutput=append:<%= vhost_dir %>/<%= vcspath %>/log/<%= daemon_name %>.log
StandardError=inherit
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
101 changes: 0 additions & 101 deletions config/send-notifications-debian.example

This file was deleted.

23 changes: 23 additions & 0 deletions config/send-notifications.service.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# systemd service unit for Alaveteli Notifications daemon
#
[Unit]
Description=<%= daemon_name %> sends Alaveteli notifications as required
After=syslog.target network.target

[Service]
Type=simple
Environment=PATH="<%= ruby_path %>:/usr/local/bin:/usr/bin:/bin"
<% unless rails_env_defined? -%>
Environment=RAILS_ENV=<%= rails_env %>
<% end -%>
User=<%= user %>
WorkingDirectory=<%= vhost_dir %>/<%= vcspath %>
ExecStart=<%= vhost_dir %>/<%= vcspath %>/script/runner NotificationMailer.send_notifications_loop
StandardOutput=append:<%= vhost_dir %>/<%= vcspath %>/log/<%= daemon_name %>.log
StandardError=inherit
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
Loading

0 comments on commit ba802cf

Please sign in to comment.