Author Archives: cviorel - Page 12

Prevent X.Org from Starting in Ubuntu

Prevent X.Org from Starting in Ubuntu

If you’ve got an Ubuntu machine that you initially installed with Ubuntu Desktop, but would like to run as a server, you can just disable the graphical
environment from starting up in order to save resources. This is also useful for doing system maintenance from the command line that needs to be performed
outside of the GUI.

The only reason to do this instead of removing the packages would be because you might want to still sometimes use the box through the GUI.

Disable X.Org

In order to disable the graphical environment, we’ll need to disable GDM, the Gnome Display Manager. In order to do this, you’ll need to run the following
command at the terminal:

sudo update-rc.d -f gdm remove

When you restart your computer, you’ll be presented with a text-mode login prompt instead of the graphical environment.

Run X.Org While Disabled

If you want to run the graphical environment, all you have to do is type the following command from the prompt, making sure to run it as your normal user
account.

startx

The annoying gray screen will go away once Gnome is fully started.

Enable X.Org

If you want to re-enable X11 it’s a simple matter of running this command from the terminal:

sudo update-rc.d -f gdm defaults

When you restart, you’ll be presented with the graphical prompt again.

Enable cupsys Web Admin Interface

Enabling cupsys Web Admin Interface

If you are trying to get your printing system going, and search for tips and docs on the web, you will find most of the documentation referring to http://localhost:631 as your cupsys administration interface. However, on Ubuntu, this browser-based administrative interface for cupsys is disabled by
default. Here’s how to enable it:
Select “System”->”Administration”->”Users and Groups” from the main menu on your desktop.
Select “Show all users” and/or “Show all groups”.
Add the user “cupsys” to the group “shadow” in the “groups” tab.

Restart cupsys by issuing the command:
sudo /etc/init.d/cupsys restart
IMPORTANT: I don’t know why the web admin interface was disabled in the first place – so please know that it is best to reverse all that you did once by
removing the user cupsys from the shadow group, and restarting cupsys, once your work with the interface is done.

If you want, from command line only:

sudo adduser cupsys shadow
sudo passwd cupsys
sudo /etc/init.d/cupsys restart

Adding a startup script to be run at bootup

So you have a script of your own that you want to run at bootup, each time
you boot up. This will tell you how to do that.
Write a script. put it in the /etc/init.d/ directory.
Lets say you called it FOO. You then run

You also have to make the file you created, FOO, executable, using

You can check out man update-rc.d for more information. It is a Debian
utility to install scripts. The option defaults puts a link to start FOO in
run levels 2, 3, 4 and 5. (and puts a link to stop FOO into 0, 1 and 6.)

Also, to know which runlevel you are in, use the runlevel command.

If you want to remove the script, just run: