[Unit] Description=Crystal estimation worker After=network.target [Service] Type=simple User=www-data Group=www-data # The repo lives in crystal2/, not crystal/ — the previous paths here pointed at # a directory that does not exist, so the unit could never have started. WorkingDirectory=/var/www/html/crystal/crystal2 ExecStart=/usr/bin/python3 /var/www/html/crystal/crystal2/worker/worker.py Restart=always RestartSec=5 # journald rather than a file in /var/log: the service runs as www-data, and a # log path it cannot create is a service that will not start. # journalctl -u crystal-worker -f StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target