-
Notifications
You must be signed in to change notification settings - Fork 395
Conversation
* added systemd unit * use systemd as default * runs as unprivileged user now (alexapi)
I installed this today (in raspbian) and exercised the systemctl commands. Works well. I'll look into getting it into Arch next. I haven't played with the pi's GPIO in Arch: I'll have to see how it works. |
Great. You'll have to do the install manually though for now. |
@alexa-pi/coreteam Any progress on CR / testing? |
I'm having trouble getting arch onto a pi. I was working on a pi 1b, but that image from archlinuxarm isn't working for me. I need some time to try the pi 2 image on my pi 2 board (my son wanted some music and has "borrowed" it with the most recent Alexa install). |
Ok. It took a little time, but I got it to run on Arch Linux on the Pi 2. (Had to create the image from another Arch box, for some reason it never worked under Raspbian.) In case folks are interested, here's what I had to do:
I ran the install as root, and systemd doesn't seem to be working with user alexapi. Not sure that any of this is what you had in mind, but it's cool to have it working. I'd say, from a raspbian perspective, that this is ready to merge. |
@maso27 Thank you for the list - we'll use that when creating OS platforms to support Arch! I wanted someone to test (/ getting it to work) running in under the alexapi user to see if that also works by default in Arch. Anyway, I have a spare SD card, so I'm gonna give it a shot. |
@maso27 Nice work, man! I am testing inits-refactor-2 with Arch on a Pi3 and a headless Zero right now. Did you happen to look at "trick the environment" at https://wiki.archlinux.org/index.php/Python ? |
Alright. I can see that it's not there by default. We need to add the group gpio, if it's not there, add the user alexapi there and set some udev rules - [1], [2]. @maso27 @illperipherals You can try this if you want to and see if it works for you so we can do it. Running under non-root is an important thing. However I'd do that in a separate PR. Maybe along with the OS platforms so it all sets up automatically? So OK to merge this as it is? |
I am wrapping up my config on the Zero right now. One small thing that has bitten me twice is when you get to the part on whether you want to retain your config file... if you hit the enter key anywhere in the install process by accident, it feeds you through that... Not a huge deal, but thought wrapping with stty might fit under this PR? |
@illperipherals Can you elaborate or post a screenshot? I'm not entirely sure what you mean. |
@renekliment When asked for the Amazon credentials in setup.sh, it allows empty values (from hitting CR during the long foreground process). |
@maso27 What does your system load look like on this build? |
@illperipherals I see. Please file an issue regarding that, since it doesn't concern init scripts / starting the app and should therefore come in another PR. |
@illperipherals I hadn't seen the "trick the environment" thing, but that could prove quite useful. I use OctoPrint with my 3D printers, and they recently switched to a virtual environment for running it. Worth investigation, for sure. And on the Arch install with an RPi2, it looks like the load of a quiescent alexa is 2.6% CPU, 5.4% memory. @renekliment I definitely agree that it's good to get away from the root requirement. I'll look into adding the GPIO group and device when next I get the chance. But yeah, I'd say this is good to merge. |
Great, merging. ad Arch for RPi: It's a shame that it's not there by default as in Raspbian, but whatever. Arch is kinda DIY and we can totally do this by ourselves. |
I know it's off-topic, but I got Arch to start with user/group alexapi. I figured since I started writing about it here I'd put what I had so others could see it. My steps: Reboot, and voila! |
@maso27 Awesome! We'll somehow include this, so users don't have to do it themselves. |
This supersedes #15, is now rebased on master.
This fixes all points in #9.
Apart from those points, it:
Important remarks:
rm /etc/init.d/AlexaPi
and installing with the new option, you have to actually restart the Pi, in order for systemd to reload the change for some reason. I guess it's confused because it previously had to use a non-native file and now we want to use native ... I don't know, I doesn't really matter.start-stop-daemon
there doesn't offer all the capabilities a full-sized does. We'll probably have to have a special init script for that OS. It's probably gonna be like the one that was here before, but I didn't want to keep it alongside, because we need to test anyway, so when we get there (AlexaPi running even on OpenWRT), we'll make one.@alexa-pi/coreteam Please test.