feat(systemd): add WantedBy option with default multi-user.target#1363
feat(systemd): add WantedBy option with default multi-user.target#1363kongfei605 merged 1 commit intoflashcatcloud:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables proper systemd service configuration by adding support for the WantedBy option through a dependency replacement. The codebase already sets WantedBy to multi-user.target (for system services) or default.target (for user services) in service_linux.go, and this change provides the underlying library support to make that configuration functional.
- Replaces
github.com/kardianos/servicewith a forkgithub.com/kongfei605/service v1.2.2that supports the WantedBy systemd option - Updates go.sum with the new dependency checksums and removes the original kardianos/service entries
- Removes an unused golang.org/x/sys dependency entry
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| go.mod | Adds replace directive to use kongfei605/service fork v1.2.2 instead of kardianos/service |
| go.sum | Updates checksums by removing kardianos/service entries and adding kongfei605/service v1.2.2 entries; also removes an unused golang.org/x/sys entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -370,6 +370,7 @@ require ( | |||
|
|
|||
| replace ( | |||
There was a problem hiding this comment.
Using a personal fork (github.com/kongfei605/service) without documentation raises maintainability and security concerns. Consider:
- Adding a comment in the code or README explaining why this fork is necessary and what features it adds (specifically WantedBy support for systemd)
- Linking to the upstream PR or issue if one exists
- If the changes are necessary long-term, consider contributing them back to the original
kardianos/servicerepository
This helps future maintainers understand the dependency choice and reduces security risks from using unmaintained forks.
| replace ( | |
| replace ( | |
| // NOTE: Using kongfei605's fork of kardianos/service for WantedBy support in systemd. | |
| // See: https://github.com/kardianos/service/pull/410 |
已经给原repo提了PR, https://github.com/kardianos/service/pull/415, 等merge后再替换回来。