Service won't start under CentOS 6.5
Init script should be fixed... Sudoers is configured by default from CentOS 6.4+ to require a TTY to execute sudo. Service can't start at boot because of this. The (dirty) workaround is adding - Default !RequireTTY to /etc/sudoers.conf
Clean fix is editing the following code:
# Switch to the app_user if it is not he/she who is running the script.
if [ "$USER" != "$app_user" ]; then
sudo -u "$app_user" -H -i $0 "$@"; exit;
fi
Code should be swapped for this.
# This is better than running sudo... CentOS 6.4 forward has RequireTTY enabled in the sudoers configuration -- @bdwyertech
if [ "$USER" != "$app_user" ]; then
exec su - "$app_user" -- $0 "$@"; exit;
fi