-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Run Conjure registration tracker process using configs in environment variables. | ||
|
||
if [ $(id -u) -ne 0 ]; then | ||
echo "$0 must be run as sudo" | ||
exit 1 | ||
fi | ||
|
||
# load config. will access config in /var/lib/conjure for overrides | ||
set -a | ||
source /opt/conjure/sysconfig/conjure_regtrack.conf | ||
set +a | ||
|
||
if [ ! -f $CJ_STATION_CONFIG ]; then | ||
echo "Failed to open \$CJ_STATION_CONFIG=$CJ_STATION_CONFIG." | ||
echo "You may want to set CJ_STATION_CONFIG in the conjure.conf file before running the script" | ||
exit 1 | ||
fi | ||
|
||
echo "station_config path: $CJ_STATION_CONFIG" | ||
|
||
/opt/conjure/bin/registration-tracker |
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,20 @@ | ||
[Unit] | ||
Description=Conjure Registration Tracker | ||
|
||
[Service] | ||
Type=simple | ||
|
||
WorkingDirectory=/opt/conjure/ | ||
|
||
SyslogIdentifier=conjure | ||
|
||
ExecStart=/bin/bash /opt/conjure/scripts/start_registration-tracker.sh | ||
|
||
# send SIGHUP to the station process | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
|
||
# on stop processes will get SIGTERM, and after 10 secs - SIGKILL (default 90) | ||
TimeoutStopSec=10 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,19 @@ | ||
#!/bin/bash | ||
|
||
# private key used by the detectors | ||
CJ_PRIVKEY=/var/lib/conjure/regtracker_privkey | ||
|
||
# Path to the configuration file for the registratoin tracker | ||
CJ_STATION_CONFIG=/var/lib/conjure/regtrack_config.toml | ||
|
||
# Path to the configuration file containing phantom subnets | ||
PHANTOM_SUBNET_LOCATION=/var/lib/conjure/phantom_subnets.toml | ||
|
||
# Read local configs to allow for override of any of these settings | ||
if [ -r /var/lib/conjure/conjure_regtrack.conf ] && [ -z "${CJ_STOP_RECURSE+x}" ]; then | ||
echo "Applying local configs from /var/lib/conjure/conjure_regtrack.conf" | ||
CJ_STOP_RECURSE="true" | ||
. /var/lib/conjure/conjure_regtrack.conf | ||
fi | ||
|
||
unset CJ_STOP_RECURSE |