Stream: nix

Topic: Darwin: launchctl logs for a service


view this post on Zulip Srid (Mar 15 2024 at 22:32):

How do we get the logs for a failing launchd service? This is the github-runner service setup by nix-darwin.

It is surprisingly impossible to find a way to do this. One of the reasons macOS sucks compared to Linux.

view this post on Zulip Srid (Mar 15 2024 at 22:32):

$ sudo launchctl kickstart -kp system/org.nixos.github-runner-heist-extra-1
service spawned with pid: 84781
$

And that PID no longer exists after that.

view this post on Zulip Srid (Mar 15 2024 at 22:34):

image.png

Guess that's why it is failing -- my token expired.

(But can't confirm -- just guessing)

view this post on Zulip Shivaraj B H (Mar 16 2024 at 16:39):

You will have to use either the log cli command in MacOS, or if you have access to GUI you can use Console app to start filtering all the messages with system/org.nixos.github-runner-heist-extra-1 in it and then kickstart your daemon

view this post on Zulip Shivaraj B H (Mar 16 2024 at 16:40):

If you still don’t see anything, you can try enabling debug mode first, with launchctl debug and then start filtering for logs again

view this post on Zulip Srid (Mar 17 2024 at 12:22):

Console app never showed any logs for the crashed service, but I'll try the debug command next time this happens.

view this post on Zulip Srid (Mar 24 2024 at 17:53):

Nothing's coming through:

❯ sudo launchctl debug  system/org.nixos.github-runner-dioxus-desktop-template-1 --stdout ~/out --stderr ~/err
Service configured for next launch.

And:

srid on appreciate ~/code
❯  sudo launchctl kickstart system/org.nixos.github-runner-dioxus-desktop-template-1

srid on appreciate ~/code
❯ more ~/out

srid on appreciate ~/code
❯ more ~/err

view this post on Zulip Notification Bot (Mar 25 2024 at 12:06):

3 messages were moved from this topic to #nixos > Self-hosted GitHub runners by Srid.

view this post on Zulip Srid (Mar 25 2024 at 12:07):

The new nix-darwin module writes the log files (see topic referenced above), thus allowing me to not repy on Apple's slipshod tech.


Last updated: Nov 15 2024 at 12:33 UTC