Jenkins Chained Builds Day 80

How to accomplish the task kindly help.

Following is what I tried .
Kindly visit git page :


In “Step 7: Create Upstream Build Job” shall i add the down stream job to Post-build Actions >Build other projects. So that once the upsteam project is build it will trigger the downstream project.

Error i got when i submitted the task -




Also note storage server cannot be accessed with username :- sarah and password :- Sarah_pass123

<br><br>
![Screenshot (437)|690x388](upload://860tPXDeUAHukMrqccO9bdwW415.png)

This guy has a potential solution – see if it works for you.

Many thanks for your help Sir. As advised by you i followed the instructions in the link provided by you.

But when I manually triggered the ‘nautilus-app-deployment’ job, it successfully triggered the ‘manage-services’ job, which in turn restarted the Apache service. However, the console output indicates that the restart and running status of Apache were only confirmed on stapp01 and not other servers

Following is the console output:

Started by upstream project "nautilus-app-deployment
" build number 1

originally caused by:
 Started by user admin

Started by upstream project "nautilus-app-deployment
" build number 1

originally caused by:
 Started by user admin

Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/manage-services
[SSH] script:

sudo systemctl restart httpd
sudo systemctl status httpd

[SSH] executing...
e[?1he=
e[0;1;32m●e[0m httpd.service - The Apache HTTP Servere[m
     Loaded: loaded (e]8;;file://stapp01.stratos.xfusioncorp.com/usr/lib/systemd/system/httpd.service /usr/lib/systemd/system/httpd.servicee]8;; ; e[0;1;38;5;185mdisablede[0m; preset: e[0;1;38;5;185mde[me[7m>e[m
     Active: e[0;1;32mactive (running)e[0m since Sat 2025-10-11 06:08:23 UTC; 84ms agoe[m
       Docs: e]8;;man:httpd.service(8) man:httpd.service(8)e]8;; e[m
   Main PID: 3683 (httpd)e[m
     Status: "Started, listening on: port 8080"e[m
      Tasks: 177 (limit: 411140)e[m
     Memory: 21.0Me[m
     CGroup: /docker/03d29edea115b7f15f773935ff1fa5b96ed2927384ab06ce3648c4dacce[me[7m>e[m
             ├─e[0;38;5;245m3683 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             ├─e[0;38;5;245m3690 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             ├─e[0;38;5;245m3691 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             ├─e[0;38;5;245m3692 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             └─e[0;38;5;245m3693 /usr/sbin/httpd -DFOREGROUNDe[0me[m
e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Got e[me[7m>e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com httpd[3683]: AH00558: httpd: Coe[me[7m>e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Got e[me[7m>e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com httpd[3683]: Server configured,e[me[7m>e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Got e[me[7m>e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Chane[me[7m>e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Job e[me[7m>e[m
Oct 11 06:08:23 stapp01.stratos.xfusioncorp.com systemd[1]: Started The Apache e[me[7m>e[m

Additionally, in the ‘manage-services’ job, under the ‘Execute shell script on remote host using SSH’ build step, if I configure the script to run on individual servers (stapp01, stapp02, or stapp03), the console output confirms the restart and running status of Apache on each respective server. However, when configured to run on all three servers, the output only reflects the status for the first server.

Started by user admin

Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/manage-services
[SSH] script:

echo BigGr33n | sudo -S sudo systemctl restart httpd && sudo systemctl status httpd

[SSH] executing...
e[?1he=
e[0;1;32m●e[0m httpd.service - The Apache HTTP Servere[m
     Loaded: loaded (e]8;;file://stapp03.stratos.xfusioncorp.com/usr/lib/systemd/system/httpd.service /usr/lib/systemd/system/httpd.servicee]8;; ; e[0;1;38;5;185mdisablede[0m; preset: e[0;1;38;5;185mde[me[7m>e[m
     Active: e[0;1;32mactive (running)e[0m since Sat 2025-10-11 06:26:51 UTC; 129ms agoe[m
       Docs: e]8;;man:httpd.service(8) man:httpd.service(8)e]8;; e[m
   Main PID: 4264 (httpd)e[m
     Status: "Started, listening on: port 8080"e[m
      Tasks: 177 (limit: 411140)e[m
     Memory: 15.6Me[m
     CGroup: /docker/a186890c44f565ea1e94677a5d617a9899e0c81f3c6a056bbb4da17745e[me[7m>e[m
             ├─e[0;38;5;245m4264 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             ├─e[0;38;5;245m4271 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             ├─e[0;38;5;245m4272 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             ├─e[0;38;5;245m4273 /usr/sbin/httpd -DFOREGROUNDe[0me[m
             └─e[0;38;5;245m4274 /usr/sbin/httpd -DFOREGROUNDe[0me[m
e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Got e[me[7m>e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com httpd[4264]: AH00558: httpd: Coe[me[7m>e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Got e[me[7m>e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com httpd[4264]: Server configured,e[me[7m>e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Got e[me[7m>e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Chane[me[7m>e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245me[0;1;31me[0;38;5;245mhttpd.service: Job e[me[7m>e[m
Oct 11 06:26:51 stapp03.stratos.xfusioncorp.com systemd[1]: Started The Apache e[me[7m>e[m






@dpakmishra.1983 Please did you configure the command

sudo systemctl restart httpd
sudo systemctl status httpd

for all the servers?

Yes I have successfully build with the sudo command and also the echo command. Configuring the three servers and configuring one server at a time. It worked.
But the issue is the output shows only start and status for the first server .
Have you completed this task ?

yes like 5days ago now if am not mistaking, won’t document any task if i didn’t pass the stage or complete it

Can you share the method to accomplish the task…

@dpakmishra.1983 That is exactly what i document, the repo he send to you i am he one who manages it this one Day80 and i will also advice you to us ansible Enable passwordless sudo in all app servers

@rob_kodekloud @bansikah
I am still facing the same issue, although the manage-services job could start the apache services on stapp01 it is not able to start the same on the other servers.






When i configured stapp02 first and then stapp01 server in the manage-services job , it satrted the apache services on stapp02 but not on the other two.

Following is the what i got when i submitted the task:-

@dpakmishra.1983 please delete your creds from here I won’t i advice thst instead we can have a call teams or zoom here is my email: [email protected] you can schedule a call please let’s do it

A classic behavior of the systemctl status command is its tendency to halt automated scripts.

Why systemctl status Halts Automation ?

Explanation:

When we run the sudo systemctl status httpd command in the jumphost or command prompt, the output ends with the message ‘End’ and doesn’t immediately return to the command prompt. Is this why Jenkins fails to proceed to the other servers?

[root@stapp01 tony]# sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; preset: disabled)
     Active: active (running) since Sun 2025-10-12 11:06:57 UTC; 1min 47s ago
       Docs: man:httpd.service(8)
   Main PID: 3674 (httpd)
     Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec:   0 B/sec"
      Tasks: 177 (limit: 411140)
     Memory: 21.3M
     CGroup: /docker/4be4ba9570c23a7158da37ba7a2de461f423f267734da75b9ee69636ab632c4b/system.slice/httpd.service
             ├─3674 /usr/sbin/httpd -DFOREGROUND
             ├─3681 /usr/sbin/httpd -DFOREGROUND
             ├─3682 /usr/sbin/httpd -DFOREGROUND
             ├─3683 /usr/sbin/httpd -DFOREGROUND
             └─3684 /usr/sbin/httpd -DFOREGROUND

Oct 12 11:07:06 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:07:16 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:07:26 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:07:36 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:07:46 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:07:56 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:08:06 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:08:16 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:08:26 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
Oct 12 11:08:36 stapp01.stratos.xfusioncorp.com systemd[1]: httpd.service: Got notification message from PID 3674 (READY=1, STATUS=Total reques>
lines 1-25/25 (END)






:bulb:Explanation: Why systemctl status Blocks :stop_sign:

The reason your script appears to hang is that systemctl status uses a pager (like less or more) to display the service information.

When you run systemctl status httpd, the output fills the screen, and the shell is put into the interactive pager mode.

In this mode, the terminal shows the message “End” and waits for you to press q (quit) before returning control to the command prompt.

Impact on Jenkins
In an automated environment like Jenkins, the shell script is running non-interactively. The script executes the commands sequentially:

sudo systemctl restart httpd (Completes successfully).

sudo systemctl status httpd (Starts the pager and waits for the non-existent ‘q’ input).

The script hangs here because it’s waiting for interactive input, and the shell never receives the final exit code to proceed to the next server.

The output ending with (END) and not returning to the prompt—means the command is blocking the script’s execution.

:stop_sign: The Blocking Command Issue

The systemctl status command uses a utility called a pager (like less or more) to display its output interactively.

Pager Mode: When the output is longer than the screen size (or simply by default on some Linux distributions), systemctl status hands the output to the pager.

Interactive Wait: The pager pauses the script and waits for manual user input (typically the letter q to quit) before returning control to the shell prompt.

Automation Failure: Since the Jenkins job is running the script non-interactively over SSH, it never sends the required ‘q’ input. The script therefore hangs indefinitely on the first server’s build step, preventing the pipeline from moving on to the commands for stapp02 and stapp03.

:white_check_mark: The Fix: Use the --no-pager Flag

To resolve this issue, you must modify the command in all three of your “Execute shell script on remote host using SSH” steps to disable the interactive pager.

Change the command from:

sudo systemctl restart httpd
sudo systemctl status httpd







To include the --no-pager flag:

sudo systemctl restart httpd && sudo systemctl status httpd --no-pager

To prevent the script from blocking, you must tell systemctl not to use a pager by redirecting its output to a file or by using the --no-pager flag.

By adding --no-pager, the full status output is printed immediately to the console, the command exits with a status code, and the Jenkins build step successfully completes, allowing the job to move sequentially to the next server.

Following is the console output for the manage-services build.

Started by upstream project "nautilus-app-deployment
" build number 1

originally caused by:
 Started by user admin

Started by upstream project "nautilus-app-deployment
" build number 1

originally caused by:
 Started by user admin

Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/manage-services
[SSH] script:

sudo systemctl restart httpd && sudo systemctl status httpd --no-pager

[SSH] executing...
e[0;1;32m●e[0m httpd.service - The Apache HTTP Server
     Loaded: loaded (e]8;;file://stapp01.stratos.xfusioncorp.com/usr/lib/systemd/system/httpd.service /usr/lib/systemd/system/httpd.servicee]8;; ; e[0;1;38;5;185mdisablede[0m; preset: e[0;1;38;5;185mdisablede[0m)
     Active: e[0;1;32mactive (running)e[0m since Sun 2025-10-12 11:06:57 UTC; 75ms ago
       Docs: e]8;;man:httpd.service(8) man:httpd.service(8)e]8;; 
   Main PID: 3674 (httpd)
     Status: "Started, listening on: port 8080"
      Tasks: 177 (limit: 411140)
     Memory: 21.4M
     CGroup: /docker/4be4ba9570c23a7158da37ba7a2de461f423f267734da75b9ee69636ab632c4b/system.slice/httpd.service
             ├─e[0;38;5;245m3674 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3681 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3682 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3683 /usr/sbin/httpd -DFOREGROUNDe[0m
             └─e[0;38;5;245m3684 /usr/sbin/httpd -DFOREGROUNDe[0m

Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com httpd[3674]: AH00558: httpd: …ge
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com httpd[3674]: Server configure…80
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Ch…nge[0m
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Jo…nee[0m
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: Started The Apach…r.
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Fa…ere[0m
Oct 12 11:06:57 stapp01.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go…4)e[0m
Hint: Some lines were ellipsized, use -l to show in full.

[SSH] completed
[SSH] exit-status: 0

[SSH] script:

sudo systemctl restart httpd && sudo systemctl status httpd --no-pager

[SSH] executing...
e[0;1;32m●e[0m httpd.service - The Apache HTTP Server
     Loaded: loaded (e]8;;file://stapp02.stratos.xfusioncorp.com/usr/lib/systemd/system/httpd.service /usr/lib/systemd/system/httpd.servicee]8;; ; e[0;1;38;5;185mdisablede[0m; preset: e[0;1;38;5;185mdisablede[0m)
     Active: e[0;1;32mactive (running)e[0m since Sun 2025-10-12 11:06:59 UTC; 99ms ago
       Docs: e]8;;man:httpd.service(8) man:httpd.service(8)e]8;; 
   Main PID: 3681 (httpd)
     Status: "Started, listening on: port 8080"
      Tasks: 177 (limit: 411140)
     Memory: 20.7M
     CGroup: /docker/6482bc16b023b97bc7375a68a604acca0688152c6a9ebd3fcde6d21325e8c05c/system.slice/httpd.service
             ├─e[0;38;5;245m3681 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3688 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3689 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3690 /usr/sbin/httpd -DFOREGROUNDe[0m
             └─e[0;38;5;245m3691 /usr/sbin/httpd -DFOREGROUNDe[0m

Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com httpd[3681]: AH00558: httpd: …ge
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com httpd[3681]: Server configure…80
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Ch…nge[0m
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Jo…nee[0m
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: Started The Apach…r.
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Fa…ere[0m
Oct 12 11:06:59 stapp02.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go…1)e[0m
Hint: Some lines were ellipsized, use -l to show in full.

[SSH] completed
[SSH] exit-status: 0

[SSH] script:

sudo systemctl restart httpd && sudo systemctl status httpd --no-pager

[SSH] executing...
e[0;1;32m●e[0m httpd.service - The Apache HTTP Server
     Loaded: loaded (e]8;;file://stapp03.stratos.xfusioncorp.com/usr/lib/systemd/system/httpd.service /usr/lib/systemd/system/httpd.servicee]8;; ; e[0;1;38;5;185mdisablede[0m; preset: e[0;1;38;5;185mdisablede[0m)
     Active: e[0;1;32mactive (running)e[0m since Sun 2025-10-12 11:07:00 UTC; 78ms ago
       Docs: e]8;;man:httpd.service(8) man:httpd.service(8)e]8;; 
   Main PID: 3045 (httpd)
     Status: "Started, listening on: port 8080"
      Tasks: 177 (limit: 411140)
     Memory: 21.1M
     CGroup: /docker/00db1b63b1e48f3fcde8555ade0f8d434df42746dcb31c83cdf5f40f31dba214/system.slice/httpd.service
             ├─e[0;38;5;245m3045 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3052 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3053 /usr/sbin/httpd -DFOREGROUNDe[0m
             ├─e[0;38;5;245m3054 /usr/sbin/httpd -DFOREGROUNDe[0m
             └─e[0;38;5;245m3055 /usr/sbin/httpd -DFOREGROUNDe[0m

Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com httpd[3045]: AH00558: httpd: …ge
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com httpd[3045]: Server configure…80
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go….)e[0m
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Ch…nge[0m
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Jo…nee[0m
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: Started The Apach…r.
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Fa…ere[0m
Oct 12 11:07:00 stapp03.stratos.xfusioncorp.com systemd[1]: e[0;38;5;245mhttpd.service: Go…5)e[0m
Hint: Some lines were ellipsized, use -l to show in full.

[SSH] completed
[SSH] exit-status: 0

Finished: SUCCESS

okay thank you so much i will update this on the repo