Procd and passing quoted parameters

I have a command (docker run nextcloud) composed by my initscript from config:

/usr/bin/docker run  --hostname nextcloud  -p 8080:80   -e POSTGRES_PASSWORD=bogus -e POSTGRES_USER=postgres -e POSTGRES_DB=nextcloud -e POSTGRES_HOST=192.168.10.1 -e NEXTCLOUD_ADMIN_USER=admin -e NEXTCLOUD_ADMIN_PASSWORD=alsobogus -e NEXTCLOUD_TRUSTED_DOMAINS="nextcloud 192.168.10.1 www.rossco.dynu.com" -OWNCLOUD_SUB_URL=/nextcloud/  -v nextcloud:/var/www/html -v db:/var/lib/mysql  nextcloud

which runs fine when directly run in console, but not using procd:
procd_set_param command $CMD $args where $CMD is /usr/bin/docker run and $args is rest of command.

If i strip "NEXTCLOUD_TRUSTED_DOMAINS="nextcloud 192.168.10.1 www.rossco.dynu.com" from $args, procd works OK

have tried double quoting, escaped quotes to no avail. What I am seeing appears consistent with procd using quotes internally, so any quotes in parameters prematurely truncate parameters.

This is part of putting infrastructure support (config, initscripts, DNS for containers) for docker: www.rossco.org

PROCD_DEBUG sez this

{ "name": "docker", "script": "\/etc\/init.d\/docker", "instances": { "instance1": { "stderr": true, "stdout": true, "command": [ "\/usr\/bin\/docker", "run", "--hostname", "nextcloud", "-p", "8080:80", "-e", "POSTGRES_PASSWORD=bogus", "-e", "POSTGRES_USER=postgres", "-e", "POSTGRES_DB=nextcloud", "-e", "POSTGRES_HOST=192.168.10.1", "-e", "NEXTCLOUD_ADMIN_USER=admin", "-e", "NEXTCLOUD_ADMIN_PASSWORD=alsobogus", "-e", "NEXTCLOUD_TRUSTED_DOMAINS=\"nextcloud", "192.168.10.1", "www.rossco.dynu.com\"", "-e", "OWNCLOUD_SUB_URL=\/nextcloud\/", "-v", "nextcloud:\/var\/www\/html", "-v", "db:\/var\/lib\/mysql", "nextcloud" ] } }, "triggers": [ ], "data": { } }

Any ideas how to pass quotes via procd?

Thanks;
Bill

Apparently, this is not possible without procd changes, not gonna happen.

So, another way required, luckily, in the "docker run" case, environment variables for containers can be passed by file (--env-file=<env_file>).

So, parse the config, extract env var's > file, pass env vars by file.

My command line becomes: "/usr/bin/docker run --hostname nextcloud --env-file=/var/etc/nextcloud.env -p 8080:80 -v nextcloud:/var/www/html -v db:/var/lib/mysql nextcloud"

no parameters with spaces (requiring quotes), unsupported by procd required.

...B

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.