add cache conf file

This commit is contained in:
Daniel Eisenberg 2023-10-05 15:16:58 +03:00
parent da911582a5
commit fd1a77628e
3 changed files with 8 additions and 7 deletions

View File

@ -1,9 +1,3 @@
execute_process (
COMMAND sh -c "find / -name \"redis.conf\""
OUTPUT_VARIABLE redis_conf_path
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process (
COMMAND sh -c "which redis-server"
OUTPUT_VARIABLE redis_server_path

View File

@ -0,0 +1,6 @@
bind 127.0.0.1
port 6379
appendonly no
save ""
maxmemory 500mb
maxmemory-policy allkeys-lru

View File

@ -52,13 +52,14 @@ run_installation()
cp_exec "cp -rf lib/* ${USR_LIB_PATH}/cpnano"
cp_exec "cp -rf bin/redis-server ${CACHE_SERVICE_PATH}/"
cp_exec "cp -rf bin/redis-cli ${CACHE_SERVICE_PATH}/"
cp_exec "cp -f redis.conf ${CONF_PATH}/redis.conf"
cp_exec "cp -f cp-nano-agent-cache.cfg ${CACHE_SERVICE_PATH}/cp-nano-agent-cache.cfg"
cp_exec "cp -f cache.conf ${CONF_PATH}/redis.conf"
cp_exec "mv ${CACHE_SERVICE_PATH}/redis-server ${CACHE_SERVICE_PATH}/cp-nano-agent-cache"
cp_exec "mv ${CACHE_SERVICE_PATH}/redis-cli ${CACHE_SERVICE_PATH}/cp-nano-cache-cli"
cp_exec "chmod +x ${CACHE_SERVICE_PATH}/cp-nano-agent-cache"
cp_exec "chmod +x ${CACHE_SERVICE_PATH}/cp-nano-cache-cli"
cp_exec "chmod 600 ${CACHE_SERVICE_PATH}/cp-nano-agent-cache.cfg"
cp_exec "chmod 600 ${CONF_PATH}/redis.conf"
cp_exec "${WATCHDOG_PATH} --register ${CACHE_SERVICE_PATH}/cp-nano-agent-cache"
cp_print "Installation completed successfully." $FORCE_STDOUT