Skip to content

Instantly share code, notes, and snippets.

@stark
Last active August 29, 2015 14:21
Show Gist options
  • Save stark/4f63327d318b1e189734 to your computer and use it in GitHub Desktop.
Save stark/4f63327d318b1e189734 to your computer and use it in GitHub Desktop.
LinuxBBQ Academy

Lesson 8 - Package Management II: Housekeeping

Actually, this could be the continuation of the previous lesson.

A real griller keeps his dependency count as low as possible.

And of course a real griller also checks the number of processes running on his system.

He or she enters:

pstree

And gets a nice representation of the running processes. Count the lines!

Good, but sometimes it happens that you grab yourself some shiny nice package.

For example, you want to print something quick and easy, and you install the lprng package.

Let's just do it:

ins lprng

Didn't hurt much. But maybe it hurts when you check your running processes again:

pstree

Count the lines again!

Did you notice anything? Yup, there is lpd, and it wasn't there before. "But I only installed it and didn't even start it!", that's absolutely right. You didn't start it, but the system automatically added lpd (a line printer daemon) to the processes.

A daemon is usually a process that is waiting for a request.

Even if this request never happens, the daemon sits there, farts into your sofa, eats your snacks and flirts with your wife.

And disgustingly, most daemons have a 'd' as last letter, like lpd. Or systemd ;)

The good thing is, you can disable a daemon temporarily or permanently, and restart it again when needed:

sudo service lprng stop

Kills the daemon, and guess what the following command does?

sudo service lprng start

Brings it back to life. By the way, lprng is the name of the package or the service, lpd the name of the daemon.

In doubt, use Tab-completion after typing sudo service to find what services are running.

To permanently disable a service, use the tool update-rc.d which has to be run as root. Or, of course, remove the package that has installed the daemon :)

Further reading:

Debian Administrator's Handbook, Chapter UNIX Services

http://ow.ly/NkPFN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment