Created
January 27, 2022 11:17
-
-
Save divinity76/e05dddcaf3949827f08b5fe2a57d8ba4 to your computer and use it in GitHub Desktop.
minimum linux daemon sample
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
crontab -e: | |
@reboot /bin/bash /project/folder/cronjob_starter.sh | |
with cronjob_starter.sh containing | |
#!/bin/bash | |
if [[ $(screen -ls | grep rabbitmq_daemon) ]] | |
then | |
echo "rabbitmq_daemon already running!" | |
/bin/true | |
else | |
# echo " rabbitmq_daemon not running!" | |
screen -S rabbitmq_daemon -dm | |
# workaround for https://savannah.gnu.org/bugs/index.php?54164 | |
sleep 1 | |
screen -S rabbitmq_daemon -X stuff "cd /project/folder; bin/console rabbitmq:consumer messaging^M" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment