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

hb-service support for FreeBSD #1349

Merged
merged 2 commits into from
May 25, 2022
Merged

hb-service support for FreeBSD #1349

merged 2 commits into from
May 25, 2022

Conversation

ohmantics
Copy link
Contributor

Following up to the offer in issue 784, this patch is the start of FreeBSD support for hb-service.

There's a lot of features in here to get working and a few aren't complete, but now seemed like a good starting point for discussion and feedback and work can continue in this PR.

  • The use of daemon sets up logging a bit differently than expected.
  • sudo should probably default to true.
  • shutdown doesn't work in a jail, so another solution is needed. (There's a TODO comment for this.)
  • I didn't actually get Avahi working, although it should be possible.
  • Restart from the UI just does a kill for now.
  • hb-service update-node just displays a message for now.

The rc service script is based on work by Stefan Bethke, who responded that the blog post from which it came is CC0.

@oznu oznu changed the base branch from master to freebsd May 25, 2022 09:28
@oznu
Copy link
Member

oznu commented May 25, 2022

Merging into freebsd branch

@oznu oznu merged commit 2204345 into homebridge:freebsd May 25, 2022
@oznu
Copy link
Member

oznu commented May 25, 2022

The use of daemon sets up logging a bit differently than expected.

Using hb-service run... sorted this.

sudo should probably default to true.

Done

shutdown doesn't work in a jail, so another solution is needed. (There's a TODO comment for this.)

Removed it, we don't need to offer this function. It's no longer enabled for new debian-based linux installs.

I didn't actually get Avahi working, although it should be possible.

Maybe we should remove the option for now then. I install avahi and dbus, I can see they are running, but Homebridge still won't use it with the avahi option.

Restart from the UI just does a kill for now.

This is the correct behaviour, I adjusted the rc file to restart Homebridge automatically after it dies. The stop command still works as expected.

hb-service update-node just displays a message for now.

That's fine, I don't see official binaries for FreeBSD anyway.

@oznu
Copy link
Member

oznu commented May 25, 2022

@oznu
Copy link
Member

oznu commented May 26, 2022

However, the homebridgeBinary path is coming up null, despite homebridge being installed with -g --unsafe-perm. run doesn't work any better for me.

Using the version currently in test, I did the following:

  • Installed FreeBSD 13.1 using standard options
  • Installed these packages: node16 npm gcc python3 sudo
  • Ran npm install -g --unsafe-perm homebridge homebridge-config-ui-x@test
  • Executed hb-service install --user homebridge

That seems to get everything working as expected.

@ohmantics
Copy link
Contributor Author

However, the homebridgeBinary path is coming up null, despite homebridge being installed with -g --unsafe-perm. run doesn't work any better for me.

Using the version currently in test, I did the following:

  • Installed FreeBSD 13.1 using standard options
  • Installed these packages: node16 npm gcc python3 sudo
  • Ran npm install -g --unsafe-perm homebridge homebridge-config-ui-x@test
  • Executed hb-service install --user homebridge

That seems to get everything working as expected.

Indeed, a fresh install this way does. Something must be different about how I was doing dev.

Only nit that sticks out now is that the system-info-widget shows the OS as unknown.

@oznu
Copy link
Member

oznu commented May 26, 2022

Only nit that sticks out now is that the system-info-widget shows the OS as unknown.

image

It seems to be picking it up here.

@oznu
Copy link
Member

oznu commented May 26, 2022

IP address info is missing

@oznu
Copy link
Member

oznu commented May 26, 2022

IP address info is missing

Fixed that, for some reason that I am sure will come back to bite me, I had an exception to not load this on FreeBSD, it seems to work fine now though.

@oznu
Copy link
Member

oznu commented May 26, 2022

Tested again in a TrueNAS Jail (FreeBSD 13.1) - seems to work as expected.

@ohmantics
Copy link
Contributor Author

Only nit that sticks out now is that the system-info-widget shows the OS as unknown.

image

It seems to be picking it up here.

systeminformation figures out the platform here. Unfortunately, my install is aarch64 (arm64) and it seems that machdep.bootmethod is only registered on i386/amd64 variants. Reported upstream here.

@oznu
Copy link
Member

oznu commented May 26, 2022

So my stance on FreeBSD support. While I'm happy to have this included, I won't be promoting its use as an officially supported platform. This is mainly because I can't automatically test it using GitHub actions (and I don't want to use the VM inside an action method). It will stay in the "Other Platforms" section of the Homebridge wiki.

@emaste
Copy link

emaste commented May 30, 2022

I can't automatically test it using GitHub actions

There are a couple of work-in-progress approaches for adding FreeBSD support to GitHub actions (not using the VM route) so hopefully this will be possible in the future.

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.

None yet

3 participants