Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

系统服务安装后config.json会跑到根目录 #9

Open
wudifeixue opened this issue Mar 27, 2023 · 2 comments
Open

系统服务安装后config.json会跑到根目录 #9

wudifeixue opened this issue Mar 27, 2023 · 2 comments

Comments

@wudifeixue
Copy link
Member

今天测试新版,Linux安装成service后config会失效

@wudifeixue
Copy link
Member Author

找到了原因,文件一般生成的config.json在/home/username/config.json这里
但是作为服务安装sudo ./DDatHome-go-linux-amd64 install
并且跑起来后sudo systemctl start DDatHome-go
这个config.json会再次生成在linux超级根目录下
也就是/这里

@wudifeixue wudifeixue changed the title 不知道为什么作为系统服务安装后config会失效 系统服务安装后config.json会跑到根目录 Mar 27, 2023
@moomiji
Copy link

moomiji commented Jan 17, 2024

linux 下修改 /etc/systemd/system/DDatHome-go.service

[Service]
WorkingDirectory=$PWD

go 应该是在这设置

https://github.com/kardianos/service/blob/f4a4df2b5eb5bdd0169d5ec60e48bbb4d0a6e029/service.go#L134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants