Skip to content

cephadm: fix escaping/quoting of stderr-prefix arg for ceph daemons - #39730

Merged
liewegas merged 1 commit into
ceph:masterfrom
liewegas:cephadm-fix-log-prefix
Mar 2, 2021
Merged

liewegas merged 1 commit into
ceph:masterfrom
liewegas:cephadm-fix-log-prefix

Conversation

@liewegas

@liewegas liewegas commented Feb 26, 2021 •

Copy link
Copy Markdown
Member

cephadm: fix escaping/quoting of stderr-prefix arg for ceph daemons

@liewegas
liewegas requested a review from a team as a code owner February 26, 2021 20:47
@liewegas
liewegas force-pushed the cephadm-fix-log-prefix branch from 4f6e021 to 13befd6 Compare February 26, 2021 20:48
@liewegas liewegas changed the title <!-- Thank you for opening a pull request! Here are some tips on creating a well formatted contribution. cephadm: fix escaping/quoting of stderr-prefix arg for ceph daemons Feb 26, 2021
@sebastian-philipp

Copy link
Copy Markdown
Contributor

Comment thread src/cephadm/cephadm Resolved
@github-actions

github-actions Bot commented Mar 2, 2021

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

On some versions of podman doing

   --default-log-stderr-prefix="debug "

seems to work okay, but on others it does not, producing lines like

   /usr/bin/ceph-mon: "debug "2021-02-26T15:30:36.266+0000 7f3d8a955700  4 rocksdb:                    Options.db_write_buffer_size: 0

Quote things properly for the unit.run bash script.

Signed-off-by: Sage Weil <[email protected]>
@votdev

votdev commented Apr 4, 2022 •

Copy link
Copy Markdown
Member

This PR has introduced a regression, custom containers (type='container') can not be deployed anymore.
Example of a custom service spec:

service_type: container
service_id: prometheus-webhook-snmp
placement:
  hosts:
    - master
image: registry.suse.com/ses/7/prometheus-webhook-snmp:latest
args:
    - "--publish 9099:9099"
envs:
    - ARGS="--debug --snmp-host=192.168.121.1"
    - RUN_ARGS="--metrics"

The shlex.quote is doing too much. E.g. the additional podman command line arg --publish 9099:9099 will be converted to "--publish 9099:9099" which leads to an podman error Error: unknown flag: --publish 9099:9099. Additionally environment variables will look like -e 'ARGS="--debug --snmp-host=192.168.121.1"' -e 'RUN_ARGS="--metrics"' in the resulting unit.run file.

It was possible to deploy whatever Docker container before this PR, e.g.

service_type: container
service_id: aria2-with-webui
placement:
    host_pattern: mgr0
image: abcminiuser/docker-aria2-with-webui:latest-ng
args:
    - "-p 6800:6800"
    - "-p 6880:80"
envs:
    - PGID=65534
    - PUID=65534
dirs:
    - DATA_DIR
volume_mounts:
    DATA_DIR: /data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants