PDA

View Full Version : [ubuntu] [SOLVED] Starting,stopping and checking services in ubuntu



remy06
October 22nd, 2008, 06:49 PM
Hi all,

Need some tips on the following:

1)how to actually start a service or script at boot time?

2)how to stop a service and how to ensure it does not start again at boot time?

3)how to check for current running service or to see if a service is currently running?

I wish to learn this via the command line.I have read that redhat has something like chkconfig that allows user to configure services to start/stop at different runlevels etc.Does ubuntu have something like this?

Pls advice.Thanks!

billgoldberg
October 22nd, 2008, 07:03 PM
1)how to actually start a service or script at boot time?

System -> preferences -> sessions

2)how to stop a service and how to ensure it does not start again at boot time?

I use "killall servicename".

Remove the service from "sessions".

3)how to check for current running service or to see if a service is currently running?

Use the "top" command.

Or "system -> preferences -> system monitor".

Nxion
October 22nd, 2008, 07:06 PM
Here is something I found very useful. Hope it helps.

https://help.ubuntu.com/community/BootServices (https://help.ubuntu.com/community/BootServices)

Sarmacid
October 22nd, 2008, 07:35 PM
To start/stop/check for services, you can do this


/etc/init.d/servicename start
/etc/init.d/servicename stop
/etc/init.d/servicename status

Also to check if a service is running, you can run


pgrep -l servicename

kostkon
October 22nd, 2008, 07:45 PM
If you mean system services, then System -> Administration -> Services. If you mean apps/processes that start when your session starts (i.e. when you login) then System -> Preferences -> Sessions.

For what is currently running: System -> Administration -> System Monitor.

oldos2er
October 22nd, 2008, 08:19 PM
I have read that redhat has something like chkconfig that allows user to configure services to start/stop at different runlevels etc.Does ubuntu have something like this?


sysv-rc-conf

Nxion
October 22nd, 2008, 09:18 PM
Check this one out too.

http://www.cyberciti.biz/tips/how-to-controlling-access-to-linux-services.html (http://www.cyberciti.biz/tips/how-to-controlling-access-to-linux-services.html)

remy06
October 23rd, 2008, 02:54 AM
hi all,

Thanks again!Will study the tips provided and ask again if im unsure.

Nxion,

The links are helpful too.

:)