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

[改进] macOS 运行为服务时配置不正确 #1028

Open
oissevalt opened this issue Aug 30, 2024 · 0 comments
Open

[改进] macOS 运行为服务时配置不正确 #1028

oissevalt opened this issue Aug 30, 2024 · 0 comments

Comments

@oissevalt
Copy link
Contributor

目前在 macOS 上将海豹运行为服务,会创建 /Library/LaunchDaemons/sealdice.plist 并写入:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<false/>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>sealdice</string>
	<key>ProgramArguments</key>
	<array>
		<string>/海豹目录/sealdice-core</string>
	</array>
	<key>RunAtLoad</key>
	<false/>
	<key>SessionCreate</key>
	<false/>
	<key>StandardErrorPath</key>
	<string>/var/log/sealdice.err.log</string>
	<key>StandardOutPath</key>
	<string>/var/log/sealdice.out.log</string>
	<key>WorkingDirectory</key>
	<string>/海豹目录/sealdice146</string>
</dict>
</plist>

此行为有如下不妥:

  1. /Library/LaunchDaemons 中创建的服务是放在 system 域下的,用户操作需要 sudo 权限;
  2. 原因不明,但用户无法通过 launchctl startlaunchctl stop 来开关服务,而要用 launchctl bootstraplaunchctl bootout
  3. 在菜单栏退出海豹后,系统会立刻重启服务,除非用 sudo launchctl bootout system/sealdice 停止。
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

1 participant