This commit is contained in:
2023-03-10 11:44:49 +08:00
parent e262fc8719
commit eb26f6e3f2
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ Description=gin-article Application
After=network.target
[Service]
User=root
User=app
WorkingDirectory=APP_PATH
ExecStart=APP_PATH/app >> APP_PATH/app.log 2>&1
Restart=always
+9
View File
@@ -1,5 +1,14 @@
#!/bin/bash
# 判断 app 用户是否存在
if id "app" >/dev/null 2>&1; then
echo "User app exists."
else
# 创建 app 用户
echo "Creating user app..."
useradd -m -s /bin/bash app
fi
app_name=gin-article
# 获取当前目录的绝对路径