多余文件删除

This commit is contained in:
Pan Qiancheng 2025-04-25 16:28:53 +08:00
parent 9e0f7bd2ea
commit 410afb67fb
6 changed files with 0 additions and 125 deletions

View File

@ -1,25 +0,0 @@
{
"enabled": true,
"rules": [
{
"cmd": "nvidia-smi",
"type": "warn",
"msg": "在沐曦环境下请执行mx-smi"
},
{
"cmd": "rm",
"type": "error",
"msg": "Error: rm command is forbidden"
},
{
"cmd": "pip",
"type": "warn",
"msg": "使用pip安装torch时请注意使用厂家支持版本",
"args": ["install", "torch"]
},
{
"cmd": "python",
"type": "info"
}
]
}

View File

@ -1,75 +0,0 @@
#!/bin/bash
# 定义要修改的 PAM 配置文件为 common-session
PAM_CONFIG_FILE="/etc/pam.d/common-session"
# 定义要执行的程序的完整路径
PROGRAM_PATH="/home/qcqcqc/workspace/bash_go_service/main"
# 检查程序是否存在且有执行权限
if [ ! -f "$PROGRAM_PATH" ]; then
echo "错误:程序 '$PROGRAM_PATH' 不存在。"
exit 1
fi
if [ ! -x "$PROGRAM_PATH" ]; then
echo "警告:程序 '$PROGRAM_PATH' 没有执行权限。尝试添加执行权限..."
sudo chmod +x "$PROGRAM_PATH"
if [ $? -ne 0 ]; then
echo "错误:无法添加执行权限。"
exit 1
fi
fi
# 定义要添加的 PAM 行
PAM_LINE="session optional pam_exec.so $PROGRAM_PATH"
# 备份 PAM 配置文件
BACKUP_FILE="$PAM_CONFIG_FILE.bak.$(date +%Y%m%d%H%M%S)"
echo "备份 PAM 配置文件到 '$BACKUP_FILE'..."
sudo cp "$PAM_CONFIG_FILE" "$BACKUP_FILE"
if [ $? -ne 0 ]; then
echo "错误:备份 PAM 配置文件失败。请检查 sudo 权限。"
exit 1
fi
# 检查 PAM 配置文件中是否已存在相同的行
if grep -qF "$PAM_LINE" "$PAM_CONFIG_FILE"; then
echo "PAM 配置文件 '$PAM_CONFIG_FILE' 中已存在相同的行,无需添加。"
else
# 查找合适的插入位置 (在 # end of pam-auth-update config 之后)
INSERT_POINT=$(grep -n '^# end of pam-auth-update config' "$PAM_CONFIG_FILE" | tail -n 1 | cut -d':' -f1)
if [ -z "$INSERT_POINT" ]; then
INSERT_POINT=$(grep -n '^session' "$PAM_CONFIG_FILE" | head -n 1 | cut -d':' -f1)
fi
if [ -n "$INSERT_POINT" ]; then
# 在找到的行之后插入新的 PAM 行
echo "在 '$PAM_CONFIG_FILE' 的第 $((INSERT_POINT + 1)) 行插入 '$PAM_LINE'..."
sudo sed -i "${INSERT_POINT}a $PAM_LINE" "$PAM_CONFIG_FILE"
if [ $? -ne 0 ]; then
echo "错误:修改 PAM 配置文件 '$PAM_CONFIG_FILE' 失败。请检查 sudo 权限。"
# 尝试恢复备份
echo "尝试恢复备份文件 '$BACKUP_FILE'..."
sudo cp "$BACKUP_FILE" "$PAM_CONFIG_FILE"
exit 1
fi
echo "PAM 配置文件 '$PAM_CONFIG_FILE' 已成功修改。"
else
# 如果没有找到合适的插入点,则将新行添加到文件末尾
echo "警告:未找到合适的插入点,将 '$PAM_LINE' 添加到文件末尾。"
echo "$PAM_LINE" | sudo tee -a "$PAM_CONFIG_FILE" > /dev/null
if [ $? -ne 0 ]; then
echo "错误:修改 PAM 配置文件 '$PAM_CONFIG_FILE' 失败。请检查 sudo 权限。"
# 尝试恢复备份
echo "尝试恢复备份文件 '$BACKUP_FILE'..."
sudo cp "$BACKUP_FILE" "$PAM_CONFIG_FILE"
exit 1
fi
echo "PAM 配置文件 '$PAM_CONFIG_FILE' 已修改 (添加到文件末尾)。"
fi
fi
echo "操作完成。请尝试重新登录以验证更改。"
exit 0

View File

View File

View File

@ -1,25 +0,0 @@
2025-04-13 14:43:49.464 [ERROR ] service.go:156 | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
2025-04-13 14:43:49.667 [ERROR ] service.go:156 | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
2025-04-13 14:44:23.511 [INFO ] service.go:173 | Welcome message sent to /dev/pts/6
2025-04-13 14:44:23.517 [INFO ] service.go:173 | Welcome message sent to /dev/pts/7
2025-04-13 14:44:26.321 [INFO ] service.go:173 | Welcome message sent to /dev/pts/8
2025-04-13 14:44:48.667 [ERROR ] service.go:156 | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
2025-04-13 14:44:48.803 [ERROR ] service.go:156 | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
2025-04-13 14:44:51.649 [INFO ] service.go:173 | Welcome message sent to /dev/pts/6
2025-04-13 14:44:51.811 [INFO ] service.go:173 | Welcome message sent to /dev/pts/7
2025-04-13 14:47:22.827 [INFO ] service.go:173 | Welcome message sent to /dev/pts/7
2025-04-13 14:47:26.489 [INFO ] service.go:173 | Welcome message sent to /dev/pts/7
2025-04-13 15:52:36.532 [DEBUG ] main.go:39 | Initializing...
2025-04-13 15:52:36.532 [DEBUG ] main.go:42 | Starting daemon...
2025-04-13 15:52:36.532 [DEBUG ] main.go:128 | Pid file not exist.
2025-04-13 15:52:36.533 [DEBUG ] shm.go:84 | Starting to read configuration from shared memory
2025-04-13 15:52:41.535 [DEBUG ] config_manager.go:107 | Loading configuration from file: ./config/execve_rules.json
2025-04-13 15:52:41.535 [DEBUG ] config_loader.go:13 | Loading config from file: ./config/execve_rules.json
2025-04-13 15:52:41.535 [DEBUG ] config_loader.go:60 | Converting JSON config to C config
2025-04-13 15:52:41.536 [DEBUG ] shm.go:51 | Starting to write configuration to shared memory
2025-04-13 15:52:55.294 [DEBUG ] socket.go:163 | write: [res][wait]
2025-04-13 15:52:55.547 [DEBUG ] socket.go:163 | write: [res] 错误类型:维度不匹配错误[wait]
2025-04-13 15:52:55.794 [DEBUG ] socket.go:163 | write: [res] 错误描述:您的模型输出和目标标签的批次大小不匹配。具体来说:[wait]
2025-04-13 15:52:56.057 [DEBUG ] socket.go:163 | write: [res] - 模型输出的 batch_size 是 2[wait]
2025-04-13 15:52:56.057 [DEBUG ] socket.go:166 | write error: write unix /tmp/exec_hook/exec.sock->@: write: broken pipe
2025-04-13 15:52:56.057 [DEBUG ] socket.go:180 | connection done.

BIN
main

Binary file not shown.