mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-14 22:28:43 +02:00
Merge pull request #15829 from Security-Onion-Solutions/fix/reinstall2
fix reinstall
This commit is contained in:
+8
-11
@@ -202,10 +202,10 @@ check_service_status() {
|
|||||||
systemctl status $service_name > /dev/null 2>&1
|
systemctl status $service_name > /dev/null 2>&1
|
||||||
local status=$?
|
local status=$?
|
||||||
if [ $status -gt 0 ]; then
|
if [ $status -gt 0 ]; then
|
||||||
info " $service_name is not running"
|
info "$service_name is not running"
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
info " $service_name is running"
|
info "$service_name is running"
|
||||||
return 0;
|
return 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1541,11 +1541,8 @@ clear_previous_setup_results() {
|
|||||||
reinstall_init() {
|
reinstall_init() {
|
||||||
info "Putting system in state to run setup again"
|
info "Putting system in state to run setup again"
|
||||||
|
|
||||||
if [[ $install_type =~ ^(MANAGER|EVAL|MANAGERSEARCH|MANAGERHYPE|STANDALONE|FLEET|IMPORT)$ ]]; then
|
# Always include both services. check_service_status skips units that aren't present.
|
||||||
local salt_services=( "salt-master" "salt-minion" )
|
local salt_services=( "salt-master" "salt-minion" )
|
||||||
else
|
|
||||||
local salt_services=( "salt-minion" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
{
|
||||||
# remove all of root's cronjobs
|
# remove all of root's cronjobs
|
||||||
@@ -1604,6 +1601,9 @@ reinstall_init() {
|
|||||||
# Drop systemd's in-memory references to the now-removed units
|
# Drop systemd's in-memory references to the now-removed units
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
# Uninstall local Elastic Agent, if installed
|
||||||
|
elastic-agent uninstall -f
|
||||||
|
|
||||||
if command -v docker &> /dev/null; then
|
if command -v docker &> /dev/null; then
|
||||||
# Stop and remove all so-* containers so files can be changed with more safety
|
# Stop and remove all so-* containers so files can be changed with more safety
|
||||||
if [[ $(docker ps -a -q --filter "name=so-" | wc -l) -gt 0 ]]; then
|
if [[ $(docker ps -a -q --filter "name=so-" | wc -l) -gt 0 ]]; then
|
||||||
@@ -1626,10 +1626,7 @@ reinstall_init() {
|
|||||||
backup_dir /nsm/hydra "$date_string"
|
backup_dir /nsm/hydra "$date_string"
|
||||||
backup_dir /nsm/influxdb "$date_string"
|
backup_dir /nsm/influxdb "$date_string"
|
||||||
|
|
||||||
# Uninstall local Elastic Agent, if installed
|
} 2>&1 | tee -a "$setup_log"
|
||||||
elastic-agent uninstall -f
|
|
||||||
|
|
||||||
} >> "$setup_log" 2>&1
|
|
||||||
|
|
||||||
info "System reinstall init has been completed."
|
info "System reinstall init has been completed."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user