Skip to content

feat(darwin): add launchd log file - #5878

Closed
devin-integration-bot wants to merge 2 commits into
tailscale:mainfrom
devin-integration-bot:main
Closed

devin-integration-bot wants to merge 2 commits into
tailscale:mainfrom
devin-integration-bot:main

Conversation

@devin-integration-bot

Copy link
Copy Markdown

add launchd log file

Signed-off-by: kovacs [email protected]

add launchd log file

Signed-off-by: kovacs <[email protected]>
add '-w' option

Signed-off-by: kovacs <[email protected]>
ret = err
}
out, err = exec.Command("launchctl", "unload", sysPlist).CombinedOutput()
out, err = exec.Command("launchctl", "unload", "-w", sysPlist).CombinedOutput()

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Author

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?

Copy link
Copy Markdown
Member

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.

Comment on lines +46 to +51
<key>StandardOutPath</key>
<string>/var/log/tailscaled.log</string>

<key>StandardErrorPath</key>
<string>/var/log/tailscaled.log</string>

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Author

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.

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

Successfully merging this pull request may close these issues.

4 participants