Skip to content

Commit db84d57

Browse files
committed
Finish salt-api checks skiping. Refs #450
1 parent 91af839 commit db84d57

File tree

1 file changed

+72
-14
lines changed

1 file changed

+72
-14
lines changed

bootstrap-salt.sh

Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,10 @@ install_ubuntu_git_post() {
18281828
echodebug "Copying ${__SALT_GIT_CHECKOUT_DIR}/debian/salt-${fname}.init to /etc/init.d/salt-$fname"
18291829
copyfile "${__SALT_GIT_CHECKOUT_DIR}/debian/salt-${fname}.init" "/etc/init.d/salt-$fname"
18301830
chmod +x /etc/init.d/salt-$fname
1831+
1832+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
1833+
[ $fname = "api" ] && continue
1834+
18311835
update-rc.d salt-$fname defaults
18321836
else
18331837
echoerror "Neither upstart not init.d was setup for salt-$fname"
@@ -1841,11 +1845,13 @@ install_ubuntu_restart_daemons() {
18411845
# Ensure upstart configs are loaded
18421846
[ -f /sbin/initctl ] && /sbin/initctl reload-configuration
18431847
for fname in minion master syndic api; do
1848+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
1849+
[ $fname = "api" ] && continue
18441850

18451851
# Skip if not meant to be installed
18461852
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
18471853
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
1848-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
1854+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
18491855
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
18501856

18511857
if [ -f /sbin/initctl ]; then
@@ -2299,6 +2305,10 @@ install_debian_git_post() {
22992305
continue
23002306
fi
23012307
chmod +x "/etc/init.d/salt-$fname"
2308+
2309+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2310+
[ $fname = "api" ] && continue
2311+
23022312
update-rc.d "salt-$fname" defaults
23032313
done
23042314
}
@@ -2307,11 +2317,13 @@ install_debian_restart_daemons() {
23072317
[ "$_START_DAEMONS" -eq $BS_FALSE ] && return
23082318

23092319
for fname in minion master syndic api; do
2320+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2321+
[ $fname = "api" ] && continue
23102322

23112323
# Skip if not meant to be installed
23122324
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
23132325
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
2314-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ ! -f "/etc/init.d/salt-$fname" ]) && continue
2326+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ ! -f "/etc/init.d/salt-$fname" ]) && continue
23152327
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
23162328

