@@ -415,6 +415,12 @@ This is an example systemd file:
415415 Once you've put that file in :file: `/etc/systemd/system `, you should run
416416:command: `systemctl daemon-reload ` in order that Systemd acknowledges that file.
417417You should also run that command each time you modify it.
418+ Use :command: `systemctl enable celery.service ` if you want the celery service to
419+ automatically start when (re)booting the system.
420+
421+ Optionally you can specify extra dependencies for the celery service: e.g. if you use
422+ RabbitMQ as a broker, you could specify ``rabbitmq-server.service `` in both ``After= `` and ``Requires= ``
423+ in the ``[Unit] `` `systemd section <https://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BUnit%5D%20Section%20Options >`_.
418424
419425To configure user, group, :command: `chdir ` change settings:
420426``User ``, ``Group ``, and ``WorkingDirectory `` defined in
@@ -496,10 +502,16 @@ This is an example systemd file for Celery Beat:
496502 ExecStart=/bin/sh -c ' ${CELERY_BIN} -A ${CELERY_APP} beat \
497503 --pidfile=${CELERYBEAT_PID_FILE} \
498504 --logfile=${CELERYBEAT_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL}'
505+ Restart=always
499506
500507 [Install]
501508 WantedBy=multi-user.target
502509
510+ Once you've put that file in :file: `/etc/systemd/system `, you should run
511+ :command: `systemctl daemon-reload ` in order that Systemd acknowledges that file.
512+ You should also run that command each time you modify it.
513+ Use :command: `systemctl enable celerybeat.service ` if you want the celery beat
514+ service to automatically start when (re)booting the system.
503515
504516Running the worker with superuser privileges (root)
505517======================================================================
0 commit comments