Docker Community Forums

Share and learn in the Docker community.

Having trouble running Some /etc/init.d shell scripts

(Vsag96) #1


I am trying trying to run celery worker as a background daemon and the script has the following code.

# Names of nodes to start
#   most people will only start one node:
#   but you can also start multiple and configure settings
#   for each in CELERYD_OPTS
#CELERYD_NODES="worker1 worker2 worker3"
#   alternatively, you can specify the number of nodes to start:

# Absolute or relative path to the 'celery' command:

# App instance to use
# comment out this line if you don't use an app
# or fully qualified:

# Where to chdir at start.

# Extra command-line arguments to the worker
CELERYD_OPTS="--time-limit=300 --concurrency=4"
# Configure node-specific settings by appending node name to arguments:
#CELERYD_OPTS="--time-limit=300 -c 8 -c:worker2 4 -c:worker3 2 -Ofair:worker1"

# Set logging level to DEBUG

# %n will be replaced with the first part of the nodename.

# Workers should run as an unprivileged user.
#   You need to create this user manually (or you can choose
#   a user/group combination that already exists (e.g., nobody).

# If enabled pid and log directories will be created if missing,
# and owned by the userid/group configured.

This file exists in both /etc/init.d/ and /etc/alternatives. When I try to do /etc/init.d/celeryd start I get
bash: /etc/init.d/celeryd: Permission denied. I think this is because I try to run these processed with celery as a user and not root? What have I done wrong? Can anyone help me thanks.

(Martin Terp) #2

Processes are not really ment to be run “in the background” on docker.
But its possible to run multiple processes with fx. Supervisor, see my previous post on this subject