Difference between revisions of "Maintaining a Computer Lab (LTSP)"

From CDOT Wiki
Jump to: navigation, search
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
There are a lot of suggestions to make when maintaining a Linux Lab. Feel free to use this page as a resource when maintaining your Linux Lab via LTSP.
+
[[Category:Ubuntu]][[Category:Linux]]
  
 
= About Computer Lab Maintainance =
 
= About Computer Lab Maintainance =
Line 12: Line 12:
 
* Perform computer hardware upgrades
 
* Perform computer hardware upgrades
 
* Install applications
 
* Install applications
* Upgrade Linux OS, Upgrade applications
+
* Upgrade Linux OS / Upgrade applications
 
* Create / Remove / Suspend Linux computer accounts
 
* Create / Remove / Suspend Linux computer accounts
 
* Create / Enforce Acceptable Use Policy of Computer Lab
 
* Create / Enforce Acceptable Use Policy of Computer Lab
Line 19: Line 19:
  
  
As the saying goes "'''necessity is the mother of invention'''", and when you set up a system to support, '''users will ask you questions which will encourage you to automate or fix problems, instead of you having to think of what to automate by yourself.''' There is simply no better experience (other than working for a company in IT)...
+
As the saying goes "'''necessity is the mother of invention'''". When you set up a Linux computer lab, you may be required to provide (or train users) support for that system. One advantage of providing (volunteering) support is that '''users will ask you questions which will encourage you to automate or fix problems, instead of you having to think ahead of what tasks to automate.''' There is simply no better experience (other than working in IT for a company)...
 
 
 
 
 
 
= Ubuntu LTSP Documentation (General Reference) =
 
 
 
 
 
Here is a link to Edubuntu's Documentation of the LTSP server:
 
