Confluent Single Node - AWS Linux Daemon script

I've been working with Confluent lately & noticed that Confluent Version 4
doesn't  have systemV or systemD scripts which allow the service to autostart as a daemon on the host OS.  I asked about these scripts in the Confluent Community slack channel & a member politely responded that these daemon scripts will be available in Confluent Version 4.1 & at the moment I would have to roll my own.

I have created a very simple Confluent systemV script that has been tested & works on AWS Linux.

Important: This script is designed for a a Single Node/Sandbox installation of Confluent and should not be used in Production deployments.  I'll follow-up with another blog that'll address all of the Confluent services in individual systemV scripts which can be used in distributed deployments.

So here is my simple AWS Linux systemV script for those who need it but obviously you need to install the Confluent platform (Use the RHEL/CentOS 6.8 repository for AWS Linux) on your AWS Linux instance.
# Create the daemon file on the host server
$ sudo touch /etc/init.d/confluent.d

# Make it executable
$ sudo chmod +x /etc/init.d/confluent.d

# Open the confluentd file in vi, vim, nano or your text editor of choice
$ sudo nano /etc/init.d/confluentd

# Paste the following script into the confluentd file and save it on the server

# chkconfig: 2345 95 20
# description: confluentd init.d service script
# processname: confluentd
# run this on the server: chkconfig –level 2345 confluentd on
case "$1" in
    echo "Starting confluent"
    # run application you want to start
    /usr/bin/confluent start &
    echo "Stopping confluentd"
    # kill application you want to stop
    /usr/bin/confluent stop
    echo "Usage: /etc/init.d/confluentd{start|stop}"
    exit 1

exit 0
# Start the Confluent service
$ sudo service confluentd start
 # Stop the Confluent Service
$ sudo service confluentd stop
 # Enable the confluentd daemon to automatically start on boot
$ sudo chkconfig confluentd on

Now you have a systemV script to start, stop & auto start the very cool Confluent services. 

Remember that this is only recommended for a development or single node/sandbox deployment & should not be used in Production environments. I'll be following up with another blog that will address Production systemV scripts on AWS Linux instances.

If you need a systemD script you're gonna have to roll your own but ping me if you'd like some help.