otrs/init

23 lines
610 B
Plaintext
Raw Normal View History

2019-03-29 23:54:00 +00:00
#!/bin/sh
OTRS_SOCK_DIR=/var/run/otrs
NGINX_USER=nginx
# Add nging to apache group, since otrs is group owned to apache
usermod nginx -G apache
# Make our CGI socker
mkdir ${OTRS_SOCK_DIR}
chown ${NGINX_USER} ${OTRS_SOCK_DIR}
su ${NGINX_USER} -s /bin/bash -c "/usr/sbin/fcgiwrap -fs unix:${OTRS_SOCK_DIR}/otrs.cgi.sock" &
# Install OTRS Modules
su otrs -lc "bin/otrs.Console.pl Maint::Config::Rebuild; sleep 15; bin/otrs.Console.pl Admin::Package::ReinstallAll"
# Start cron and the OTRS Daemon
/usr/sbin/crond
/opt/otrs/bin/Cron.sh start otrs
# Finally start NGINX
exec /usr/sbin/nginx "-g daemon off;"