diff --git a/build.sh b/build.sh index f01063f..1b6736e 100755 --- a/build.sh +++ b/build.sh @@ -93,24 +93,13 @@ EmsFEDir=${GitLocalRoot}/fe.ems EmsFEVue3Dir=${GitLocalRoot}/fe.ems.vue3/dist LibDir=${EmsBEDir}/lib RESTAGENT=restagent -CRONTASK=crontask SshSvcBin=sshsvc -CapTraceBin=captrace -Data2htmlBin=data2html -NBI_ALARM=nbi_alarm -NBI_AGENT=nbi_agent -AAAA_AGENT=4a_agent RestagentDir=${EmsBEDir}/${RESTAGENT} -CrontaskDir=${EmsBEDir}/${CRONTASK} SshSvcDir=${EmsBEDir}/${SshSvcBin} -CapTraceDir=${EmsBEDir}/${CapTraceBin} -Data2htmlDir=${EmsBEDir}/${Data2htmlBin} DBSQLSrcDir=${EmsBEDir}/database MiscDir=${EmsBEDir}/misc FrontBuildDir=${BuildOMCDir}/htdocs FrontSrcDir=${EmsBEDir}/front -CrontaskSize=27788951 -RestagentSize=29525312 BinWriterDir=${HOME}/bin if [[ ${RpmArch} =~ "x86_64" ]];then @@ -123,7 +112,7 @@ case "${pkgtype}" in rpm) echo "Begin to make ${pkgtype} package ======>" ReleasePkgDir=${ReleaseDir}/rpms/${RelArch} - ProcList="restagent crontask sshsvc captrace data2html" + ProcList="restagent sshsvc" cd $EmsBEDir for procName in $ProcList;do cd $EmsBEDir/$procName @@ -139,24 +128,14 @@ case "${pkgtype}" in rm -rf ${RpmBuildDir}/BUILD/usr/local/omc/etc/db/* cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir} - cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir} - cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir} - cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir} - cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir} - # ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${RESTAGENT} ${RestagentSize} - # ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${CRONTASK} ${CrontaskSize} - # cp -rf ${MiscDir}/ne-hosts ${BuildOMCBinDir} - # cp -rf ./nbi/${NBI_ALARM}/bin/${NBI_ALARM} ${BinDir2} - # cp -rf ./nbi/${NBI_AGENT}/bin/${NBI_AGENT} ${BinDir2} - # cp -rf ./${4A_AGENT}/bin/${4A_AGENT} ${BinDir2} + cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir} cp -rf ${MiscDir}/* ${BuildOMCBinDir} # rm -rf ${BinDir2}/ne-hosts cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir} rm -rf ${BuildOMCEtcDir}/db/* cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/ cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install - cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade - cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3 + cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade #Get SQL from database, overwrite from git if [ "$dumpdb" = "yes" ]; then cd ${DumpToolDir} @@ -185,7 +164,7 @@ case "${pkgtype}" in deb) echo "Begin to make ${pkgtype} package ======>" ReleasePkgDir=${ReleaseDir}/debs/${RelArch} - ProcList="restagent crontask sshsvc captrace data2html" + ProcList="restagent sshsvc" cd $EmsBEDir for procName in $ProcList;do cd $EmsBEDir/$procName @@ -223,17 +202,13 @@ case "${pkgtype}" in rm -rf ${DebBuildOMCDir}/static/* cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir} - cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir} cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir} - cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir} - cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir} cp -rf ${MiscDir}/* ${BuildOMCBinDir} cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir} rm -rf ${BuildOMCEtcDir}/db/* cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/ cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade - cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3 #Get SQL from database, overwrite from git if [ "${dumpdb}" = "yes" ]; then cd ${DumpToolDir} @@ -265,7 +240,7 @@ case "${pkgtype}" in badeb) echo "Begin to make ${pkgtype} package ======>" ReleasePkgDir=${ReleaseDir}/debs/${RelArch} - ProcList="restagent crontask sshsvc captrace data2html" + ProcList="restagent sshsvc" cd $EmsBEDir for procName in $ProcList;do cd $EmsBEDir/$procName @@ -297,17 +272,13 @@ case "${pkgtype}" in rm -rf ${DebBuildOMCDir}/static/* cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir} - cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir} cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir} - cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir} - cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir} cp -rf ${MiscDir}/* ${BuildOMCBinDir} cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir} rm -rf ${BuildOMCEtcDir}/db/* cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/ cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade - cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3 #Get SQL from database, overwrite from git if [ "${dumpdb}" = "yes" ]; then cd ${DumpToolDir} diff --git a/debbuild/22.04/DEBIAN/postinst b/debbuild/22.04/DEBIAN/postinst index 36ae1b3..c3d7bae 100755 --- a/debbuild/22.04/DEBIAN/postinst +++ b/debbuild/22.04/DEBIAN/postinst @@ -4,36 +4,23 @@ OMCRootDir=/usr/local/omc SystemdRootDir=/lib/systemd/system OMCEtcDir=${OMCRootDir}/etc FERootDir=${OMCRootDir}/htdocs/front -X86Lib64Dir=/lib/x86_64-linux-gnu OMCBinDir=${OMCRootDir}/bin OMCStaticDir=${OMCRootDir}/static UsrLocalBinDir=/usr/local/bin OMCDaemon=omcd NginxEtcDir=/etc/nginx NginxConfDir=${NginxEtcDir}/conf.d -CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf" +CFileList="restconf.yaml sshsvc.yaml omc.conf" LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png" echo "" echo "* To start/stop/restart/status omc service, please run:" echo " sudo systemctl start/stop/restart/status restagent.service" -echo " sudo systemctl start/stop/restart/status crontask.service" echo " sudo systemctl start/stop/restart/status sshsvc.service" -echo " sudo systemctl start/stop/restart/status captrace.service" echo " or run: " echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status" echo "" -cd ${X86Lib64Dir} -chmod +rx libwireshark.so.15.0.12 -if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi -if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi -chmod +rx libwiretap.so.12.0.12 -if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi -if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi -chmod +rx libwsutil.so.13.1.0 -if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi -if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi cd ${UsrLocalBinDir} if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi @@ -138,9 +125,7 @@ systemctl daemon-reload systemctl disable --now unattended-upgrades systemctl enable restagent.service -systemctl enable crontask.service systemctl enable sshsvc.service -systemctl enable captrace.service systemctl daemon-reload @@ -161,8 +146,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then fi echo -n "Starting OMC service ... " -systemctl start crontask.service systemctl start sshsvc.service -systemctl start captrace.service systemctl start restagent.service echo "done" diff --git a/debbuild/22.04/DEBIAN/postrm b/debbuild/22.04/DEBIAN/postrm index d3020a8..87c42a9 100755 --- a/debbuild/22.04/DEBIAN/postrm +++ b/debbuild/22.04/DEBIAN/postrm @@ -1,13 +1,5 @@ # !/bin/bash -X86Lib64Dir=/lib/x86_64-linux-gnu -rm -rf ${X86Lib64Dir}/libwireshark.so.15 -rm -rf ${X86Lib64Dir}/libwireshark.so -rm -rf ${X86Lib64Dir}/libwiretap.so.12 -rm -rf ${X86Lib64Dir}/libwiretap.so -rm -rf ${X86Lib64Dir}/libwsutil.so.13 -rm -rf ${X86Lib64Dir}/libwsutil.so - #rm -rf /usr/local/omc rm -rf /etc/nginx/conf.d/omc.conf rm -f /usr/local/bin/omcd @@ -17,15 +9,11 @@ systemctl daemon-reload if systemctl list-units --type=service --all | grep -q 'restagent.service'; then echo -n "Stopping OMC service ... " systemctl stop restagent.service - systemctl stop crontask.service systemctl stop sshsvc.service - systemctl stop captrace.service echo "done" fi systemctl disable restagent.service -systemctl disable crontask.service systemctl disable sshsvc.service -systemctl disable captrace.service systemctl daemon-reload diff --git a/debbuild/22.04/DEBIAN/preinst b/debbuild/22.04/DEBIAN/preinst index eb6b33e..d9a5cb1 100755 --- a/debbuild/22.04/DEBIAN/preinst +++ b/debbuild/22.04/DEBIAN/preinst @@ -4,9 +4,7 @@ systemctl daemon-reload if systemctl list-units --type=service --all | grep -q 'restagent.service'; then echo -n "Stopping OMC service ... " systemctl stop restagent.service - systemctl stop crontask.service systemctl stop sshsvc.service - systemctl stop captrace.service echo "done" fi diff --git a/debbuild/DEBIAN/postinst b/debbuild/DEBIAN/postinst index 2f8ccea..ebc35d2 100644 --- a/debbuild/DEBIAN/postinst +++ b/debbuild/DEBIAN/postinst @@ -4,36 +4,23 @@ OMCRootDir=/usr/local/omc SystemdRootDir=/lib/systemd/system OMCEtcDir=${OMCRootDir}/etc FERootDir=${OMCRootDir}/htdocs/front -X86Lib64Dir=/lib/x86_64-linux-gnu OMCBinDir=${OMCRootDir}/bin OMCStaticDir=${OMCRootDir}/static UsrLocalBinDir=/usr/local/bin OMCDaemon=omcd NginxEtcDir=/etc/nginx NginxConfDir=${NginxEtcDir}/conf.d -CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf" +CFileList="restconf.yaml sshsvc.yaml omc.conf" LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png" echo "" echo "* To start/stop/restart/status omc service, please run:" echo " sudo systemctl start/stop/restart/status restagent.service" -echo " sudo systemctl start/stop/restart/status crontask.service" echo " sudo systemctl start/stop/restart/status sshsvc.service" -echo " sudo systemctl start/stop/restart/status captrace.service" echo " or run: " echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status" echo "" -cd ${X86Lib64Dir} -chmod +rx libwireshark.so.15.0.12 -if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi -if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi -chmod +rx libwiretap.so.12.0.12 -if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi -if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi -chmod +rx libwsutil.so.13.1.0 -if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi -if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi cd ${UsrLocalBinDir} if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi @@ -82,9 +69,7 @@ systemctl daemon-reload systemctl disable --now unattended-upgrades systemctl enable restagent.service -systemctl enable crontask.service systemctl enable sshsvc.service -systemctl enable captrace.service systemctl daemon-reload @@ -105,8 +90,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then fi echo -n "Starting OMC service ... " -systemctl start crontask.service systemctl start sshsvc.service -systemctl start captrace.service systemctl start restagent.service echo "done" diff --git a/debbuild/DEBIAN/postrm b/debbuild/DEBIAN/postrm index d3020a8..87c42a9 100644 --- a/debbuild/DEBIAN/postrm +++ b/debbuild/DEBIAN/postrm @@ -1,13 +1,5 @@ # !/bin/bash -X86Lib64Dir=/lib/x86_64-linux-gnu -rm -rf ${X86Lib64Dir}/libwireshark.so.15 -rm -rf ${X86Lib64Dir}/libwireshark.so -rm -rf ${X86Lib64Dir}/libwiretap.so.12 -rm -rf ${X86Lib64Dir}/libwiretap.so -rm -rf ${X86Lib64Dir}/libwsutil.so.13 -rm -rf ${X86Lib64Dir}/libwsutil.so - #rm -rf /usr/local/omc rm -rf /etc/nginx/conf.d/omc.conf rm -f /usr/local/bin/omcd @@ -17,15 +9,11 @@ systemctl daemon-reload if systemctl list-units --type=service --all | grep -q 'restagent.service'; then echo -n "Stopping OMC service ... " systemctl stop restagent.service - systemctl stop crontask.service systemctl stop sshsvc.service - systemctl stop captrace.service echo "done" fi systemctl disable restagent.service -systemctl disable crontask.service systemctl disable sshsvc.service -systemctl disable captrace.service systemctl daemon-reload diff --git a/debbuild/DEBIAN/preinst b/debbuild/DEBIAN/preinst index eb6b33e..d9a5cb1 100644 --- a/debbuild/DEBIAN/preinst +++ b/debbuild/DEBIAN/preinst @@ -4,9 +4,7 @@ systemctl daemon-reload if systemctl list-units --type=service --all | grep -q 'restagent.service'; then echo -n "Stopping OMC service ... " systemctl stop restagent.service - systemctl stop crontask.service systemctl stop sshsvc.service - systemctl stop captrace.service echo "done" fi diff --git a/rpmbuild/SPECS/omc.spec b/rpmbuild/SPECS/omc.spec index ac03f30..08ba049 100644 --- a/rpmbuild/SPECS/omc.spec +++ b/rpmbuild/SPECS/omc.spec @@ -33,20 +33,17 @@ chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/* OMCRootDir=/usr/local/omc OMCEtcDir=${OMCRootDir}/etc FERootDir=${OMCRootDir}/htdocs/front -UsrLib64Dir=/usr/lib64 OMCBinDir=${OMCRootDir}/bin OMCStaticDir=${OMCRootDir}/static UsrLocalBinDir=/usr/local/bin OMCDaemon=omcd NginxEtcDir=/etc/nginx -CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf" +CFileList="restconf.yaml sshsvc.yaml omc.conf" LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png" echo -n "Stopping OMC service ... " systemctl stop restagent.service -systemctl stop crontask.service systemctl stop sshsvc.service -systemctl stop captrace.service echo "done" for CFile in ${CFileList}; do @@ -72,13 +69,6 @@ if [ ! -e "${FERootDir}/config.js" ]; then cp ${FERootDir}/default/config.js 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 -cd ${UsrLib64Dir} -if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi -if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi -if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi -if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi -if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi -if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi cd ${UsrLocalBinDir} if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi @@ -91,9 +81,7 @@ firewall-cmd --reload systemctl daemon-reload systemctl enable restagent.service -systemctl enable crontask.service systemctl enable sshsvc.service -systemctl enable captrace.service # read environment parameter and to do if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then @@ -112,23 +100,13 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then fi echo -n "Starting OMC service ... " -systemctl start captrace.service systemctl start sshsvc.service -systemctl start crontask.service systemctl start restagent.service echo "done" # 卸载时执行 %postun UsrLocalBinDir=/usr/local/bin -UsrLib64Dir=/usr/lib64 -cd ${UsrLib64Dir} -rm libwireshark.so.15 -rm libwireshark.so -rm libwiretap.so.12 -rm libwiretap.so -rm libwsutil.so.13 -rm libwsutil.so rm -f ${UsrLocalBinDir}/omcd # setting firewall @@ -140,25 +118,17 @@ firewall-cmd --reload if [ "$1" = "0" ] ; then sudo systemctl stop restagent.service - sudo systemctl stop crontask.service sudo systemctl stop sshsvc.service - sudo systemctl stop captrace.service #rm -rf /usr/local/omc rm -rf /etc/nginx/conf.d/omc.conf sudo systemctl disable restagent.service - sudo systemctl disable crontask.service sudo systemctl disable sshsvc.service - sudo systemctl disable captrace.service sudo systemctl daemon-reload else sudo systemctl daemon-reload sudo systemctl stop restagent.service - sudo systemctl stop crontask.service sudo systemctl stop sshsvc.service - sudo systemctl stop captrace.service - sudo systemctl start crontask.service sudo systemctl start sshsvc.service - sudo systemctl start captrace.service sudo systemctl start restagent.service fi @@ -181,11 +151,5 @@ fi /usr/local/omc/static #/etc/nginx/conf.d/omc.conf /lib/systemd/system/restagent.service -/lib/systemd/system/crontask.service /lib/systemd/system/sshsvc.service -/lib/systemd/system/captrace.service -/usr/lib64/libwireshark.so.15.0.12 -/usr/lib64/libwiretap.so.12.0.12 -/usr/lib64/libwsutil.so.13.1.0 -/usr/local/bin/tshark