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

Add freebsd_init to extras please #2610

Open
paulprocacci opened this issue Oct 2, 2022 · 7 comments
Open

Add freebsd_init to extras please #2610

paulprocacci opened this issue Oct 2, 2022 · 7 comments

Comments

@paulprocacci
Copy link

Attached you'll find a freebsd_init.txt file. (Should be renamed to freebsd_init but github wanted a file extension)

freebsd_init.txt

Please include this to your extras directory.

Appreciate it!

@MichaIng
Copy link
Member

MichaIng commented Oct 2, 2022

I suggest to merge BSDish setup into the existing linux_init script (which can be renamed). Make the service a dedicated file and use the existing example config but adjust only the settings/lines which really must be different on BSD. That way we minimise doubled code.

@paulprocacci
Copy link
Author

A good suggestion. That would mean linux_init would need to be rewritten to NOT depend on bash and instead lean on normal sh semantics.

@MichaIng
Copy link
Member

MichaIng commented Oct 3, 2022

Ah, no bash on BSD? However, shouldn't be a big deal and has other benefits to be bourne shell compatible. I wanted to add some info output to the script anyway, probably read -p dialogs to give users more control about which steps are done. I can make bash => sh migration in the same turn.

Btw, there is an old PR to add better FreeBSD support. Would be great if this was updated/recreated based on dev branch: #1616

@paulprocacci
Copy link
Author

The default and available shells on BSD are /bin/sh, /bin/csh and /bin/tcsh.
/bin/sh on BSD is an IEEE Std1003.1specification for the shell designed by POSIX many moons ago.
/bin/sh is guaranteed to be on all operating systems (even if linux, et al symlink them elsewhere).

bash can be installed, but then you're looking at additional and in my humble opinion uneeded requirements. It installs under /usr/local/bin so in that case you'd actually have to ensure all scripts' shebang line read '#!/usr/bin/env bash' so as to PATH gets used.

To ensure it works everywhere, at least as many locations as humanly possible, a shebang line that reads '#!/bin/sh' and follows IEEE Std 1003.1 is a safe bet of working no matter where it runs.

@MichaIng
Copy link
Member

MichaIng commented Oct 3, 2022

I'd actually use #!/usr/bin/env sh shebang nowadays, but both should work very reliably. However, I agree on all points. Also I want to invoke the script via scripts in setup.cfg instead of console_scripts as part of a Python function wrapper.

@paulprocacci
Copy link
Author

paulprocacci commented Oct 3, 2022

As for the other reference to #1616 I read through it and even though I understand it's trying to add support for FreeBSD I'm not actually effected by any of the problems it's trying to fix.

For example, sha1sum exists on FreeBSD and the command works as described without needing a patch.
command -v <item> <item> won't work on FreeBSD. It allows only a single argument. In this case, your suggestion would fail.

The whole disk section of detecting disks, I have no idea why motioneye is doing disk detection at all. In the motioneye control panel, it's seeing the disk it's writing to and properly reporting on usage, but besides this I have no idea what its purpose is for. I'm using zfs instead of ufs and perhaps that's the reason why it's working for me? I'm not sure.

@Baenwort
Copy link

Have these FreeBSD improvements made it into the dev branch?

Baenwort added a commit to Baenwort/iocage-plugin-motioneye that referenced this issue Dec 16, 2022
Baenwort added a commit to Baenwort/iocage-plugin-index that referenced this issue Dec 17, 2022
sonicaj pushed a commit to ix-plugin-hub/iocage-plugin-index that referenced this issue Dec 18, 2022
* First crack at Python3 MotionEye

initial splatter

* Can I Haz Python3 branch?

trying to make version that pulls artefact for Python3 branch

* case sense?

maybe so get branch name exact

* No Can Haz

release doesn't work, lets see if branch is a option?

* cloned my own artifact 

Trying to point at Python3 artifact branch is given up. Made a clone repo with new name for python3 artifact and will see if this works

* trying python3.9 instead of 3.11

perhaps to cutting edge?

* adding bash so linux.init can work 

at least until freebsd.init is accepted motioneye-project/motioneye#2610

* restoring artefact

if the branch command works this should enable pushing this back to iX and have both old python 2 version work on artefact branch of master and when the python3 PR is accepted to this .json it should work with python3 branch of artefact. 

Once this manifest is live then can do PR to remove branch tag at same time as merging artefact branches.

* forgot revision

update revision to help with plug-in update

* branch variable doesn't work

iocage fetch supports branch variable to allow for artefact repo support of transitioning.  However, the manifest doesn't seem to. Using temp artifact to enable transition without breaking anything if I miss the merg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants