多余文件删除
This commit is contained in:
parent
9e0f7bd2ea
commit
410afb67fb
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
[37m2025-04-13 14:43:49.464[0m [[31mERROR [0m] [1mservice.go:156[0m | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
|
||||
[37m2025-04-13 14:43:49.667[0m [[31mERROR [0m] [1mservice.go:156[0m | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
|
||||
[37m2025-04-13 14:44:23.511[0m [[32mINFO [0m] [1mservice.go:173[0m | Welcome message sent to /dev/pts/6
|
||||
[37m2025-04-13 14:44:23.517[0m [[32mINFO [0m] [1mservice.go:173[0m | Welcome message sent to /dev/pts/7
|
||||
[37m2025-04-13 14:44:26.321[0m [[32mINFO [0m] [1mservice.go:173[0m | Welcome message sent to /dev/pts/8
|
||||
[37m2025-04-13 14:44:48.667[0m [[31mERROR [0m] [1mservice.go:156[0m | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
|
||||
[37m2025-04-13 14:44:48.803[0m [[31mERROR [0m] [1mservice.go:156[0m | Error opening terminal /dev/pts/5: open /dev/pts/5: permission denied
|
||||
[37m2025-04-13 14:44:51.649[0m [[32mINFO [0m] [1mservice.go:173[0m | Welcome message sent to /dev/pts/6
|
||||
[37m2025-04-13 14:44:51.811[0m [[32mINFO [0m] [1mservice.go:173[0m | Welcome message sent to /dev/pts/7
|
||||
[37m2025-04-13 14:47:22.827[0m [[32mINFO [0m] [1mservice.go:173[0m | Welcome message sent to /dev/pts/7
|
||||
[37m2025-04-13 14:47:26.489[0m [[32mINFO [0m] [1mservice.go:173[0m | Welcome message sent to /dev/pts/7
|
||||
[37m2025-04-13 15:52:36.532[0m [[34mDEBUG [0m] [1mmain.go:39[0m | Initializing...
|
||||
[37m2025-04-13 15:52:36.532[0m [[34mDEBUG [0m] [1mmain.go:42[0m | Starting daemon...
|
||||
[37m2025-04-13 15:52:36.532[0m [[34mDEBUG [0m] [1mmain.go:128[0m | Pid file not exist.
|
||||
[37m2025-04-13 15:52:36.533[0m [[34mDEBUG [0m] [1mshm.go:84[0m | Starting to read configuration from shared memory
|
||||
[37m2025-04-13 15:52:41.535[0m [[34mDEBUG [0m] [1mconfig_manager.go:107[0m | Loading configuration from file: ./config/execve_rules.json
|
||||
[37m2025-04-13 15:52:41.535[0m [[34mDEBUG [0m] [1mconfig_loader.go:13[0m | Loading config from file: ./config/execve_rules.json
|
||||
[37m2025-04-13 15:52:41.535[0m [[34mDEBUG [0m] [1mconfig_loader.go:60[0m | Converting JSON config to C config
|
||||
[37m2025-04-13 15:52:41.536[0m [[34mDEBUG [0m] [1mshm.go:51[0m | Starting to write configuration to shared memory
|
||||
[37m2025-04-13 15:52:55.294[0m [[34mDEBUG [0m] [1msocket.go:163[0m | write: [res][wait]
|
||||
[37m2025-04-13 15:52:55.547[0m [[34mDEBUG [0m] [1msocket.go:163[0m | write: [res] 错误类型:维度不匹配错误[wait]
|
||||
[37m2025-04-13 15:52:55.794[0m [[34mDEBUG [0m] [1msocket.go:163[0m | write: [res] 错误描述:您的模型输出和目标标签的批次大小不匹配。具体来说:[wait]
|
||||
[37m2025-04-13 15:52:56.057[0m [[34mDEBUG [0m] [1msocket.go:163[0m | write: [res] - 模型输出的 batch_size 是 2[wait]
|
||||
[37m2025-04-13 15:52:56.057[0m [[34mDEBUG [0m] [1msocket.go:166[0m | write error: write unix /tmp/exec_hook/exec.sock->@: write: broken pipe
|
||||
[37m2025-04-13 15:52:56.057[0m [[34mDEBUG [0m] [1msocket.go:180[0m | connection done.
|
||||
Loading…
Reference in New Issue