1
0
This commit is contained in:
2023-09-14 14:46:03 +08:00
parent 58e3d5124c
commit eb7f33c477
4 changed files with 19 additions and 1 deletions

View File

@@ -1,4 +1,9 @@
# !/bin/sh
RedisConfDir=/usr/local/db/bin/conf
OMCEtcDir=/usr/local/omc/etc
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml"
echo ""
echo "* To start/stop/restart/status omc service, please run:"
echo " sudo systemctl start/stop/restart/status restagent.service"
@@ -17,6 +22,14 @@ systemctl enable captrace.service
systemctl enable adb.service
chmod +rx /usr/local/db/bin/*
systemctl daemon-reload
for CFile in $CFileList; do
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
cp ${OMCEtcDir}/default/${CFile} ${OMCEtcDir};
fi
done
if [ ! -e "${RedisConfDir}/redis.conf" ]; then
cp ${RedisConfDir}/default/redis.conf ${RedisConfDir};
fi
if ! id -u omc >/dev/null 2>&1 ; then
useradd -d /opt/omc -m -s /bin/bash -pomc123 omc;
mkdir -p /opt/omc/ftp

View File

@@ -1369,4 +1369,6 @@ rdb-save-incremental-fsync yes
# Maximum number of set/hash/zset/list fields that will be processed from
# the main dictionary scan
# active-defrag-max-scan-fields 1000
# set slave of UDM primary redis
slaveof 192.168.4.228 6379

View File

@@ -84,7 +84,7 @@
# mode.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#bind 127.0.0.1 -::1
bind 127.0.0.1 192.168.0.229
bind 127.0.0.1
# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
@@ -2081,4 +2081,6 @@ replica-weighting-factor 2
# disk space or any other I/O error Redis will instead use memory.
#
# blob-support false
# set slave of UDM primary redis
slaveof 192.168.4.228 6379

View File

@@ -54,6 +54,7 @@ cp -f systemd/adb.service ${RPM_BUILD_ROOT}/lib/systemd/system/adb.service
# 安装完成后执行
%post
if [ ! -e "${RedisConfDir}/redis.conf" ]; then cp ${RedisConfDir}/default/redis.conf ${RedisConfDir}; fi
if ! id -u omc >/dev/null 2>&1 ; then useradd -d /opt/omc -m -s /bin/bash -p1000ftp@kp omc; else echo "user omc exist"; fi
mkdir -p /opt/omc/ftp
mkdir -p /opt/omc/ftp/log