I actually am the owner of that repo.
This script is specifically to run Kibana4 as a non-root user on CentOS (or RHEL-based distros).
There's a few problems that you might be running into.
First, /usr/local/kibana/bin. You'll want to make sure that that location + file is owned by the user you want to run Kibana as (aka the DAEMON_USER).
Second, DAEMON_USER is the name of the user you want to run the Kibana process as. You need to be able to run sudo service kibana start|stop|restart, however, normally it would run that process as root (per sudo). This script passes it off to the defined user so the process is running as app_kibana, rather than root. If you are having an issue with pidfiles, are you not running sudo service kibana start?
Per the example, if I installed kibana4 to lets say -- /opt and wanted to run it with the user app_kibana, it would be something like this;
# Configure location of Kibana bin
KIBANA_BIN=/opt/kibana/current/bin
# Configure User to run daemon process
DAEMON_USER=app_kibana
Then I would run
sudo service kibana start
and if you did a
ps aux | grep kibana
you'd see that the process was running under app_kibana.
app_kib+ 12425 0.0 0.1 113116 1420 ? Ss 02:38 0:00 bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /opt/kibana/bin/kibana
app_kib+ 12426 28.0 4.9 844212 50040 ? Sl 02:38 0:01 /opt/kibana/bin/../node/bin/node /opt/kibana/bin/../src/bin/kibana.js
Sorry for the long explanation, but that's how it goooeees...!