23172329
/etc/init.d/salt-$fname stop > /dev/null 2>&1
@@ -2386,6 +2398,9 @@ install_fedora_stable_post() {
23862398
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
23872399
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
23882400

2401+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2402+
[ $fname = "api" ] && continue
2403+
23892404
systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service)
23902405
sleep 0.1
23912406
systemctl daemon-reload
@@ -2428,6 +2443,9 @@ install_fedora_git_post() {
24282443

24292444
copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
24302445

2446+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2447+
[ $fname = "api" ] && continue
2448+
24312449
systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service)
24322450
sleep 0.1
24332451
systemctl daemon-reload
@@ -2438,10 +2456,13 @@ install_fedora_restart_daemons() {
24382456
[ $_START_DAEMONS -eq $BS_FALSE ] && return
24392457

24402458
for fname in minion master syndic api; do
2459+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2460+
[ $fname = "api" ] && continue
2461+
24412462
# Skip if not meant to be installed
24422463
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
24432464
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
2444-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
2465+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
24452466
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
24462467

24472468
systemctl stop salt-$fname > /dev/null 2>&1
@@ -2590,9 +2611,12 @@ install_centos_stable() {
25902611
install_centos_stable_post() {
25912612
for fname in minion master syndic api; do
25922613
# Skip if not meant to be installed
2614+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2615+
[ $fname = "api" ] && continue
2616+
25932617
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
25942618
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
2595-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
2619+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
25962620
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
25972621

25982622
if [ -f /etc/init.d/salt-$fname ]; then
@@ -2657,6 +2681,10 @@ install_centos_git_post() {
26572681
if [ ! -f /etc/init.d/salt-$fname ] || ([ -f /etc/init.d/salt-$fname ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
26582682
copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}" /etc/init.d/
26592683
chmod +x /etc/init.d/salt-${fname}
2684+
2685+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2686+
[ $fname = "api" ] && continue
2687+
26602688
/sbin/chkconfig salt-${fname} on
26612689
fi
26622690

@@ -2681,9 +2709,12 @@ install_centos_restart_daemons() {
26812709

26822710
for fname in minion master syndic api; do
26832711
# Skip if not meant to be installed
2712+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
2713+
[ $fname = "api" ] && continue
2714+
26842715
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
26852716
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
2686-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
2717+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
26872718
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
26882719

26892720
if [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then
@@ -3356,6 +3387,9 @@ install_arch_linux_post() {
33563387
copyfile "$_SALT_ETC_DIR/$fname.pacorig" "$_SALT_ETC_DIR/$fname" $BS_TRUE
33573388
fi
33583389

3390+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
3391+
[ $fname = "api" ] && continue
3392+
33593393
if [ -f /usr/bin/systemctl ]; then
33603394
# Using systemd
33613395
/usr/bin/systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || (
@@ -3383,6 +3417,9 @@ install_arch_linux_git_post() {
33833417
if [ -f /usr/bin/systemctl ]; then
33843418
copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
33853419

3420+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
3421+
[ $fname = "api" ] && continue
3422+
33863423
/usr/bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || (
33873424
/usr/bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 &&
33883425
/usr/bin/systemctl enable salt-${fname}.service > /dev/null 2>&1
@@ -3402,11 +3439,13 @@ install_arch_linux_restart_daemons() {
34023439
[ $_START_DAEMONS -eq $BS_FALSE ] && return
34033440

34043441
for fname in minion master syndic api; do
3442+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
3443+
[ $fname = "api" ] && continue
34053444

34063445
# Skip if not meant to be installed
34073446
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
34083447
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
3409-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
3448+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
34103449
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
34113450

34123451
if [ -f /usr/bin/systemctl ]; then
@@ -3637,6 +3676,9 @@ install_freebsd_git() {
36373676
install_freebsd_9_stable_post() {
36383677
for fname in minion master syndic api; do
36393678

3679+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
3680+
[ $fname = "api" ] && continue
3681+
36403682
# Skip if not meant to be installed
36413683
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
36423684
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
@@ -3670,11 +3712,13 @@ install_freebsd_restart_daemons() {
36703712
[ $_START_DAEMONS -eq $BS_FALSE ] && return
36713713

36723714
for fname in minion master syndic api; do
3715+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
3716+
[ $fname = "api" ] && continue
36733717

36743718
# Skip if not meant to be installed
36753719
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
36763720
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
3677-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
3721+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
36783722
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
36793723

36803724
service salt_$fname stop > /dev/null 2>&1
@@ -3808,11 +3852,13 @@ install_smartos_restart_daemons() {
38083852
[ $_START_DAEMONS -eq $BS_FALSE ] && return
38093853

38103854
for fname in minion master syndic api; do
3855+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
3856+
[ $fname = "api" ] && continue
38113857

38123858
# Skip if not meant to be installed
38133859
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
38143860
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
3815-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
3861+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
38163862
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
38173863

38183864
# Stop if running && Start service
@@ -3915,11 +3961,13 @@ install_opensuse_git() {
39153961

39163962
install_opensuse_stable_post() {
39173963
for fname in minion master syndic api; do
3964+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
3965+
[ $fname = "api" ] && continue
39183966

39193967
# Skip if not meant to be installed
39203968
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
39213969
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
3922-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
3970+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
39233971
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
39243972

39253973
if [ -f /bin/systemctl ]; then
@@ -3961,11 +4009,13 @@ install_opensuse_restart_daemons() {
39614009
[ $_START_DAEMONS -eq $BS_FALSE ] && return
39624010

39634011
for fname in minion master syndic api; do
4012+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
4013+
[ $fname = "api" ] && continue
39644014

39654015
# Skip if not meant to be installed
39664016
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
39674017
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
3968-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
4018+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
39694019
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
39704020

39714021
if [ -f /bin/systemctl ]; then
@@ -4275,11 +4325,13 @@ install_gentoo_git() {
42754325

42764326
install_gentoo_post() {
42774327
for fname in minion master syndic api; do
4328+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
4329+
[ $fname = "api" ] && continue
42784330

42794331
# Skip if not meant to be installed
42804332
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
42814333
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
4282-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
4334+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
42834335
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
42844336

42854337
if [ -d "/run/systemd/system" ]; then
@@ -4296,11 +4348,13 @@ install_gentoo_restart_daemons() {
42964348
[ $_START_DAEMONS -eq $BS_FALSE ] && return
42974349

42984350
for fname in minion master syndic api; do
4351+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
4352+
[ $fname = "api" ] && continue
42994353

43004354
# Skip if not meant to be installed
43014355
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
43024356
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
4303-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
4357+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
43044358
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
43054359

43064360
if [ -d "/run/systemd/system" ]; then
@@ -4464,12 +4518,13 @@ daemons_running() {
44644518

44654519
FAILED_DAEMONS=0
44664520
for fname in minion master syndic api; do
4521+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
4522+
[ $fname = "api" ] && continue
44674523

44684524
# Skip if not meant to be installed
44694525
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
44704526
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
44714527
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
4472-
[ $fname = "api" ] && continue
44734528
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
44744529

44754530
# shellcheck disable=SC2009
@@ -4761,10 +4816,13 @@ if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ $_START_DAEMONS -eq $BS_TRUE ]; th
47614816
echoerror "Failed to run ${DAEMONS_RUNNING_FUNC}()!!!"
47624817

47634818
for fname in minion master syndic api; do
4819+
# Skip salt-api since the service should be opt-in and not necessarily started on boot
4820+
[ $fname = "api" ] && continue
4821+
47644822
# Skip if not meant to be installed
47654823
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
47664824
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
4767-
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
4825+
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
47684826
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
47694827

47704828
if [ "$_ECHO_DEBUG" -eq $BS_FALSE ]; then

0 commit comments

Comments
 (0)