#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-restart-services-redis.txt ####################### #### path: /var/www/ss-restart-services-redis ###################################################### #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Forcefully restarts the Redis service by using init.d absolute path ################## #### module version: Nginx ############################################################## #### bash aliases: ss restart services mysql, ss restart mysql ##################################### #################################################################################################### ## YOU CAN RUN SS-RESTART FOR AN EASY WAY TO RESTART ALL CORE SLICKSTACK (LEMP) MODULES ## ## THIS DOES NOT INCLUDE ANY CUSTOM UBUNTU PACKAGES THAT YOU MAY HAVE INSTALLED ## ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Restart-Services-Redis: Message (Begin Script) ############################################# #################################################################################################### ## this is a simple message that announces to the shell the purpose of this bash script ## ## it will only be noticed by sudo users who manually call ss core bash scripts ## ## echo message ## echo -e "${PURPLE}Running ss-restart-services-redis: Forcefully restarts the Redis service by using init.d absolute path... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Restart-Services-Nginx: Forcefully Restart Nginx ########################################### #################################################################################################### ## this script is using init.d instead of systemd shortcuts to allow for absolute paths ## ## asdf ## restart redis ## /etc/init.d/redis-server restart #################################################################################################### #### SS-Restart-Services-Nginx: Touch Timestamp File (End Script) ################################## #################################################################################################### ## this is a dummy timestamp file that will remember the last time this script was run ## ## it can be useful for developer reference and is sometimes used by SlickStack ## ## script timestamp ## touch /var/www/meta/.timestamp-ss-restart-services-redis #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: https://unix.stackexchange.com/questions/370942/do-you-need-to-reload-after-adding-a-rule-in-ufw/370947 ## Ref: http://blog.jonathanargentiero.com/failed-to-restart-mysql-service-unit-mysql-service-is-masked/ ## Ref: https://support.plesk.com/hc/en-us/articles/360021187734-The-service-fails-to-start-on-a-Linux-server-service-is-masked ## Ref: https://jira.percona.com/browse/PS-5226 ## Ref: https://blog.ruanbekker.com/blog/2017/12/09/unmask-a-masked-service-in-systemd/ ## Ref: https://askubuntu.com/questions/992464/version-agnostic-php-fpm-restart ## Ref: https://serverfault.com/questions/189940/how-do-you-restart-php-fpm ## Ref: https://stackoverflow.com/questions/41319291/ufw-blocks-most-ports-until-disabled-and-re-enabled-after-reboot ## Ref: https://www.vultr.com/docs/configure-ubuntu-firewall-ufw-on-ubuntu-18-04 ## Ref: https://askubuntu.com/questions/2075/whats-the-difference-between-service-and-etc-init-d ## Ref: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units ## Ref: https://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file ## SS_EOF