zipkin-dependencies
zipkin-dependencies copied to clipboard
It seems like crond doesn't work
When I start following command there is effect - zipkin-dependency-yyyy-mm-dd
index at elasticsearch appears for a current day:
docker run -d --env STORAGE_TYPE=elasticsearch --env ES_HOSTS=elastichost --env ES_NODES_WAN_ONLY=true openzipkin/zipkin-dependencies
but when I start this command (based on your example) there is no any effect at all even if I waiting for a long time:
docker run -d --env STORAGE_TYPE=elasticsearch --env ES_HOSTS=elastichost --env ES_NODES_WAN_ONLY=true --entrypoint /usr/sbin/crond openzipkin/zipkin-dependencies -f
Looks like this is probably because the hourly/daily scripts are owned by root. Here's the output from a local run I just did:
$ docker run --rm --env STORAGE_TYPE=elasticsearch --env ES_HOSTS=elastichost -it --entrypoint /usr/sbin/crond openzipkin/zipkin-dependencies -f
crond[1]: crond (busybox 1.31.1) started, log level 8
crond[1]: root: Permission denied
crond[1]: root: Permission denied
And checking the scripts in the container:
~ $ whoami
zipkin-dependencies
~ $ ls -l /etc/periodic/hourly/
total 4
-rw-r--r-- 1 root root 666 Dec 25 23:57 zipkin-dependencies-today
~ $ ls -l /etc/periodic/daily/
total 4
-rw-r--r-- 1 root root 691 Dec 25 23:57 zipkin-dependencies-yesterday
I specified --user root
, but result is still the same i.e. absence of any result. There were logs:
crond[1]: crond (busybox 1.31.1) started, log level 8
crond[1]: USER root pid 6 cmd run-parts /etc/periodic/15min
crond[1]: USER root pid 7 cmd run-parts /etc/periodic/15min
Hi, it seems like this issue is still open with 2.6.4: Zipkin-Dependencies Container startet with entrypoint "crontab -f -d 8"
gives me:
docker logs zipkin-dependencies-itu1
crond: crond (busybox 1.31.1) started, log level 8
crond: root: Permission denied
+1
Ping @jeqo
I think there are several issues. What i had to do, to make cron tasks work:
Run docker container with user = root
Make Scripts in /etc/periodic/ executable. - Execute permissions where missing.
Add cd /zipkin-dependencies
before start-zipkin-dependencies ...
in the cron scripts
@martin960 thanks for the comments and research!
I gave a try fixing some of these here: https://github.com/openzipkin/zipkin-dependencies/pull/198
About running as root, would it be ok just to document it and leave users to change the user on their side?
Hi, thanks for the fix. I think running as root is not ideal solution from a security perspective, but would be okay in my scenario.
Hi @jeqo, like @martin960 mentioned, running containers as root should be avoided in general. Also, I had a look at your PR and I think this point from @martin960's previous comment is still missing: "Make Scripts in /etc/periodic/ executable. - Execute permissions where missing.".