When you run Data Pipelines
Taskrunner on your own resource, according to the following document , it do not exit out from shell.
To get the Taskrunner detached from the terminal, use
nohup java -jar /home/ec2-user/TaskRunner.jar —config /home/ec2-user/credentials.json --workerGroup=group-emr --region=us-west-2 --logUri=s3://mannem.ne/foldername &
An alternative is using
screen/tmux/byobu, which will keep the shell running, independent of the terminal.
Now, if you want to run this
Taskrunner every time your machine
Boots, It really depends on the OS distribution of your machine.
Amazon linux which are based on RedHat(RHEL) :
Create a script like
# chkconfig: 345 99 10
# says that the script must run at levels 3, 4 and 5 and the priority for start/stop is 99 and 10.
# description: auto start Taskrunner
case "$1" in
echo "Starting Taskrunner";
su - ec2-user -c "cd /home/ec2-user/ ; nohup java -jar /home/ec2-user/TaskRunner.jar —config /home/ec2-user/credentials.json --workerGroup=group-emr --region=us-west-2 --logUri=s3://logbucket.ne/foldername & ;
echo "Killing Taskrunner";
kill -9 `pgrep -f TaskRunner.jar`;
Put your script in
/etc/init.d/, owned by root and executable. At the top of the script, you can give a directive for chkconfig. Example, the following script is used to start this Taskrunner java application as ec2-user. As user root you can use
chkconfig to enable or disable the script at startup,
chkconfig –list taskrunner-bootup
chkconfig –add taskrunner-bootup
and you can use service start/stop taskrunner-bootup
You can also use
cloud-init if you wish.
Here’s some solutions for
Trackback from your site.