COMP 3000 2012 Midterm Material: Difference between revisions
added questions from lab 1 |
added questions from lab 2 |
||
Line 20: | Line 20: | ||
# With the <tt>&</tt> you can put processes in the "background". Given that external commands are always run as separate processes from the command shell, what is the key difference between foreground and background processes? | # With the <tt>&</tt> you can put processes in the "background". Given that external commands are always run as separate processes from the command shell, what is the key difference between foreground and background processes? | ||
# What are the differences between shell and environment variables? Specifically, what processes have each of them, and to what extent are they shared? HINT: look at the <tt>execve</tt> system call. | # What are the differences between shell and environment variables? Specifically, what processes have each of them, and to what extent are they shared? HINT: look at the <tt>execve</tt> system call. | ||
Questions from Lab 2 | |||
# How can you get a list of all of the processes running on the system from the command line? Please give the command and required arguments, if any. | |||
# What are five processes that are running on your system as non-regular users (i.e., as users other than the one you logged in as)? What does each do, briefly? Note: please exclude all processes enclosed in [], as those are built in to the kernel. | |||
# How can I restart the graphical login screen on Ubuntu? (Hint: use virtual terminals and Ctrl-Alt-F? combinations to access a terminal that is independent of the GUI. Also, make sure you are aren't logged into a graphical session when you try this!) | |||
# What happens when you send a kill -9 signal to one of the <tt>getty</tt> processes that are running by default? Why? | |||
# What starts the upstart daemon? When is it started? | |||
# How would you "change the system runlevel" to reboot? Shut down? | |||
# Look at the output of <tt>ls -l /etc/init.d/</tt>. You will note <tt>-></tt> for many of the entries. This arrow shows that those entries are symbolic links. Where do most of these symbolic links point to? Why? | |||
# Install the <tt>openssh-server</tt> package in your virtual machine from the command line. What command(s) did you use? | |||
# Note that <tt>sshd</tt> has separate entries in <tt>/etc/init</tt> and <tt>/etc/init.d</tt> differ. Why do both exist (when most services have either one or the other)? | |||
# Log messages for the system are stored in <tt>/var/log</tt>. What are four log files that are present on your system? (Ignore the ones with numeric extensions, those are old versions.) What program wrote each of those files directly? | |||
# In <tt>/etc/init.d/ssh</tt> there are two lines near the beginning that end with <tt>output || exit 0</tt> (should be lines 16 and 17). What do each of these lines do exactly? And what is there purpose? | |||
# What are the equivalent lines, if any, to these <tt>|| exit 0</tt> lines in <tt>/etc/init/ssh</tt>? | |||
# What is plymouth? | |||
# '''BONUS: ''' Trace plymouth's behavior throughout the boot process. |
Revision as of 21:49, 22 October 2012
Questions from Lab 1
- What is your username on this wiki? Have a TA help you create an account.
- What Linux distribution are you using? What version? You should look at the file /etc/issue generally to find out.
- What shell do you get by default when you log in? Check by running echo $SHELL. If it is not bash, then type exec bash to switch to it.
- Is your Linux environment running virtualized or on bare metal? How do you know? (If you aren't sure, say so, but explain why.)
- Who installed and configured your Linux environment? What level of access do you have to it?
- A shell command can be one of four things. What are those four things? Explain very briefly.
- On the machine you are on, in what directories are commands external to the shell stored? How can you get this information on the command line?
- Compare the commands ls /usr/bin | more and ls /usr/bin | less. How is the output similar? How are they different?
- How would you create an empty file with the filename empty file.txt? (Yes, that is a space in the filename.)
- How would you output the contents of this file?
- Some shell commands, such as pwd, are both built-in and are external. What is one reason why both versions might be present?
- What are the permissions on your Linux home directory? With those permissions and your knowledge of the other accounts on the system, who has access to your home directory, and what sort of access do they have?
- Give one or more command line strings that use the following operators: >, <, >>, <<, |. Explain briefly what each operator is doing in your examples, both concretely and in terms of STDIN and STDOUT.
- Are there operators that work specifically with STDERR? Explain briefly.
- How do you use these operators with other file descriptors? Explain briefly.
- Give an example of a bash for loop and explain what it does.
- Give an example of a bash if statement and explain what it does.
- With the & you can put processes in the "background". Given that external commands are always run as separate processes from the command shell, what is the key difference between foreground and background processes?
- What are the differences between shell and environment variables? Specifically, what processes have each of them, and to what extent are they shared? HINT: look at the execve system call.
Questions from Lab 2
- How can you get a list of all of the processes running on the system from the command line? Please give the command and required arguments, if any.
- What are five processes that are running on your system as non-regular users (i.e., as users other than the one you logged in as)? What does each do, briefly? Note: please exclude all processes enclosed in [], as those are built in to the kernel.
- How can I restart the graphical login screen on Ubuntu? (Hint: use virtual terminals and Ctrl-Alt-F? combinations to access a terminal that is independent of the GUI. Also, make sure you are aren't logged into a graphical session when you try this!)
- What happens when you send a kill -9 signal to one of the getty processes that are running by default? Why?
- What starts the upstart daemon? When is it started?
- How would you "change the system runlevel" to reboot? Shut down?
- Look at the output of ls -l /etc/init.d/. You will note -> for many of the entries. This arrow shows that those entries are symbolic links. Where do most of these symbolic links point to? Why?
- Install the openssh-server package in your virtual machine from the command line. What command(s) did you use?
- Note that sshd has separate entries in /etc/init and /etc/init.d differ. Why do both exist (when most services have either one or the other)?
- Log messages for the system are stored in /var/log. What are four log files that are present on your system? (Ignore the ones with numeric extensions, those are old versions.) What program wrote each of those files directly?
- In /etc/init.d/ssh there are two lines near the beginning that end with output || exit 0 (should be lines 16 and 17). What do each of these lines do exactly? And what is there purpose?
- What are the equivalent lines, if any, to these || exit 0 lines in /etc/init/ssh?
- What is plymouth?
- BONUS: Trace plymouth's behavior throughout the boot process.