Topic 10 – Services and daemons Flashcards
this linux command will search the process list for the process named “galulator” and if there is a match will output its PID to the STDOUT
what is the outcome of typing the linux command
Pgrep “galculator”
this command will use the SIGKILL signal and the OS will terminate the process immediately
what is the outcome of typing the linux command
Kill -SIGKILL pid
or
Kill -9 pid
this will immediately stop the cron daemon
what is the outcome of typing the linux command
Sudo systemctl stop cron
what is the outcome of using the hotkey
Ctrl + z
in the linux terminal
this hotkey will suspend a process allowing it to be restarted at a later date
describe the process signal
SIGTERM
this will terminate a process and acts similarly to ending a process via the quit button provided
this can be caught or ignored by a process
while editing the crontable on exit this command will be added to the crontable and will run the command date >>/home/pi/date.log every 1 minute
while editing the cron table what is the outcome of adding this job
*/1 * * * * date >> /home/pi/date.log
this will display a list of processes/commands that are either running in the background or have been suspended
some deatils provided by the command are:
- Job number
- The jobs status such as running,suspended, terminated
- The command that executed the process

what is the outcome of typing the linux command
jobs
and what 3 details does it provide
this will disable the cron daemon on the next reboot
(does not immediately stop the deamon)
what is the outcome of typing the linux command
Sudo systemctl disable cron
this linux command will search the process list for the process named “galulator” and if there is a match will output its PID and process name to the STDOUT
what is the outcome of typing the linux command
Pgrep -l “galculator”
what is the outcome of typing the linux command
Kill -SIGKILL pid
or
Kill -9 pid
this command will use the SIGKILL signal and the OS will terminate the process immediately
this will execute the command in the background and hand back control of the terminal to the user
what is the outcome of typing the linux command
Command &
this linux command will kill all processes that have a match with the name given
what is the linux command
Killall “process name”
used for
this can be achieved by sending a signal to the process or to the OS via the terminal
if the signal is sent to the process then it will be given the chance to end cleanly: saving any data and closing any of its elements correctly
if the signal is sent to the OS then the operating system may just end the process giving it no chance to end cleanly. this may be necessary if the above will not work
how can “out of control” processes be terminated within linux
these include:
- SIGINT
- SIGQUIT
- SIGILL
- SIGKILL
- SIGTERM
- SIGSTP
- SIGCONT
name 7 portable operating system intercae (POSIX) signals that may be sent to the OS or a process in order to terminate or suspend the process
what is the outcome of typing the linux command
Kill pid
this will use the SIGTERM signal and allow the procss given a chance to end cleanly, it is similar to pressing the close button on a GUI application
while making an entry to the cron table what is the outcome of using
*
in any of the time fields
while editing the time fields in the cron table this will denote that any value of this time type is valid for the time execution
while making an entry to the cron table what is the outcome of using
*/value
in any of the time fields
whileediting the cron table:
using this within any of the time fields will denote that the job should be executed at the given interval for that time type
example
- every 1 minute
- every 5 minute
- every 5 day of week (every 5th day of the week)
- every 6 hours
- etc
what is the outcome of typing the linux command
jobs
and what 3 details does it provide
this will display a list of processes/commands that are either running in the background or have been suspended
some deatils provided by the command are:
- Job number
- The jobs status such as running,suspended, terminated
- The command that executed the process

