暂存-安装服务
This commit is contained in:
15
aio-3d-huey.service
Normal file
15
aio-3d-huey.service
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=AIO 3D Printer Slice and Manage Platform Huey Tasks
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=1000
|
||||||
|
|
||||||
|
WorkingDirectory=/home/lhye200/AIO_3D_Print_Exp/
|
||||||
|
ExecStart=/home/lhye200/AIO_3D_Print_Exp/run_huey.sh
|
||||||
|
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
16
aio-3d-main.service
Normal file
16
aio-3d-main.service
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=AIO 3D Printer Slice and Manage Platform
|
||||||
|
After=aio-3d-huey.service network.target
|
||||||
|
Wants=aio-3d-huey.service network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=1000
|
||||||
|
|
||||||
|
WorkingDirectory=/home/lhye200/AIO_3D_Print_Exp/
|
||||||
|
ExecStart=/home/lhye200/AIO_3D_Print_Exp/run_main.sh
|
||||||
|
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
34
install.sh
Executable file
34
install.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Start installation AIO_3D_Print_Exp"
|
||||||
|
|
||||||
|
echo "Clean existing installation"
|
||||||
|
# rm -rf /opt/AIO_3D_Print_Exp
|
||||||
|
systemctl stop aio-3d-main.service
|
||||||
|
systemctl stop aio-3d-huey.service
|
||||||
|
# rm -rf /etc/systemd/system/aio-3d-main.service
|
||||||
|
# rm -rf /etc/systemd/system/aio-3d-huey.service
|
||||||
|
|
||||||
|
echo "Copy installation files"
|
||||||
|
# mkdir -p /opt/AIO_3D_Print_Exp
|
||||||
|
# cp -r ./. /opt/AIO_3D_Print_Exp/
|
||||||
|
|
||||||
|
echo "Set execute permissions"
|
||||||
|
# chmod +x /opt/AIO_3D_Print_Exp/run_main.sh
|
||||||
|
# chmod +x /opt/AIO_3D_Print_Exp/run_huey.sh
|
||||||
|
|
||||||
|
echo "Copy service files"
|
||||||
|
# cp /opt/AIO_3D_Print_Exp/aio-3d-main.service /etc/systemd/system/
|
||||||
|
# cp /opt/AIO_3D_Print_Exp/aio-3d-huey.service /etc/systemd/system/
|
||||||
|
cp /home/lhye200/AIO_3D_Print_Exp/aio-3d-main.service /etc/systemd/system/
|
||||||
|
cp /home/lhye200/AIO_3D_Print_Exp/aio-3d-huey.service /etc/systemd/system/
|
||||||
|
|
||||||
|
echo "Reload systemd daemon"
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable aio-3d-main.service
|
||||||
|
systemctl enable aio-3d-huey.service
|
||||||
|
systemctl start aio-3d-huey.service
|
||||||
|
systemctl start aio-3d-main.service
|
||||||
|
|
||||||
|
echo "Installation completed successfully"
|
||||||
|
|
||||||
@@ -7,3 +7,4 @@ Werkzeug>=3.0.0
|
|||||||
trimesh>=4.0.0
|
trimesh>=4.0.0
|
||||||
requests>=2.31.0
|
requests>=2.31.0
|
||||||
httpx>=0.25.0
|
httpx>=0.25.0
|
||||||
|
gunicorn>=26.0.0
|
||||||
2
run.py
2
run.py
@@ -23,4 +23,4 @@ def init_admin():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
init_admin()
|
init_admin()
|
||||||
app.run(host='0.0.0.0', port=5001, debug=True)
|
app.run(host='0.0.0.0', port=5001, debug=False)
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
venv/bin/huey_consumer run_huey.huey
|
source "$(dirname "$0")/venv/bin/activate"
|
||||||
|
|
||||||
|
# huey_consumer "run_huey.huey" > /dev/null 2>&1
|
||||||
|
huey_consumer "run_huey.huey"
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
venv/bin/python run.py
|
source "$(dirname "$0")/venv/bin/activate"
|
||||||
|
|
||||||
|
# python "$(dirname "$0")/run.py" > /dev/null 2>&1
|
||||||
|
# python "$(dirname "$0")/run.py"
|
||||||
|
|
||||||
|
python -c "from run import init_admin; init_admin()" # 确保管理员初始化被执行
|
||||||
|
gunicorn -w 4 -b 0.0.0.0:5001 "run:app"
|
||||||
|
|||||||
Reference in New Issue
Block a user