forked from revoltchat/zammad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maintenance: Automate creation of redis service on sles in postinstal…
…l.sh
- Loading branch information
Showing
3 changed files
with
6 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,6 @@ | |
|
||
set -eu | ||
|
||
# special handling for Redis on SuSE | ||
zypper install -y redis7 | ||
cp /etc/redis/default.conf.example /etc/redis/zammad.conf | ||
chown root:redis /etc/redis/zammad.conf | ||
systemctl start [email protected] | ||
|
||
zypper install -y zammad | ||
|
||
curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:3000 | grep "Zammad Helpdesk" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,7 @@ targets: | |
- libImlib2-1 | ||
- imlib2 | ||
- shared-mime-info | ||
- redis7 | ||
# We need the fuser binary from the psmisc package to detect the running redis systemd service. | ||
# Because on SUSE systems, this service is arbitrarily named (e.g.) [email protected] | ||
# So we cannot hardcode the service name as we do for other supported distros. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,13 +256,11 @@ function enforce_redis () { | |
elif [ "${OS}" == "SUSE" ]; then | ||
REDIS_PID=$(fuser 6379/tcp 2> /dev/null) | ||
if [ -z "${REDIS_PID}" ]; then | ||
echo -e "ERROR - SUSE Linux detected but no running redis-instance listening on port 6379 or REDIS_URL set.\n" | ||
echo "SUSE Linux uses a systemd template for its redis package." | ||
echo "If redis was installed via zypper, please make sure an instance of its template-service is running (e.g. [email protected]) and it is listening on port 6379." | ||
echo "Alternatively, you can set the REDIS_URL environment variable with the following command." | ||
echo -e "zammad config:set REDIS_URL=redis://your.redis.server:6379\n" | ||
echo "Please fix these issues, then run the package installation again." | ||
exit 1 | ||
echo -e "# No running instance of Redis detected.\n# Creating systemd-service: [email protected]." | ||
[[ -f '/etc/redis/zammad.conf' ]] || cp /etc/redis/default.conf.example /etc/redis/zammad.conf | ||
echo "# Ensuring correct file permissions for /etc/redis/zammad.conf." | ||
[[ $(stat -c "%U %G" /etc/redis/zammad.conf) == "root redis" ]] || chown root:redis /etc/redis/zammad.conf | ||
[email protected] | ||
else | ||
REDIS_SERVICE_NAME=$(ps -p $REDIS_PID -o unit=) | ||
echo "# Redis service ${REDIS_SERVICE_NAME} detected." | ||
|