-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(darwin): add launchd log file #5878
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
Conversation
add launchd log file Signed-off-by: kovacs <mritd@linux.com>
add '-w' option Signed-off-by: kovacs <mritd@linux.com>
| ret = err | ||
| } | ||
| out, err = exec.Command("launchctl", "unload", sysPlist).CombinedOutput() | ||
| out, err = exec.Command("launchctl", "unload", "-w", sysPlist).CombinedOutput() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know when launctl added the -w flag? macOS releases back to 10.13 are supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a changelog for launctl, so I'm not sure if the -w option is available in 10.13, unfortunately I don't currently have a 10.13 system.
So do I need to remove this option? Or do some other work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to exist at least as of Sept. 2016, per the source code for launchctl:
https://github.com/apple-opensource/launchd/blob/master/support/launchctl.c#L2649-L2651
That source release is launchd 842.92.1, which was in macOS 10.9.5, before 10.13.
| <key>StandardOutPath</key> | ||
| <string>/var/log/tailscaled.log</string> | ||
| <key>StandardErrorPath</key> | ||
| <string>/var/log/tailscaled.log</string> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these get rotated?
Is it okay/defined for stdout+stderr to have the same value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the log size is unlimited, a feasible solution is to increase the newsyslog configuration, such as /etc/newsyslog.d/wifi.conf.
If the log is not configured, it seems that the log will be discarded and cannot be viewed.
add launchd log file
Signed-off-by: kovacs mritd@linux.com