while editing the cron table what is the outcome of adding this job
*/1 * * * * date >> /home/pi/date.log
while editing the crontable on exit this command will be added to the crontable and will run the command date >>/home/pi/date.log every 1 minute
this command is used to edit the current crontab
what is the outcome of typing the linux command
Crontab -e
while inside the terminal:
this command can be used to start jobs running in the background that are in the jobs list
note
while the process is running in the background the terminal is free to execute further commands
what is the outcome of typing the linux command
bg %number of process in jobs list
these processes will usually have its name ending in a d or will include the word daemon within the process name
within linux how can a
daemon be differentiated from a normal process
these could be but are not limited to:
- bluetooth
- DHCP
- task scheduler
name 3 types of background services
how can “out of control” processes be terminated within linux
this can be achieved by sending a signal to the process or to the OS via the terminal
if the signal is sent to the process then it will be given the chance to end cleanly: saving any data and closing any of its elements correctly
if the signal is sent to the OS then the operating system may just end the process giving it no chance to end cleanly. this may be necessary if the above will not work
what is the outcome of typing the linux command
Sudo systemctl stop cron
this will immediately stop the cron daemon
this will output the last few lines from the file located at ~/date.log
what is the outcome of typing the linux command
Tail ~/date.log
these are anything that is handled through the sytemd daemon and can perform a specific task
example units include:
- service
- device
- swap
in the context of systemd what are units and name 3 types
within the scope of systemd terminilogy
- what is a daemon
- what is a service
within the context of systemd
- a daemon is a type of service
- a service is a type of unit
what is the outcome of using the hotkey
Ctrl + c
in the linux terminal
this hotkey will terminate a process
name 3 types of background services
these could be but are not limited to:
- bluetooth
- DHCP
- task scheduler
whileediting the cron table:
using this within any of the time fields will denote that the job should be executed at the given interval for that time type
example
- every 1 minute
- every 5 minute
- every 5 day of week (every 5th day of the week)
- every 6 hours
- etc
while making an entry to the cron table what is the outcome of using
*/value
in any of the time fields
name 7 portable operating system intercae (POSIX) signals that may be sent to the OS or a process in order to terminate or suspend the process
these include:
- SIGINT
- SIGQUIT
- SIGILL
- SIGKILL
- SIGTERM
- SIGSTP
- SIGCONT
describe the process signal
SIGCONT
this will continue a process if it is stopped
this process signal may be used when the command
bg %number in jobs lists
or
fg %number in jobs lists
is used on a stopped process
what is the outcome of typing the linux command
Systemctl status cron
this will display the status of the cron daemon
what is the outcome of typing the linux command
Kill -l
this will display a list of signals provided by the os that may be used to terminate or pause a process
describe the process signal
SIGINT
this will terminate a process and is the same signal that is sued by the hotkey ctrl + c
this will enable the cron daemon on the next reboot
(does not immeditaely start the cron daemon)
what is the outcome of typing the linux command
Sudo systemctl enable cron
while inside the terminal:
this command can be used to bring jobs that are in the jobs list to the foreground
note
running new commands or processes is not possible until the current process has finished
what is the outcome of typing the linux command
Fg %number of process in jobs list
while editing the time fields in the cron table this will denote that any value of this time type is valid for the time execution
while making an entry to the cron table what is the outcome of using
*
in any of the time fields
what is the outcome of typing the linux command
Tail ~/date.log
this will output the last few lines from the file located at ~/date.log
what is a
service or daemon
these are background processes that provide services to the OS and the user
most will be started at boot time and will keep running for the lifetime of the OS unless explicitly stopped
this linux command known as system control can be used to control the systemmd as well as services
what is the linux command
systemctl
used for
this hotkey will terminate a process
what is the outcome of using the hotkey
Ctrl + c
in the linux terminal
describe the process signal
SIGKILL
this will terminate a process
this signal is sent only to the OS
it cannot be caught or ignored by a process
what is the outcome of typing the linux command
Command &
this will execute the command in the background and hand back control of the terminal to the user
this will display a list of signals provided by the os that may be used to terminate or pause a process
what is the outcome of typing the linux command
Kill -l
these are background processes that provide services to the OS and the user
most will be started at boot time and will keep running for the lifetime of the OS unless explicitly stopped
what is a
service or daemon
this itself is a daemon that is started by the kernel at boot time
it is responsible for handling what are known as units
one such unit is a service and a daemon is a type of service
what is
systemd
within linux
this will display all processes that are associated with the user, regardless of the terminal they were started in
what is the outcome of typing the linux command
ps -x
this will terminate a process
this signal is sent only to the OS
it cannot be caught or ignored by a process
describe the process signal
SIGKILL
this will stop or pause a process so that it can be continued later
this is also the process signal used by the hotkey ctrl + z
describe the process signal
SIGSTP
within the context of systemd
- a daemon is a type of service
- a service is a type of unit
within the scope of systemd terminilogy
- what is a daemon
- what is a service
what is the outcome of typing the linux command
Sudo systemctl enable cron
this will enable the cron daemon on the next reboot
(does not immeditaely start the cron daemon)
this will continue a process if it is stopped
this process signal may be used when the command
bg %number in jobs lists
or
fg %number in jobs lists
is used on a stopped process
describe the process signal
SIGCONT
this will output the last few lines of the file located at ~/date.log and continue to give output as the file grows
what is the outcome of typing the linux command
Tail -f ~/date.log
what is the linux command
pgrep
used for
this command can be used to search through the currently running processes by name and any matches will be sent to the STDOUT
this hotkey will suspend a process allowing it to be restarted at a later date
what is the outcome of using the hotkey
Ctrl + z
in the linux terminal
what is the outcome of typing the linux command
Pgrep -l “galculator”
this linux command will search the process list for the process named “galulator” and if there is a match will output its PID and process name to the STDOUT
this command will delay a process for a given amount of time
what is the outcome of typing the linux command
Sleep seconds
what is the outcome of typing the linux command
Fg %number of process in jobs list
while inside the terminal:
this command can be used to bring jobs that are in the jobs list to the foreground
note
running new commands or processes is not possible until the current process has finished
what is the linux command
tail
used for
this is a command that can output the last few lines of a file
what is the outcome of typing the linux command
Sleep seconds
this command will delay a process for a given amount of time
in the context of systemd what are units and name 3 types
these are anything that is handled through the sytemd daemon and can perform a specific task
example units include:
- service
- device
- swap
describe the process signal
SIGSTP
this will stop or pause a process so that it can be continued later
this is also the process signal used by the hotkey ctrl + z
this will use the SIGTERM signal and allow the procss given a chance to end cleanly, it is similar to pressing the close button on a GUI application
what is the outcome of typing the linux command
Kill pid
this will list all systemmd units that are of type service
what is the outcome of typing the linux command
Systemctl list-units –type=service
what is the outcome of typing the linux command
Sudo systemctl disable cron
this will disable the cron daemon on the next reboot
(does not immediately stop the deamon)
what is the outcome of typing the linux command
Crontab -e
this command is used to edit the current crontab
this will terminate a process and acts similarly to ending a process via the quit button provided
this can be caught or ignored by a process
describe the process signal
SIGTERM
this will terminate a process and is the same signal that is sued by the hotkey ctrl + c
describe the process signal
SIGINT
what is the outcome of typing the linux command
Tail -f ~/date.log
this will output the last few lines of the file located at ~/date.log and continue to give output as the file grows
the format to create this is as follows:
Minute - hour - day_of_month - month - day_of_week - command
- denotes a space
what is the format to create a new cronjob
this is a command that can output the last few lines of a file
what is the linux command
tail
used for
what is the outcome of typing the linux command
Systemctl list-units –type=service
this will list all systemmd units that are of type service
within linux how can a
daemon be differentiated from a normal process
these processes will usually have its name ending in a d or will include the word daemon within the process name
what is the linux command
systemctl
used for
this linux command known as system control can be used to control the systemmd as well as services
This is a daemon that is intended to be used directly by the end user and is found on all unix-like systems
This is used to create jobs that can be scheduled to run in the background at given time intervals
within linux what is the
cron daemon
what is the outcome of typing the linux command
ps -x
this will display all processes that are associated with the user, regardless of the terminal they were started in
within linux what is the
cron daemon
This is a daemon that is intended to be used directly by the end user and is found on all unix-like systems
This is used to create jobs that can be scheduled to run in the background at given time intervals
what is the format to create a new cronjob
the format to create this is as follows:
Minute - hour - day_of_month - month - day_of_week - command
- denotes a space
what is the outcome of typing the linux command
Sudo systemctl start cron
this will immediately start the cron daemon
what is the outcome of typing the linux command
Pgrep “galculator”
this linux command will search the process list for the process named “galulator” and if there is a match will output its PID to the STDOUT
this is a command that can be used to view all running processes in a tree like format
what is the outcome of typing the linux command
pstree
this will display the status of the cron daemon
what is the outcome of typing the linux command
Systemctl status cron
what is the outcome of typing the linux command
Kill %number of process in jobs list
this will terminate the given job number that is in the jobs list
what is the outcome of typing the linux command
pstree
this is a command that can be used to view all running processes in a tree like format
this will immediately start the cron daemon
what is the outcome of typing the linux command
Sudo systemctl start cron
this will terminate the given job number that is in the jobs list
what is the outcome of typing the linux command
Kill %number of process in jobs list
what is the outcome of typing the linux command
bg %number of process in jobs list
while inside the terminal:
this command can be used to start jobs running in the background that are in the jobs list
note
while the process is running in the background the terminal is free to execute further commands
what is the linux command
Killall “process name”
used for
this linux command will kill all processes that have a match with the name given
this command can be used to search through the currently running processes by name and any matches will be sent to the STDOUT
what is the linux command
pgrep
used for
what is
systemd
within linux
this itself is a daemon that is started by the kernel at boot time
it is responsible for handling what are known as units
one such unit is a service and a daemon is a type of service