0
0
Raspberry Piprogramming~10 mins

Process management with supervisor in Raspberry Pi - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the Supervisor service on Raspberry Pi.

Raspberry Pi
sudo systemctl [1] supervisor
Drag options to blanks, or click blank then click option'
Astop
Brestart
Cstatus
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' instead of 'start' stops the service.
Using 'status' only shows the service state without starting it.
2fill in blank
medium

Complete the Supervisor configuration file to set the command to run a Python script.

Raspberry Pi
[program:myapp]
command=[1] /home/pi/myapp.py
autostart=true
autorestart=true
Drag options to blanks, or click blank then click option'
Abash
Bpython3
Csh
Dnode
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bash' or 'sh' runs shell scripts, not Python scripts.
Using 'node' is for JavaScript, not Python.
3fill in blank
hard

Fix the error in the Supervisor command to reload configuration.

Raspberry Pi
sudo supervisorctl [1]
Drag options to blanks, or click blank then click option'
Areload
Brestart
Cstart
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'restart' restarts all programs but does not reload config files.
Using 'start' or 'stop' affects program states, not config reload.
4fill in blank
hard

Fill both blanks to create a Supervisor program config that runs a script with auto restart on failure.

Raspberry Pi
[program:worker]
command=[1] /home/pi/worker.py
autorestart=[2]
Drag options to blanks, or click blank then click option'
Apython3
Bfalse
Ctrue
Dbash
Attempts:
3 left
💡 Hint
Common Mistakes
Setting autorestart to false disables automatic restart on failure.
Using 'bash' runs shell scripts, not Python scripts.
5fill in blank
hard

Fill all three blanks to define a Supervisor program that runs a Node.js app with autorestart and logs enabled.

Raspberry Pi
[program:webapp]
command=[1] /home/pi/app.js
autorestart=[2]
stdout_logfile=[3]
Drag options to blanks, or click blank then click option'
Anode
Btrue
C/var/log/webapp.log
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting autorestart to false disables automatic restart.
Not specifying a log file means no output is saved.