-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make 'reset' internal restart services. #1482
- Loading branch information
1 parent
4fc12ee
commit 74fd80f
Showing
5 changed files
with
60 additions
and
4 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
File renamed without changes.
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ COMMANDS=\ | |
validate-configurables | ||
|
||
INTERNALS=\ | ||
reset \ | ||
service | ||
|
||
default: build | ||
|
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
# | ||
# Do a full reset on pScheduler | ||
# | ||
|
||
if [ "$(id -u)" != "0" ] | ||
then | ||
echo "This must be done as root." 1>&2 | ||
exit 1 | ||
fi | ||
|
||
INTERACTIVE=false | ||
|
||
if [ -t 0 -a -t 1 -a -t 2 ] | ||
then | ||
INTERACTIVE=true | ||
cat <<EOF | ||
WARNING | ||
You are about to obliterate all stored data in pScheduler on this host. | ||
Please confirm this by typing today's date in YYYY-MM-DD format at the | ||
prompt below. | ||
EOF | ||
printf "Confirm (YYYY-MM-DD): " | ||
read DATE | ||
if [ "${DATE}" != "$(date +%F)" ] | ||
then | ||
printf "\nDate does not match today's date. Doing nothing.\n\n" | ||
exit 1 | ||
fi | ||
|
||
fi | ||
|
||
|
||
${INTERACTIVE} && printf "\n" | ||
pscheduler internal service stop | ||
|
||
${INTERACTIVE} && printf "\nClearing all pScheduler data..." | ||
pscheduler internal db-reset < /dev/null | ||
${INTERACTIVE} && printf " Done.\n\n" | ||
|
||
pscheduler internal service start | ||
|
||
${INTERACTIVE} && printf "\n\nDone. Hope you meant to do that.\n\n" | ||
|
||
exit 0 |
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