[systemd] Move to more generic python runners

This commit is contained in:
2026-03-12 10:22:49 -04:00
parent aeca09611a
commit df47681387
6 changed files with 35 additions and 47 deletions

View File

@ -0,0 +1,17 @@
[Unit]
Description=Celery dev runner for %I
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
EnvironmentFile=%h/.local/etc/django/%i.env
ExecStart=/bin/bash -c 'cd "$DJANGO_PATH" && exec direnv exec "$DJANGO_PATH" celery -A "$CELERY_APP" worker'
Restart=on-failure
RestartSec=2
StandardOutput=append:/tmp/celery.log
StandardError=inherit
[Install]
WantedBy=default.target

View File

@ -7,7 +7,7 @@ Wants=network-online.target
Type=simple
Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
EnvironmentFile=%h/.local/etc/django/%i.env
ExecStart=/bin/bash -c 'cd "$DJANGO_PATH" && exec direnv exec "$DJANGO_PATH" poetry run python -u manage.py runserver 0.0.0.0:${DJANGO_PORT:-8000}'
ExecStart=/bin/bash -c 'cd "$DJANGO_PATH" && exec direnv exec "$DJANGO_PATH" python manage.py runserver 0.0.0.0:${DJANGO_PORT:-8000}'
Restart=on-failure
RestartSec=2
StandardOutput=append:/tmp/django.log

View File

@ -1,23 +0,0 @@
[Unit]
Description=Hungryroot Celery (just celery)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=%h/src/github.com/hungryroot/hungryroot
# Ensure Homebrew/user bins are visible (adjust if needed)
Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
# Load direnv env for the directory, then run
ExecStart=/bin/bash -lc 'eval "$(direnv export bash)" && just celery'
Restart=on-failure
RestartSec=2
StandardOutput=append:/tmp/hungryroot-celery.log
StandardError=inherit
[Install]
WantedBy=default.target

View File

@ -1,23 +0,0 @@
[Unit]
Description=Hungryroot Django (just django)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=%h/src/github.com/hungryroot/hungryroot
# Ensure Homebrew/user bins are visible (adjust if needed)
Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
# Load direnv env for the directory, then run
ExecStart=/bin/bash -lc 'eval "$(direnv export bash)" && just django'
Restart=on-failure
RestartSec=2
StandardOutput=append:/tmp/hungryroot-django.log
StandardError=inherit
[Install]
WantedBy=default.target

View File

@ -0,0 +1,17 @@
[Unit]
Description=mkdocs dev server for %I
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
EnvironmentFile=%h/.local/etc/django/%i.env
ExecStart=/bin/bash -c 'cd "$DJANGO_PATH" && exec direnv exec "$DJANGO_PATH" mkdocs serve --dev-addr 0.0.0.0:${DOCS_PORT:-8001}'
Restart=on-failure
RestartSec=2
StandardOutput=append:/tmp/mkdocs.log
StandardError=inherit
[Install]
WantedBy=default.target