crisidev/homebrew-chunkwm

log permission / service hangs at start

kidpixo opened this issue · 9 comments

This a link to homebrew persmission · Issue #238 · koekeishiya/chunkwm.

Thanks a lot for the brew formula @crisidev !

I installed chunkwm via homebrew ( the normal release and also the HEAD) and I got the chunkc: connection failed! .

After debugging the typical stuff ( ~./chinkwmrc not executable , hand wokr on plist etc etc) I discovered the problem was I had no permission to write in the log folder defined in the homebrew formula /usr/local/var/log/chunkwm/.

This is typical because I have a machine from work and they enforce to have an user with "Administrative" (~ sudoer but not exactly the same) and a "Normal" user (not sudoer).

The "Administrative" one install stuff and give some privileges to the "Normal" to run stuff in /usr/local/bin/ (standard homebrew root), but not to write in the ``/usr/local/var/log/`.

This crashes the chunkwm service to start and stop log files to be written! An option would be to write in standard log directory (/var/log or ~/Library/Logs/) or use /tmp/.

Ah! This is definitely a new scenario.. As a quick fix you can build the formula with --disable-logging, which should allow you to use chunkwm.

In the meantime I'll think about an option to keep the logs maybe in /tmp.

See brew info chunkwm for the full option list.

Thanks,
but I was trying to debug other stuff and I need logging.

Maybe simply change

          <key>StandardOutPath</key>
          <string>#{var}/log/chunkwm/chunkwm.out.log</string>
          <key>StandardErrorPath</key>
          <string>#{var}/log/chunkwm/chunkwm.err.log</string>

to

          <key>StandardOutPath</key>
          <string>/tmp/chunkwm.out.log</string>
          <key>StandardErrorPath</key>
          <string>/tmp/chunkwm.err.log</string>

would work, but I don't know it it interferes with other brew guidelines.

          <key>StandardOutPath</key>
          <string>/tmp/chunkwm.out</string>
          <key>StandardErrorPath</key>
          <string>/tmp/chunkwm.err</string>

I use the following in my plist file. I don't use the brew structure though, as it is easier to just handle all of this (as well as different binaries) manually as i test changes for longer periods of times.

Most times I just run chunkwm manually inside a tmux session though, rather than having it managed by launchd.

I'll leave it up to crisidev to decide what is best regarding brew guidelines and whatnot.

I'll modify the plist to have the log in temp. I dislike the brew approach to give access to too many people to /var/ subfolder in general.

The tmux way was also what I was doing to see chunkwm running and it's totally fine.

In my opinion the service way adds automatic run after start-up and system wide status check via brew service list.

I notice that small things like shift-alt-arrow and shift-cmd-arrow are overwritten, probably it's a khd thing. Should I move to khd issue and ask there?

Thank you both for the effort!

I personally like the homebrew way of managing things inside their on sort of chroot. Keeping the files on /tmp does not look right to me, but if this is needed, I can implement a simple switch during installation to change the plist output files to /tmp if the user wants.

@kidpixo, what do you think?

@crisidev I'm an heavy macport user, maybe I'm biased.

Uhm I think your solution is the best, I would go for the tmp flag.

Ok, i'll add that ASAP. Thanks for the feedback. I moved from macport to brew some time ago and I am biased as well :)

No problem, at the end we have all to eat our own dog food :-D
I eat both, but homebrew seems to be more and more attractive ...

Close the issue when you do change, I'll update my formula then.

Best,
Mario.

Just pushed new version: b5a18e3