Closed tprelog closed 5 years ago
Yes, amazon_dash.install only installs the configuration file and the systemd service. You can ignore the error :+1: Probably ps
is not available in freenas and that's why it gives this error.
Thank you! Actually ps
is installed but it behaves differently than on Linux. Regardless, FreeNAS does not use systemd so if I can safely skip the python3.6 -m amazon_dash.install
step and instead copy or create the amazon-dash.yml file AND providing my own start-up file then I'm already good go.
Thanks again for you work!
I'll post back soon with the complete steps to running on amazon-dash on FreeNAS as well as the start-up script I'm using
Thanks to you for supporting Amazon-dash on FreeNAS :)
Creating an iocage-jail running Amazon-dash on FreeNAS 11.2
From the FreeNAS console ( I use ssh ) Create a new jail called amazon-dash: -n
jail-name
sudo iocage create -r 11.2-RELEASE dhcp=on bpf=yes vnet=on boot=on -n amazon-dash
Enter the Amazon-dash jail-console and begin by installing the required packages
sudo iocage console amazon-dash
pkg update && pkg install python36 bash sudo
Next we need to set the locale. In my case it's _enUS.UTF-8
setenv LANG en_US.UTF-8 && setenv LC_ALL en_US.UTF-8
And to make that persistent after reboot
printf "setenv LANG en_US.UTF-8\nsetenv LC_ALL en_US.UTF-8\n" >> /root/.cshrc
These commands will set-up pip and install amazon-dash
python3.6 -m ensurepip
pip3 install --upgrade pip
pip3 install amazon-dash
Next copy the sample amazon-dash.yml config file to /etc/
cp /usr/local/lib/python3.6/site-packages/amazon_dash/install/amazon-dash.yml /etc/
You should now be able to manually run Amazon-dash ( Ctrl+C to exit )
amazon-dash run --config /etc/amazon-dash.yml
There's no systemd, so instead the start-up script below can be used to run amazon-dash as a daemon.
Create directory and open new file in the editor.
mkdir /usr/local/etc/rc.d
ee /usr/local/etc/rc.d/amazon-dash
Copy/Paste the start-up script below
Press ESC
then ENTER
twice to exit and save
Make this file executable, enable the service and finally start amazon-dash as a daemon
chmod +x /usr/local/etc/rc.d/amazon-dash
sysrc amazondash_enable=YES
service amazon-dash start
service commands for amazon-dash
service amazon-dash [ start | stop | restart | status ]
start-up script below
#!/bin/sh
#
# PROVIDE: amazon-dash
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# amazondash_enable: Set to YES to enable the amazon-dash service.
# Default: NO
# amazondash_user: The user account used to run the amazon-dash daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run as root.
# Default: root
# amazondash_group: The group account used to run the amazon-dash daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run with group wheel.
# Default: wheel
# amazondash_conf: Path to amazon-dash.yml
# Default: /etc/amazon-dash.yml
#
. /etc/rc.subr
name=amazondash
rcvar=${name}_enable
pidfile_child="/var/run/${name}.pid"
pidfile="/var/run/${name}_daemon.pid"
load_rc_config ${name}
: ${amazondash_enable:="NO"}
: ${amazondash_user:="root"}
: ${amazondash_group:="wheel"}
: ${amazondash_config:="/etc/amazon-dash.yml"}
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
command="/usr/sbin/daemon"
start_precmd=${name}_precmd
amazondash_precmd()
{
rc_flags="-f -u ${amazondash_user} -P ${pidfile} -p ${pidfile_child} /usr/local/bin/amazon-dash run --config ${amazondash_config} ${rc_flags}"
if [ ! -e "${pidfile_child}" ]; then
install -g ${amazondash_group} -o ${amazondash_user} -- /dev/null "${pidfile_child}";
fi
if [ ! -e "${pidfile}" ]; then
install -g ${amazondash_group} -o ${amazondash_user} -- /dev/null "${pidfile}";
fi
}
stop_postcmd=${name}_postcmd
amazondash_postcmd()
{
rm -f -- "${pidfile}"
rm -f -- "${pidfile_child}"
}
run_rc_command "$1"
I've created a FreeNAS jail/plugin for Amazon Dash
How to Install
wget -O /tmp/amazon-dash.json https://raw.githubusercontent.com/tprelog/iocage-amazon-dash/master/amazon-dash.json
sudo iocage fetch -P dhcp=on vnet=on bpf=yes -n /tmp/amazon-dash.json --branch 'master'
Thanks :) and sorry the wait to answer. I will add this to the documentation in the next release.
Put an
x
into all the boxes [ ] relevant to your issue (like this:[x]
)What is the purpose of your issue?
[ ] Bug report (encountered problems with amazon-dash)
[ X ] Feature request (request for a new functionality)
[ X ] Question
[ ] Other
amazon-dash version: 1.3.1
Python version: 3.6.6
Pip & Setuptools version: 18.1
Operating System: FreeNAS 11.2
[ X ] The
pip install
orsetup install
command has been completed without errors[ ] The
python -m amazon_dash.install
command has been completed without errors[ X ] The
amazon-dash discovery
command works without errors[ X ] I have created/edited the configuration file
[ X ] Amazon-dash service or
amazon-dash --debug run
worksDescription
Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
Create a FreeNAS plugin for amazon-dash
What I Did
pkg install python36 python3.6 -m ensurepip pip install amazon-dash cp /usr/local/lib/python3.6/site-packages/amazon_dash/install/amazon-dash.yml /root/amazon-dash.yml amazon-dash run
Everything seems to be working fine
I wondering what the amazon_dash.install command does as amazon.dash seems to be working fine without it? It seems like it may just be coping the config file into place and checking for systemd.