[ ubuntu开启自启动 ]


在终端输入:

gnome-session-properties

配置信息(打开总段, 进入文件夹, 启动python文件)

gnome-terminal -- bash -c "cd ~/mtr-va-smart-watchdog-htd; python3 smart_watch_dog.py; exec bash"

gnome-terminal -- bash -c "cd ~/mtr-va-smart-watchdog-htd; python3 web_socket_server.py; exec bash"

gnome-terminal -- bash -c "cd ~/mtr-va-smart-watchdog-htd; echo "SWDswd3737" | sudo -S docker compose -f message_broker.yml up; exec bash"