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

Further improvement suggestion (and implementation) for systemd unit and timer files #171

Open
ethereal-engineer opened this issue Sep 10, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@ethereal-engineer
Copy link

I don't know how to submit a PR, so here are my files for your use for now.

# /etc/systemd/system/fedifetcher.service
[Unit]
Description=FediFetcher Service
After=network.target mastodon-web.service mastodon-sidekiq.service mastodon-streaming@<REPLACE_WITH_YOUR_PORT_NUMBER>.service

[Service]
Type=simple
User=mastodon
# WorkingDirectory is your checked-out FediFetcher repo directory
# I don't like having only case-seperate same paths, so this is mine
WorkingDirectory=/opt/fedifetcher/venv/FediFetcher 
# ExecStart must use the python binary created in the venv
ExecStart=/opt/fedifetcher/venv/bin/python3 find_posts.py -c=artifacts/config.json
# /etc/systemd/system/fedifetcher.timer
[Unit]
Description=FediFetcher Timer

[Timer]
# don't start until system has settled (adjust as you need)
OnBootSec=15min
# after the unit has run once, wait a minute, then run again (removes dependency on lockfile, I think)
OnUnitActiveSec=1min

[Install]
WantedBy=timers.target
@nanos
Copy link
Owner

nanos commented Sep 11, 2024

Thanks for this!

A couple of comments please:

  1. I believe your WorkingDirectory and ExecStart directives don't match the rest of the guide. Can you please either adjust these, or (and maybe that is better, given the confusion of upper/lowercase directories) tell me about changes that would be needed for the rest of the guide to bring these inline?
  2. Your system files seem to indicate you are using the python venv. The current guide suggests in step 8 to disable the venv. Should that step be removed?

PRs to the Wiki can be filed here: https://github.com/nanos/FediFetcher-docs Apologies, I need to update the README file

@Sir-Photch
Copy link

Sir-Photch commented Sep 16, 2024

I wrote a .service and .timer in the AUR package: https://aur.archlinux.org/packages/fedi-fetcher, down at "Sources".

Maybe this is useful to you

@nanos nanos added the help wanted Extra attention is needed label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants