osixia / docker-keepalived

Keepalived container image 🐳🌴
MIT License
402 stars 146 forks source link

Configuration file is not a regular non-executable file #46

Closed defcon84 closed 3 years ago

defcon84 commented 3 years ago

If i run this docker with my own configuration file, i keep getting this error:

Keepalived[54]: Configuration file '/usr/local/etc/keepalived/keepalived.conf' is not a regular non-executable file
Keepalived[54]: Stopped Keepalived v2.0.20 (01/22,2020)

run command: docker run --rm -it --volume /srv/docker/keepalived/keepalived.conf:/container/service/keepalived/assets/keepalived.conf osixia/keepalived:2.0.20 --copy-service --loglevel debug

full log:

*** CONTAINER_LOG_LEVEL = 4 (debug)
*** Copy /container/service to /container/run/service
*** Search service in CONTAINER_SERVICE_DIR = /container/run/service :
*** link /container/run/service/keepalived/startup.sh to /container/run/startup/keepalived
*** link /container/run/service/keepalived/process.sh to /container/run/process/keepalived/run
*** link /container/run/service/keepalived/finish.sh to /container/run/process/keepalived/finish
*** Set environment for startup files
*** ignore : LANG = C.UTF-8 (keep LANG = en_US.UTF-8 )
*** ignore : LANGUAGE = C.UTF-8 (keep LANGUAGE = en_US:en )
*** Environment files will be proccessed in this order :
Caution: previously defined variables will not be overriden.
/container/environment/99-default/default.yaml

*** --- process file : /container/environment/99-default/default.yaml ---
/container/tool/run:294: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  env_vars = yaml.load(f)
*** Run commands before startup...
*** Running /container/run/startup/keepalived...
*** ------------ Environment dump ------------
*** PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
*** HOSTNAME = b88d1858596c
*** TERM = xterm
*** LANG = en_US.UTF-8
*** LANGUAGE = en_US:en
*** LC_ALL = en_US.UTF-8
*** HOME = /root
*** CONTAINER_SERVICE_DIR = /container/run/service
*** CONTAINER_STATE_DIR = /container/run/state
*** CONTAINER_LOG_LEVEL = 4
*** INITRD = no
*** LC_CTYPE = C.UTF-8
*** KEEPALIVED_COMMAND_LINE_ARGUMENTS = --log-detail --dump-conf
*** KEEPALIVED_INTERFACE = eth0
*** KEEPALIVED_PASSWORD = d0cker
*** KEEPALIVED_PRIORITY = 150
*** KEEPALIVED_UNICAST_PEERS = #COMPLEX_BASH_ENV:TABLE: KEEPALIVED_UNICAST_PEERS_ROW_1 KEEPALIVED_UNICAST_PEERS_ROW_2
*** KEEPALIVED_VIRTUAL_IPS = #COMPLEX_BASH_ENV:TABLE: KEEPALIVED_VIRTUAL_IPS_ROW_1 KEEPALIVED_VIRTUAL_IPS_ROW_2
*** KEEPALIVED_NOTIFY = /container/service/keepalived/assets/notify.sh
*** KEEPALIVED_ROUTER_ID = 51
*** KEEPALIVED_STATE = BACKUP
*** KEEPALIVED_UNICAST_PEERS_ROW_1 = 192.168.1.10
*** KEEPALIVED_UNICAST_PEERS_ROW_2 = 192.168.1.11
*** KEEPALIVED_VIRTUAL_IPS_ROW_1 = 192.168.1.231
*** KEEPALIVED_VIRTUAL_IPS_ROW_2 = 192.168.1.232
*** ------------------------------------------
*** Set environment for container process
*** ignore : LANG = C.UTF-8 (keep LANG = en_US.UTF-8 )
*** ignore : LANGUAGE = C.UTF-8 (keep LANGUAGE = en_US:en )
*** Environment files will be proccessed in this order :
Caution: previously defined variables will not be overriden.
/container/environment/99-default/default.yaml

*** --- process file : /container/environment/99-default/default.yaml ---
*** Run commands before process...
*** ------------ Environment dump ------------
*** PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
*** HOSTNAME = b88d1858596c
*** TERM = xterm
*** LANG = en_US.UTF-8
*** LANGUAGE = en_US:en
*** LC_ALL = en_US.UTF-8
*** HOME = /root
*** CONTAINER_SERVICE_DIR = /container/run/service
*** CONTAINER_STATE_DIR = /container/run/state
*** CONTAINER_LOG_LEVEL = 4
*** INITRD = no
*** LC_CTYPE = C.UTF-8
*** KEEPALIVED_COMMAND_LINE_ARGUMENTS = --log-detail --dump-conf
*** KEEPALIVED_INTERFACE = eth0
*** KEEPALIVED_PASSWORD = d0cker
*** KEEPALIVED_PRIORITY = 150
*** KEEPALIVED_UNICAST_PEERS = #COMPLEX_BASH_ENV:TABLE: KEEPALIVED_UNICAST_PEERS_ROW_1 KEEPALIVED_UNICAST_PEERS_ROW_2
*** KEEPALIVED_VIRTUAL_IPS = #COMPLEX_BASH_ENV:TABLE: KEEPALIVED_VIRTUAL_IPS_ROW_1 KEEPALIVED_VIRTUAL_IPS_ROW_2
*** KEEPALIVED_NOTIFY = /container/service/keepalived/assets/notify.sh
*** KEEPALIVED_ROUTER_ID = 51
*** KEEPALIVED_STATE = BACKUP
*** KEEPALIVED_UNICAST_PEERS_ROW_1 = 192.168.1.10
*** KEEPALIVED_UNICAST_PEERS_ROW_2 = 192.168.1.11
*** KEEPALIVED_VIRTUAL_IPS_ROW_1 = 192.168.1.231
*** KEEPALIVED_VIRTUAL_IPS_ROW_2 = 192.168.1.232
*** ------------------------------------------
*** Running /container/run/process/keepalived/run...
*** /container/run/process/keepalived/run started as PID 54
Waiting config file /usr/local/etc/keepalived/keepalived.confok
Thu Dec 10 10:18:12 2020: Starting Keepalived v2.0.20 (01/22,2020)
Keepalived[54]: Starting Keepalived v2.0.20 (01/22,2020)
Thu Dec 10 10:18:12 2020: WARNING - keepalived was build for newer Linux 4.19.36, running on Linux 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019
Keepalived[54]: WARNING - keepalived was build for newer Linux 4.19.36, running on Linux 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019
Thu Dec 10 10:18:12 2020: Command line: '/usr/local/sbin/keepalived' '-f' '/usr/local/etc/keepalived/keepalived.conf'
Keepalived[54]: Command line: '/usr/local/sbin/keepalived' '-f' '/usr/local/etc/keepalived/keepalived.conf'
Thu Dec 10 10:18:12 2020:               '--dont-fork' '--log-console' '--log-detail' '--dump-conf'
Keepalived[54]:               '--dont-fork' '--log-console' '--log-detail' '--dump-conf'
Thu Dec 10 10:18:12 2020: Configuration file '/usr/local/etc/keepalived/keepalived.conf' is not a regular non-executable file
Keepalived[54]: Configuration file '/usr/local/etc/keepalived/keepalived.conf' is not a regular non-executable file
Thu Dec 10 10:18:12 2020: Stopped Keepalived v2.0.20 (01/22,2020)
Keepalived[54]: Stopped Keepalived v2.0.20 (01/22,2020)
*** /container/run/process/keepalived/run exited with status 6
*** Run commands before finish...
*** Running /container/run/process/keepalived/finish...
*** ------------ Environment dump ------------
*** PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
*** HOSTNAME = b88d1858596c
*** TERM = xterm
*** LANG = en_US.UTF-8
*** LANGUAGE = en_US:en
*** LC_ALL = en_US.UTF-8
*** HOME = /root
*** CONTAINER_SERVICE_DIR = /container/run/service
*** CONTAINER_STATE_DIR = /container/run/state
*** CONTAINER_LOG_LEVEL = 4
*** INITRD = no
*** LC_CTYPE = C.UTF-8
*** KEEPALIVED_COMMAND_LINE_ARGUMENTS = --log-detail --dump-conf
*** KEEPALIVED_INTERFACE = eth0
*** KEEPALIVED_PASSWORD = d0cker
*** KEEPALIVED_PRIORITY = 150
*** KEEPALIVED_UNICAST_PEERS = #COMPLEX_BASH_ENV:TABLE: KEEPALIVED_UNICAST_PEERS_ROW_1 KEEPALIVED_UNICAST_PEERS_ROW_2
*** KEEPALIVED_VIRTUAL_IPS = #COMPLEX_BASH_ENV:TABLE: KEEPALIVED_VIRTUAL_IPS_ROW_1 KEEPALIVED_VIRTUAL_IPS_ROW_2
*** KEEPALIVED_NOTIFY = /container/service/keepalived/assets/notify.sh
*** KEEPALIVED_ROUTER_ID = 51
*** KEEPALIVED_STATE = BACKUP
*** KEEPALIVED_UNICAST_PEERS_ROW_1 = 192.168.1.10
*** KEEPALIVED_UNICAST_PEERS_ROW_2 = 192.168.1.11
*** KEEPALIVED_VIRTUAL_IPS_ROW_1 = 192.168.1.231
*** KEEPALIVED_VIRTUAL_IPS_ROW_2 = 192.168.1.232
*** ------------------------------------------
*** Killing all processes...
defcon84 commented 3 years ago

chmod 644 on /srv/docker/keepalived/keepalived.conf on the host fixed it.