Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm fairly sure this is a basic question, nevertheless I'm having some problems with solving this.

I'm trying to set up different startup profiles set specifically to different activities... like when I want to do web development and such, it would start the Apache server and other stuff, but when I'm not these services would be disabled - once I get the logic of it, I can tailor it, hope you get the picture as to what I'd like to do.

My first thought was that it would be selected in Grub, but if anyone has a different suggestion, don't hold it in. :)

Thanks, Din

share|improve this question
    
By "startup" do you mean "boot" or "login"? –  nutznboltz Dec 7 '11 at 22:29
    
Both, basically. I don't really care either way as long as it works :) I'm working on a netbook, which doesn't exactly fly from power ( :P ), so I don't want unnecessary services running... I want to set up some profiles, so when I test web design on localhost, I can have Apache, MySQL and the rest running, but when I play games, all those turned off so I can squeeze all the power out of this thing. I could do it manually, or I can even make a script for it, but if there would be an easier way... ;) –  dinchamion Dec 7 '11 at 23:06

2 Answers 2

I think the easiest way would be to create multiple accounts with activity as real name and then you link them together with symlinks and you can put a script in "Startup Application" to have the services started you want.

share|improve this answer

The cleaner way to do this would be to use runlevels.

Each runlevel starts a different set of services. While you could simply use a script at logon, you could create a specific runlevel for casual use, server use, etc.

The tool Ubuntu uses to configure what services start with each runlevel is called Upstart. A simple tool 'chkconfig', installable from the Ubuntu main repositories, will help you set those up.

sudo apt-get install chkconfig

Once you have configured each runlevel, you are going to have to start it. I think the cleanest way to do that would be from GRUB.

Create a different entry for each runlevel (copy & paste current kernel startup section to create a new entry), then find the line like: 'linux /boot/vmlinuz-2.6.38-14-generic root=UUID=1459c642-797c-4a9b-be5c-fdfad2a6689c ro quiet splash vt.handoff=7' and add the number of the runlevel you want to boot into at the end.

Example: linux /boot/vmlinuz-2.6.38-14-generic root=UUID=1459c642-797c-4a9b-be5 c-fdfad2a6689c ro quiet splash vt.handoff=7 3

To check the runlevel after boot:

who -r

Below are some links to start you off:

Basics of runlevels

Advanced: Auto-Config of GRUB - so you don't have to manually edit the GRUB file with each kernel release

Using Upstart and Chkconfig

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.