Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert the daemons to native systemd units #8024

Merged
merged 8 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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