Skip to content

Instantly share code, notes, and snippets.

@hey-jude
Last active December 16, 2020 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hey-jude/bcd5769954144304861d46ddd5c214ac to your computer and use it in GitHub Desktop.
Save hey-jude/bcd5769954144304861d46ddd5c214ac to your computer and use it in GitHub Desktop.
redis / keydb 프로세스 검사후 재시작 스크립트 : init.d / systemd를 쓸 수 없는 환경에서 crontab으로 대응하기 위해.
#!/bin/bash
pid=$(/usr/sbin/pidof keydb-server)
if [ -z "$pid" ]
then
#echo "\`pidof keydb-server\` is empty"
sleep 5
/bin/rm /log/puser/keydb/keydb_6379.pid
$HOME/keydb/etc/init.d/keydb-server start
#else
# echo "\`pidof keydb-server\` is $pid"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment