mirror of
				https://github.com/linux-do/new-api.git
				synced 2025-11-04 05:13:41 +08:00 
			
		
		
		
	chore: update one-api.service
This commit is contained in:
		@@ -1,11 +1,16 @@
 | 
			
		||||
# File path: /etc/systemd/system/one-api.service
 | 
			
		||||
# sudo systemctl daemon-reload
 | 
			
		||||
# sudo systemctl start one-api
 | 
			
		||||
# sudo systemctl enable one-api
 | 
			
		||||
# sudo systemctl status one-api
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=One API Service
 | 
			
		||||
After=network.target
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
User=yourusername                  # 守护进程用户名
 | 
			
		||||
WorkingDirectory=/path/to/One-API  # One API运行路径
 | 
			
		||||
ExecStart=/path/to/One-API/one-api --port 3000 --log-dir /path/to/One-API/logs  # 端口
 | 
			
		||||
User=ubuntu  # 注意修改用户名
 | 
			
		||||
WorkingDirectory=/path/to/one-api  # 注意修改路径
 | 
			
		||||
ExecStart=/path/to/one-api/one-api --port 3000 --log-dir /path/to/one-api/logs  # 注意修改路径和端口号
 | 
			
		||||
Restart=always
 | 
			
		||||
RestartSec=5
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user