[http://doc.ubuntu.com/edubuntu/edubuntu/handbook/C/server.html http://doc.ubuntu.com/edubuntu/edubuntu/handbook/C/server.html]
 
  
  
 
= Automating Routine Tasks =
 
= Automating Routine Tasks =
  
As a Linux system (LTSP computer lab) administrator, Your jobs is to "look after" the smooth operation of the computer lab. This will require you to either use graphical applications (programs) to administer the computer lab, or open a command prompt (called a "shell" in Linux terminology) to issue Linux operating system commands.
+
As a Linux system (LTSP computer lab) administrator, Your job is to "look after" the smooth operation of the computer lab. This will require you to either use graphical applications (programs) to administer the computer lab, or open a command prompt (called a "shell" in Linux terminology) to issue Linux operating system commands.
  
  
Line 41: Line 33:
  
  
A wise old-timer (referred to as a "grey-beard") once mentioned a saying, "'''With Linux, learn it once, know it always'''". What is really means is if you take the time to learn how to do everything in Linux by issuing commands and understanding its files and structure, you can perform all of the tasks with or without graphical administration programs. Therefore, people that were working on UNIX systems in the 70's can still operate new Linux systems (and not have to pay $10.000 every 4 years to maintain their designation, or learn new graphical administration tools)...
+
A wise Unix/Linux user once mentioned, "'''With Linux, learn it once, know it always'''". In other words, if you take the time to learn Linux commands and understand the system/setup files, you can perform all of the tasks <u>with</u> or <u>without</u> graphical administration programs. People that were working on UNIX systems in the 70's can still work on Linux systems (and not have to pay $10.000 every 4 years to maintain their designation, or learn new graphical administration tools)... cool!
  
  
Knowing which type of programming language to use when automating a task is based upon a programmers experience of knowing which is the "'''best tool for the task'''". Should the program is compiled (like C, C++, etc) for efficient operation (if a lot of people run same program within a compressed period of time), or should program be interpreted (eg. Shell Script, Perl Script, JavaScript) for ease of programming? Many factors are involved here, but shell scripting is definately an easy way for the adminstrator to automate rountine tasks... I will only be discussing Shell Scripting in the WIKI, although, you can access by webpage to learn other programming languages (like C - Course: IPC144)...
+
Knowing which type of programming language to use when automating a task is based upon a programmers knowledge base and experience. In other word, knowing which is the "'''best tool for the task'''". Should the program be '''compiled''' (like C, C++, etc) for efficient operation? Should program be '''interpreted''' (eg. Shell Script, Perl Script, JavaScript) for ease of programming? Many factors are involved here, but '''shell scripting is definitely an easy way for the administrator to automate routine tasks'''... I will only be discussing Shell Scripting in the WIKI, although, you can access by webpage to learn other programming languages (like C - Course: IPC144)...
 +
 
 +
 
 +
Many of the shell scripts on the Internet are "open-source" so instead of trying to "re-invent the wheel", you may be able to download, use, and/or modify the contents to meet your own needs...
  
  
Line 50: Line 45:
  
 
There are many resources in the Internet on learning Linux commands and shell scripting.
 
There are many resources in the Internet on learning Linux commands and shell scripting.
 +
 +
 
Here is a link to an old (defunct) scripting course I taught: [https://cs.senecac.on.ca/~murray.saul/SPR720/notes.html https://cs.senecac.on.ca/~murray.saul/SPR720/notes.html]
 
Here is a link to an old (defunct) scripting course I taught: [https://cs.senecac.on.ca/~murray.saul/SPR720/notes.html https://cs.senecac.on.ca/~murray.saul/SPR720/notes.html]
  
Line 55: Line 52:
  
 
= Sample Shell Scripts =
 
= Sample Shell Scripts =
 +
 +
 +
These sample shell scripts will grow over time... Note that some of the shell scripts using the "'''zenity'''" Linux command (utility) to provide graphical input/output boxes that can be used when you run shell scripts... Therefore, shell scripting isn't as "old-fashioned" as you would suspect...
 +
 +
Note: In order to execute, these files need to have execute permissions. You can issue the Linux command '''chmod 755 filename''' to provide execute permissions.
 +
 +
 +
[ [[acceptableUsePolicy.bash]] ]        - Requires user "clicks OK" to abide by computer lab policy - otherwise, system will automatically log-out in 20 seconds...
  
  
Line 60: Line 65:
 
= Scheduling Routine Tasks (cron)=
 
= Scheduling Routine Tasks (cron)=
  
To be completed...
+
 
 +
I once volunteered to set-up and provide administration support an LTSP computer lab at high-school located in Toronto, Ontario.
 +
While the school year was in process, I would visit once a week to check on the status of the computer lab. Sometimes, I would have to replace stolen mice, reconnect Ethernet cables. etc...
 +
 
 +
 
 +
One day, the high-school teacher informed me that the computer system was running slower than normal. I asked the teacher when was the last time that the system has been rebooted. The teacher indicated that the system had been up for at least 5 weeks. It is important to note that a server should be rebooted on a periodic basis, since the computer system's performance may be affected by "'''zombie processes'''" (programs that were completed, but still running as a process) , or "'''memory leaks'''" (unallocated memory due to programming errors). I recommended that the teacher reboot the server once or twice a week... that solved the problem...
 +
 
 +
 
 +
By the way, I suspect the cause of the problem was that students were powering-off their terminals (thin clients) instead of properly logging out their accounts...
 +
 
 +
 
 +
Problems such as these may occur from time-to-time, and a Linux administrator will be called upon to provide a solution. Let's take the previous problem and add an additional element. Let's assume that the high-school is used throughout the day and night (i.e. night-school). Let's assume that the only time that the system can be rebooted is between midnight and 7 am. Obviously, the high-school teacher (nor myself) want to say up twice a week after midnight to reboot the system. Therefore, it would make sense to have this shell script (run as the "administrator") automatically for a specificied date and time...
 +
 
 +
 
 +
... thus we would use '''cron'''. The cron command or utility stands for "'''Chronograph'''" and is a '''time-based scheduler for programs''' (like shell scripts).
 +
 
 +
 
 +
Here is a link to a resource on how to use cron:  [http://www.thewebhostinghero.com/tutorials/linux-cron.html http://www.thewebhostinghero.com/tutorials/linux-cron.html]
  
  
 
= Additional Resources =
 
= Additional Resources =
  
To be completed ...
+
 
 +
Here is a link to Edubuntu's Documentation of the LTSP server:
 +
[http://doc.ubuntu.com/edubuntu/edubuntu/handbook/C/server.html http://doc.ubuntu.com/edubuntu/edubuntu/handbook/C/server.html]

Latest revision as of 19:23, 31 March 2010


About Computer Lab Maintainance

I often tell my students, "If you really want to learn about Linux system administration, create a Linux computer lab (via LTSP), and volunteer to provide support for that lab" ...


Linux system administration can be a number of task which may include:

  • Checking / maintaining smooth operation of the server / workstations (run benchmarks)
  • Replace defective server / workstation hardware
  • Perform computer hardware upgrades
  • Install applications
  • Upgrade Linux OS / Upgrade applications
  • Create / Remove / Suspend Linux computer accounts
  • Create / Enforce Acceptable Use Policy of Computer Lab
  • Maintain security (from within / outside) the computer lab
  • Write programs (including shell scripts) to automate routine tasks


As the saying goes "necessity is the mother of invention". When you set up a Linux computer lab, you may be required to provide (or train users) support for that system. One advantage of providing (volunteering) support is that users will ask you questions which will encourage you to automate or fix problems, instead of you having to think ahead of what tasks to automate. There is simply no better experience (other than working in IT for a company)...


Automating Routine Tasks

As a Linux system (LTSP computer lab) administrator, Your job is to "look after" the smooth operation of the computer lab. This will require you to either use graphical applications (programs) to administer the computer lab, or open a command prompt (called a "shell" in Linux terminology) to issue Linux operating system commands.


What ?!? Issue old fashioned Linux commands? Yuk!


Well hold on here a minute... I didn't say you always had to issue Linux commands, there are a lot of graphical programs that act as graphical "frontends" to achieve the same result from issuing Linux commands. But sometimes it is nice to know you can resort to Linux commands if a graphical administration tool is not available. Also, Linux commands can be placed into a file to run (like MS Windows "batch" files) to automate routine tasks. This allow you to create you own "customized" programs!


A wise Unix/Linux user once mentioned, "With Linux, learn it once, know it always". In other words, if you take the time to learn Linux commands and understand the system/setup files, you can perform all of the tasks with or without graphical administration programs. People that were working on UNIX systems in the 70's can still work on Linux systems (and not have to pay $10.000 every 4 years to maintain their designation, or learn new graphical administration tools)... cool!


Knowing which type of programming language to use when automating a task is based upon a programmers knowledge base and experience. In other word, knowing which is the "best tool for the task". Should the program be compiled (like C, C++, etc) for efficient operation? Should program be interpreted (eg. Shell Script, Perl Script, JavaScript) for ease of programming? Many factors are involved here, but shell scripting is definitely an easy way for the administrator to automate routine tasks... I will only be discussing Shell Scripting in the WIKI, although, you can access by webpage to learn other programming languages (like C - Course: IPC144)...


Many of the shell scripts on the Internet are "open-source" so instead of trying to "re-invent the wheel", you may be able to download, use, and/or modify the contents to meet your own needs...


Learn How to Use Linux

There are many resources in the Internet on learning Linux commands and shell scripting.


Here is a link to an old (defunct) scripting course I taught: https://cs.senecac.on.ca/~murray.saul/SPR720/notes.html


Sample Shell Scripts

These sample shell scripts will grow over time... Note that some of the shell scripts using the "zenity" Linux command (utility) to provide graphical input/output boxes that can be used when you run shell scripts... Therefore, shell scripting isn't as "old-fashioned" as you would suspect...

Note: In order to execute, these files need to have execute permissions. You can issue the Linux command chmod 755 filename to provide execute permissions.


[ acceptableUsePolicy.bash ] - Requires user "clicks OK" to abide by computer lab policy - otherwise, system will automatically log-out in 20 seconds...


Scheduling Routine Tasks (cron)

I once volunteered to set-up and provide administration support an LTSP computer lab at high-school located in Toronto, Ontario. While the school year was in process, I would visit once a week to check on the status of the computer lab. Sometimes, I would have to replace stolen mice, reconnect Ethernet cables. etc...


One day, the high-school teacher informed me that the computer system was running slower than normal. I asked the teacher when was the last time that the system has been rebooted. The teacher indicated that the system had been up for at least 5 weeks. It is important to note that a server should be rebooted on a periodic basis, since the computer system's performance may be affected by "zombie processes" (programs that were completed, but still running as a process) , or "memory leaks" (unallocated memory due to programming errors). I recommended that the teacher reboot the server once or twice a week... that solved the problem...


By the way, I suspect the cause of the problem was that students were powering-off their terminals (thin clients) instead of properly logging out their accounts...


Problems such as these may occur from time-to-time, and a Linux administrator will be called upon to provide a solution. Let's take the previous problem and add an additional element. Let's assume that the high-school is used throughout the day and night (i.e. night-school). Let's assume that the only time that the system can be rebooted is between midnight and 7 am. Obviously, the high-school teacher (nor myself) want to say up twice a week after midnight to reboot the system. Therefore, it would make sense to have this shell script (run as the "administrator") automatically for a specificied date and time...


... thus we would use cron. The cron command or utility stands for "Chronograph" and is a time-based scheduler for programs (like shell scripts).


Here is a link to a resource on how to use cron: http://www.thewebhostinghero.com/tutorials/linux-cron.html


Additional Resources

Here is a link to Edubuntu's Documentation of the LTSP server: http://doc.ubuntu.com/edubuntu/edubuntu/handbook/C/server.html