Skip to content

Commit

Permalink
Update enable_service.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonRust authored Oct 13, 2024
1 parent cc53858 commit 4467e33
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions scripts/enable_service.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
BASEDIR=$(dirname $0)
sudo cp $BASEDIR/dora-daemon.service /etc/systemd/system/dora-daemon.service
sudo tee /etc/systemd/system/dora-daemon.service << EOF
Description=Dora Daemon in Conda Environment
After=network.target
[Service]
User=HwHiAiUser
Environment='PATH=$PATH'
WorkingDirectory=/home/HwHiAiUser
ExecStart=/bin/bash --login -c 'source /home/HwHiAiUser/.bashrc && source $CONDA_PREFIX/bin/activate base && dora daemon --inter-daemon-addr 0.0.0.0:20001 --machine-id $(cat /etc/machine-id | head -c 3)'
Restart=always
RestartSec=3
StartLimitInterval=60
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable dora-daemon.service
sudo systemctl start dora-daemon.service
sudo systemctl restart dora-daemon.service

0 comments on commit 4467e33

Please sign in to comment.