一:进入管理界面后通过 `lsblk ` 命令查询u盘名字
![](https://cdn.nlark.com/yuque/0/2024/png/35884699/1729154050248-76276b57-7c4a-4ee1-8d83-505f129ec70c.png)
二:通过命令 mkdir 创建目录 ` mkdir /usbsd`
三:`mount /dev/sda1 /usbsd` 挂载u盘
四:切换到u盘目录下 `cd /usbsd`
五:将工具移动到/opt 目录下 ` mv restWork /opt` 并切换到opt目录下 `cd /opt`
六:创建文件`vim /etc/systemd/system/restwork.service` 按下键盘`** i**`**键 将下方代码复制 然后按下键盘 **`**ESC**`** 键输入**`**: wq**`** 退出**
```bash
[Unit]
Description=RestWork Service
After=network.target
[Service]
ExecStart=/opt/restWork
WorkingDirectory=/opt/
StandardOutput=/var/log/restwork.log
StandardError=/var/log/restwork-error.log
Restart=always
User=root
[Install]
WantedBy=multi-user.target
```
七:重启 依次输入以下命令重启
```bash
systemctl daemon-reload
systemctl enable restwork.service
systemctl start restwork.service
```