FabMo-Engine icon indicating copy to clipboard operation
FabMo-Engine copied to clipboard

Is /home/pi still the right place to be installing stuff?

Open obra opened this issue 3 years ago • 3 comments

It looks like fabmo mostly expects to be installed in /fabmo, but that on raspberry pi, the scripts that do things with the removable USB drive are getting installed into /home/pi/bin - Is that still "right" or is it something that should get updated in the codebase and config?

obra avatar May 27 '22 07:05 obra

The USB stuff is pretty much brand new. The way it's set up to run there is a service(s) in /etc/systemd/system that result in calling that script which by preference lives somewhere other /etc/systemd/system and maybe should live somewhere other than /fabmo/bin (for future ideas of what might happen if /fabmo isn't installed correctly). Where it lives is a subject worth discussing. I thought we'd probably revisit it when we get to building our own linux image from scratch rather than using an image that is a modified raspberry pi os that just evolves. Have thought we might change the user to be named shopbot and do some other things. But haven't gotten that far yet. Too many other irons in the fire.

Where would you put it? the idea is that eventually that script would look for /fabmo/bin and /fabmo/bin/collect....pl and if it didn't exist do something smart like record that on the usb thumb if shopbotsupport.txt is on the thumb. Right now it just launches the collection file or tries to and fails. Seems like a fallback might be very helpful to customer support in case anyone ever gets happy with rm -rf or if an update goes awry some day.

RobMackie avatar May 28 '22 07:05 RobMackie

On Sat, May 28, 2022, at 12:34 AM, Rob Mackie wrote:

The USB stuff is pretty much brand new. The way it's set up to run there is a service(s) in /etc/systemd/system that result in calling that script which by preference lives somewhere other /etc/systemd/system and maybe should live somewhere other than /fabmo/bin (for future ideas of what might happen if /fabmo isn't installed correctly). Where it lives is a subject worth discussing. I thought we'd probably revisit it when we get to building our own linux image from scratch rather than using an image that is a modified raspberry pi os that just evolves. Have thought we might change the user to be named shopbot and do some other things. But haven't gotten that far yet. Too many other irons in the fire.

/fabmo/bin is a fine place. The current install setup copies it to /home/pi/bin, which seemed a little suspect to me.

I do think that it'd be valuable to have directories in the repo for:

  • scripts/tools that will be run "in place" in a fabmo install
  • I think this is "/bin", but there's at least one script in "/files" that gets copied here by 'npm run initSystemFiles'
  • scripts/tools that are used to install fabmo onto a machine
  • Currently, this stuff is all commandlines inside packge.json - my docker PR starts to extract these to shell scripts
  • files that will be installed outside of /fabmo
    • right now, this is a directory called "/files" in the repo
  • scripts/tools that are used during development
  • I don't think there's a place for these yet. In practice, they could probably get lumped into the same directory as install scripts.

The docker-updating PR I submitted was not so secretly, a first step toward automating a fabmo install onto a machine that looks like a rpi. My problem is that I don't know what the installation process should be.

Figuring it out is a bit complicated because there's some historical...stuff in the Fabmo-Engine repo that I suspect is now unused.

At the top level, BOSSA/ , dockerconfigs/ and maybe scripts/ are the first ones that come to mind.

Where would you put it? the idea is that eventually that script would look for /fabmo/bin and /fabmo/bin/collect....pl and if it didn't exist do something smart like record that on the usb thumb if shopbotsupport.txt is on the thumb. Right now it just launches the collection file or tries to and fails. Seems like a fallback might be very helpful to customer support in case anyone ever gets happy with rm -rf or if an update goes awry some day.

It'd certainly be good to have a fallback for bad updates, but that might just be a systemd rule that does something clever with a shell script on a mounted USB stick on insert. Or heck, shipping the Pi configured to boot from USB before SD.

— Reply to this email directly, view it on GitHub https://github.com/FabMo/FabMo-Engine/issues/919#issuecomment-1140195466, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALC2AQ7SUFMMTPFD52TCLVMHD7NANCNFSM5XDLPSIA. You are receiving this because you authored the thread.Message ID: @.***>

obra avatar May 28 '22 22:05 obra

revist after issue #990

RobMackie avatar Nov 04 '22 15:11 RobMackie