Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when using our own keepalived config file, and then we modify it, actually it has no effect #22

Open
BloodyKnight opened this issue Jun 12, 2018 · 1 comment

Comments

@BloodyKnight
Copy link

BloodyKnight commented Jun 12, 2018

when use our own config file, eg:
docker run
--cap-add=NET_ADMIN
-v /data/safe_town/ha/data/keepalived/conf/keepalived.conf:/container/service/keepalived/assets/keepalived.conf
--net=host
--name=keepalived
--privileged=true
-d 360/keepalived_cluster:1.4.2 --loglevel debug --copy-service
obviously,the config file is /data/safe_town/ha/data/keepalived/conf/keepalived.conf, then we edit it for some reason, but it has no effect.
after reviewing your code, I found that in the start.sh:
if [ ! -e "/usr/local/etc/keepalived/keepalived.conf" ]; then
ln -sf ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf /usr/local/etc/keepalived/keepalived.conf
fi
so, we check the /usr/local/etc/keepalived/keepalived.conf file and the ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf file, we find that the ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf has modified as expected, but the /usr/local/etc/keepalived/keepalived.conf does not, WHY?
And then I found moby/moby#13382, itseems that symbol link files are not well supported within docker,so I suggested that U can remove the link symbol file in order to support modifying configuration on the fly(at least restart).

sorry, we found that the problem is the two directory(/container/run/service and /container/service) are not consistent.

@linkvt
Copy link

linkvt commented Nov 22, 2020

Hi, I also noticed the same issue and think this is because the config files are only copied on the first container start when using --copy-service, see https://github.com/osixia/docker-light-baseimage/blob/434a7084d82ceaeb3a76b1c268916a463851550b/image/tool/run#L378-L381

@BertrandGouny is this intended to only copy the config files at the first start? Otherwise we could move the lines reference here above the if clause checking for the first start (and test again to confirm of course).

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

No branches or pull requests

3 participants