Am running Ubuntu8.10 Desktop.. as a server. When I logoff the machine all the services eg apache, ssh etc.... stop.
Is there a way to make these services run all the time?
I think what is happening is, that NetworkManager connects his net connection only when he logs in.
You should try:
Right Click Networkmanager icon -> Edit Connections -> Select connection from Wired or Wireless tab as appropriate and Click Edit.
Make sure "Connect Automatically" is selected.
Normally, those services would run in the background, starting before the first login, and continuing after the user logs out. Ubuntu Desktop is really Ubuntu Server plus X and Gnome :)
How are you starting the services?
The best thing to do is to make sure you're starting the services via init scripts. See for example:
Which runlevel is your machine running at?
In /etc/inittab, look for the line
where x is your default runlevel.
It could be that you're running at runlevel 1. At that runlevel, your daemons are not configured to run automatically.
Set your default runlevel to one of the multi-user runlevels (2-5 on my Debian machine). On my machine, runlevel 2 causes the daemons (apache, sshd and others) to be started automatically by the system.
You don't want to start that type of stuff as a user, so I recommend that you follow the other advice in this question.
But if you want to do a little test, before you do a permanent solution you could use the disown command.
To quickly get what disown does you could try this:
And then do the same
Unless you are starting the daemons as a user and the daemons attach them self to the users standard out/in, they should be running in the background not being bothered who is logged in or not. So what did you actually do that doesn't make the daemons run in background?
Check out the "screen" command. Screen will continue running after you log off.
Here's an example:
"screen -S [session name]" - A session name is useful if you use screen more than once.
Execute whatever command/program you want to keep running.
Press CTRL-A then CTRL-D (to detach)
Log out (or whatever) and you can come back later and execute "screen -ls". You should see your previous session(s) listed.
"screen -r [session name]" will resume that session.
Hope this helps.
Another way to do it might be to create a new user:
Adminisration --> Users and Groups --> Add User
Create your new user then run whatever program(s) you wish as that user instead of yourself. Some folks also like to give that use less privileges which potentially increases your security.
Also look into runlevels.
That should be taken care of by runlevels. Do you have a simlink /etc/rc5.d/sapache that links to /etc/init.d/apache2?
You may not have a
/etc/inittab file, since Ubuntu uses Upstart and doesn't create one by default.
You can check your runlevel using the
runlevel command. The last character it prints should be "2" or higher. You can create the
/etc/inittab file if it doesn't exist. The line controlling the default runlevel should be as indicated in Convicts answer.
If you installed your services using a Ubuntu package manager (apt-get, Synaptic, etc.) the proper startup scripts should have been installed. See the answer by mibus for additional information.
I believe Bash was correct.
However if you want to make your computer sign into the network before you even log in (at startup), also check "System Setting" (Intrepid) or "Available to all users" (Jaunty). This will allow ANY user to connect to the connection, including the system when it starts up.