ค้นหาบล็อกนี้

2/05/2554

Learn how to control services

6.) Learn how to control services

The first thing to remember is that if you install a new service, say
a web server (Apache), then Ubuntu will automatically configure that
service to run when you reboot your machine and it will start the
service immediately!

This is quite different from the world of Red Hat, Fedora, CentOS,
etc. In order to configure and control services the core tool
available to you is update-rc.d. This tool, however, may not be the
easiest to use. Still, you should read and understand a bit about how
this works by doing:

$ man update-rc.d

There are a couple of additional tools available to you that you can
install. These are sysvconfig and rcconf. Both of these are
console-based gui tools. To install them do:

$ sudo apt-get install sysvconfig rcconf

Did you notice that we specified two packages at the same time? This
is a nice feature of apt-get. Try both these commands out. You'll
notice that the sysvconfig command is considerably more powerful.
Please don't make any changes to your services at this time.

$ sudo rcconf
$ sudo sysvconfig

Finally, there is a nice Bash script that has been written which
emulates the Red Hat chkconfig script. This is called rc-config. We
have placed this script on our "noc" box. Let's download the script
and install it for use on your machine:

$ cd
$ wget http://noc/workshop/scripts/rc-config
$ chmod 755 rc-config
$ sudo mv rc-config /usr/local/bin

At this point the script is installed. You should be able to just run
the script by typing:

$ rc-config

Try viewing all scripts and their status for all run-levels:

$ rc-config -l

Now trying viewing the status of just one script:

$ rc-config -ls anacron

You can see how this script works, if you understand enough of bash
scripts, by taking a look at it's code:

$ less /usr/local/bin/rc-config

--
*

ข้อสอบครูชำนาญการพิเศษ *
ข้อสอบครูผู้ช่วย,สอบบรรจุครูผู้ช่วย,แนวข้อสอบครูผู้ช่วย,สอบครูผู้ช่วย,แนวข้อสอบครูผู้ช่วย,ครูผู้ช่วย,ข้อสอบบรรจุครู,ข้อสอบครูชำนาญการพิเศษ
*http://www.oopps.bloggang.com*
*
* ฟิสิกส์ ข้อสอบฟิสิกส์ บทเรียนฟิสิกส์ ฟิสิกส์ออนไลน์
โจทย์ฟิสิกส์ แบบฝึกหัดวิชาฟิสิกส์ โจทย์วิชาฟิสิกส์ โจทย์วิชาฟิสิกส์
http://thaiphysics.blogspot.com


* บทเรียนบทรัก ความรัก บทความความรัก ดูดวงความรัก นิยามความรัก
กลอนรัก เพลงรักhttp://love8love9.blogspot.com


* ความรัก บทความความรัก ดูดวงความรัก นิยามความรัก กลอนรัก
เพลงรักhttp://kongkoymusic.blogspot.com

Install libc, gcc, g++ and make

Install libc, gcc, g++ and make

Two items missing from a default Debian/Ubuntu installation are gcc
and make plus their associated bits and pieces. This can be quite
disconcerting if you are used to compiling software under other
versions of Linux. Luckily there is an easy way to install all the
bits and pieces you need to use gcc and/or make. Simply do:

$ sudo apt-get install build-essential

and respond with a "Y" when asked if you "...want to continue". Once
the installation process finishes you should have both gcc and make
installed on your machine.

This is an example of installing software using a "meta-package." If
you type in the command:

$ sudo apt-cache showpkg build-essential

You will see a descriptive list of all the various pieces of software
that are installed for this package.


--
*

ข้อสอบครูชำนาญการพิเศษ *
ข้อสอบครูผู้ช่วย,สอบบรรจุครูผู้ช่วย,แนวข้อสอบครูผู้ช่วย,สอบครูผู้ช่วย,แนวข้อสอบครูผู้ช่วย,ครูผู้ช่วย,ข้อสอบบรรจุครู,ข้อสอบครูชำนาญการพิเศษ
*http://www.oopps.bloggang.com*
*
* ฟิสิกส์ ข้อสอบฟิสิกส์ บทเรียนฟิสิกส์ ฟิสิกส์ออนไลน์
โจทย์ฟิสิกส์ แบบฝึกหัดวิชาฟิสิกส์ โจทย์วิชาฟิสิกส์ โจทย์วิชาฟิสิกส์
http://thaiphysics.blogspot.com


* บทเรียนบทรัก ความรัก บทความความรัก ดูดวงความรัก นิยามความรัก
กลอนรัก เพลงรักhttp://love8love9.blogspot.com


* ความรัก บทความความรัก ดูดวงความรัก นิยามความรัก กลอนรัก
เพลงรักhttp://kongkoymusic.blogspot.com

Update /etc/apt/sources.list

When using apt, apt-get, aptitude and/or synaptic there is a master
file that tells Ubuntu where to look for software you wish to install.
This file is /etc/apt/sources.list. You can update this file to point
to different repositories (third party, local repositories, remove the
cdrom reference, etc...). In our case we are now going to do this.
We'll edit this file and we are going to edit out any reference to the
Ubuntu 7.10 cdrom, which is left from the initial install.

To edit the file /etc/apt/sources.list do:

$ sudo vi /etc/apt/sources.list

In this file we want to comment out any references to the Ubuntu
cd-rom. You'll see the following lines at the top of the file:

#
# deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386
(20071016)]/ gutsy main restricted

deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386
(20071016)]/ gutsy main restricted

Update this by simply commenting out the one line (see your vi
reference sheet for help):

#
# deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386
(20071016)]/ gutsy main restricted

# deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386
(20071016)]/ gutsy main restricted


Now the apt command (apt-get) won't attempt to read your cd-rom drive
each time you install software.

Change your sources list:

We won't be doing this, but take a closer look at the file
/etc/apt/sources.list. You should see multiple entries along the line
of "http://CC.archive.ubuntu.com/" where the "CC" is a country code.
If you installed and said that your location was Taiwan, then the
entry would read, "http://tw.archive.ubuntu.com/", and so forth.

If you make changes to this file, then you should remember to run:

$ sudo apt-get update

To make sure that all your local repository lists are up to date.

--
*

ข้อสอบครูชำนาญการพิเศษ *
ข้อสอบครูผู้ช่วย,สอบบรรจุครูผู้ช่วย,แนวข้อสอบครูผู้ช่วย,สอบครูผู้ช่วย,แนวข้อสอบครูผู้ช่วย,ครูผู้ช่วย,ข้อสอบบรรจุครู,ข้อสอบครูชำนาญการพิเศษ
*http://www.oopps.bloggang.com*
*
* ฟิสิกส์ ข้อสอบฟิสิกส์ บทเรียนฟิสิกส์ ฟิสิกส์ออนไลน์
โจทย์ฟิสิกส์ แบบฝึกหัดวิชาฟิสิกส์ โจทย์วิชาฟิสิกส์ โจทย์วิชาฟิสิกส์
http://thaiphysics.blogspot.com


* บทเรียนบทรัก ความรัก บทความความรัก ดูดวงความรัก นิยามความรัก
กลอนรัก เพลงรักhttp://love8love9.blogspot.com


* ความรัก บทความความรัก ดูดวงความรัก นิยามความรัก กลอนรัก
เพลงรักhttp://kongkoymusic.blogspot.com