1:拉取代码,下载依赖,编译
git clone https://github.com/boypt/cloud-torrent.git #拉取代码
cd cloud-torrent
go get -v ./... #下载依赖
CGO_ENABLED=0 #不知道啥意思
go build -o cloud-torrent -ldflags "-s -w -X main.VERSION=1.0.0" #编译
mv cloud-torrent /usr/local/bin
2: 编写systemctl启动命令
cd /usr/lib/systemd/system
vim clound-torrent.service
编辑写入一下内容到cloud-torrent.service
[Unit]
Description=simple-torrent
[Service]
Type=simple
#User=root
#WorkingDirectory=~
#Environment=AUTH=user:ctorrent
Environment=LISTEN=:3000
ExecStart=/usr/local/bin/cloud-torrent -c ./cloud-torrent.yaml --disable-log-time
PrivateTmp=true
Restart=always
RestartPreventExitStatus=42
Res