Skip to content
Snippets Groups Projects
Commit d6d515c8 authored by jurgenhaas's avatar jurgenhaas
Browse files

Latest version doesn't provide startup script anymore, make sure we create that ourselves

parent d733b842
Branches
No related tags found
No related merge requests found
......@@ -13,6 +13,14 @@
- "Add ElastAlert to Boot-List"
- "Restart ElastAlert"
- name: "Start Script"
template:
src='etc_init_d_elastalert'
dest='/etc/init.d/elastalert'
owner='root'
group='root'
mode='755'
- name: "Install PIP Components"
pip:
name='{{ item }}'
......
#!/bin/sh
### BEGIN INIT INFO
# Provides: elastalert
# Short-Description: Start and stop ElastAlert
# Description: ElastAlert
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
export HOME=/root
# Action to take
case "$1" in
start)
echo "Starting ElastAlert ..."
cd /opt/elastalert
/usr/local/bin/elastalert &
exit 0
;;
stop)
echo "Stoping ElastAlert ..."
kill `pidof /usr/bin/python /usr/local/bin/elastalert` && echo "ElastAlert stopped"
exit 0
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: service elastalert {start|stop|restart}"
exit 1
;;
esac
exit $?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment