From f130a8dddf26844105a5811b312a4ea09e5d840e Mon Sep 17 00:00:00 2001 From: resca Date: Fri, 1 Mar 2024 12:12:16 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=BB=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E3=82=92systemctl=E3=81=A7=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=82=81?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelist | 12 ++++++++++++ packages/backend/src/postgres.ts | 6 ------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/changelist b/changelist index 25178691fc90..66eb84b5276c 100755 --- a/changelist +++ b/changelist @@ -48,6 +48,14 @@ if [ $# -lt 2 ] && [ $ERR -eq 0 ]; then ERR=1 fi +if [ ! -d /etc/sysconfig ] && [ $ERR -eq 0 ]; then + sudo mkdir /etc/sysconfig + if [[ "$2" == *.service* ]]; then + sudo sed -i '/TimeoutSec=60/i EnvironmentFile=\/etc\/sysconfig\/safelist' /etc/systemd/system/$2 + else + sudo sed -i '/TimeoutSec=60/i EnvironmentFile=\/etc\/sysconfig\/safelist' /etc/systemd/system/$2.service + fi +fi while [ $# -gt 0 ] && [ $ERR -eq 0 ] do @@ -59,8 +67,10 @@ do echo "[INFO] Changing list." export SAFE_LIST='true' sudo echo "export SAFE_LIST='true'" | sudo tee /etc/profile.d/changelist.sh + sudo echo "SAFE_LIST='true'" | sudo tee /etc/sysconfig/safelist python3 changelist.py echo "[INFO] $2 will be restarting..." + #sudo systemctl daemon-reload #sudo systemctl start $2 echo "[INFO] Done." ;; @@ -71,8 +81,10 @@ do echo "[INFO] Changing list." export SAFE_LIST='false' sudo echo "export SAFE_LIST='false'" | sudo tee /etc/profile.d/changelist.sh + sudo echo "SAFE_LIST='false'" | sudo tee /etc/sysconfig/safelist python3 changelist.py echo "[INFO] $2 will be restarting..." + #sudo systemctl daemon-reload #sudo systemctl start $2 echo "[INFO] Done." ;; diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 7ba9e9370563..f9dd5025b639 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -97,12 +97,6 @@ class MyCustomLogger implements Logger { @bindThis public logQuery(query: string, parameters?: any[]) { - console.log(`SAFE_LIST= ${process.env.SAFE_LIST}`); - if(process.env.SAFE_LIST=='true') - console.log(`SAFE_LIST == true`); - if(process.env.SAFE_LIST==='true') - console.log(`SAFE_LIST === true`); - sqlLogger.info(this.highlight(query).substring(0, 100)); }