LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2011, 12:29 PM   #1
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Rep: Reputation: 34
unable to stop services with chkconfig or sysv-rc-conf utility for ubuntu


hi all,
I have a ubuntu 10.10 system. My system is running cups, smb and ssh services and I want to stop them.

I could stop the services with the service command as under :-
Quote:
sudo service smb stop
sudo service cups stop
sudo service ssh stop
However, I needed to stop the services permanently. So that when the system reboots the services remain inactive.

So I tried out
Quote:
chkconfig --level 2345 smb off
I then did a check with
Quote:
chkconfig --list smb
and it reported smb as off against all the above run levels.
But problem is when I restart the machine or do a
Quote:
service smb status
it says samba is running !

Also nmap gives out the ports for samba to be open.

What am I doing wrong ? Can someone suggest the solution .
Thanks in advance
nishith
 
Old 08-11-2011, 12:57 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
https://help.ubuntu.com/community/BootServices
 
Old 08-11-2011, 01:27 PM   #3
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Original Poster
Rep: Reputation: 34
thanks for the response / link.

I will try out bum. Another thing is the link suggests using sysv-rc-conf utility for fine grained control. I am using the same, but I am unable to understand - why is the service started at all, when I have deactivated it in the sysv-rc-conf utility?

any more suggestions ?
regards
nishith
 
Old 08-11-2011, 02:49 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Did you deactivate it in all runlevels? Debian at least defaults to all runlevels 2-5 being the same, with the default runlevel set to 2. People coming from Red Hat are used to default multiuser gui being runlevel 5.
 
Old 08-11-2011, 06:22 PM   #5
culaterout
Member
 
Registered: Jul 2006
Location: colorado
Distribution: Debian, Arch Linux, Linux Mint, Ubuntu, Fedora, Suse, Mepis, Redhat, Sayabon, mandrake and android (
Posts: 192

Rep: Reputation: 29
NKD if you want this much control... I would suggest Slackware, Gentoo or my favorite Arch Linux...

They allow for more control over boot process.... Tried running Boot Chart and sysv-rc-conf.. I couldn't get the boot times below 23 seconds..... My Windows 7 machine boots in 21 seconds...

Ubuntu, Fedora, Suse etc... Have pre-installed software such as there own management systems and drivers that eat up load time.... With Slackware, Gentoo and Arch Linux you have to load in the specific

driver for the xconf editor to run xserver.. As well as Loading in extra Apps... Minimum would come with either gnome, kde or whatever windows manager you install...

With Arch Linux I can get 15 second boot times... Arch Linux is a lot harder to install, but they have excellent documentation for the install...

I really looking forward to installing Slackware in the near future...


Good Luck...

If your spending endless amounts of time trying play with sys-rc-conf... I would suggest Just trying one of the other distro's. But lots of advice from someone in the forums that can tell you the difference between Slackware and Arch Linux. They can maybe give you better insight into setup for Slackware...
 
Old 08-13-2011, 01:21 PM   #6
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Original Poster
Rep: Reputation: 34
Quote:
Did you deactivate it in all runlevels?
Yes I double checked that.
Quote:
They allow for more control over boot process.
My problem is not about trying to reduce the boot time, it is rather a Security issue. I wish to just stop the server from listening on these ports which are open on my system :-
Quote:
smb
cups
ssh
ssh
I have tried to disable the services in the runlevel 2-5 using the chkconfig command and I have double checked the runlevel and the services are configured to be off on all the runlevels, using the sysv-rc-conf command.

But when I restart the system, I find the services are still running. The following confirmed the same :-
Quote:
sudo service smb status
Quote:
sudo nmap -A 192.168.0.11
Quote:
sudo netstat -l
Both the commands confirmed the services are very much on. I am confused !

BTW when I stop the services with
Quote:
sudo service smb stop
the above commands all confirm the port has closed. The problem is the effect is temporary as on successive boots
the services will come up.

pls help me out
thanks
nishith
 
Old 08-13-2011, 02:01 PM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Because of Ubuntu is switching services to new "upstart method" from old "rc method", some of them are not configurable by "sysv-rc-conf" or "chkconfig" utilities. To disable that service, find its configuration in "/etc/init/*.conf" file and remove line (or comment with #) with "start" word at the begining. By the way, if you do not want to ever use this services you can just uninstall them.

Last edited by eSelix; 08-13-2011 at 02:09 PM.
 
1 members found this post helpful.
Old 08-18-2011, 04:12 AM   #8
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Original Poster
Rep: Reputation: 34
Hi eSelix,

Quote:
To disable that service, find its configuration in "/etc/init/*.conf" file and remove line (or comment with #) with "start" word at the begining.
Thanks a lot and I could stop all the services.
I felt it is a bit strange that the sysv-rc-conf and chkconfig are still being made available in the repos of the latest releases ! while the Sys V startup method is being discontinues withe the Upstart scheme of things !

thanks once again
nishith
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to stop oracle database services selvkaumarmvs Linux - Newbie 1 05-23-2009 03:25 AM
How Do I Disable A Service On Sysv-rc-conf? taurusx5 Linux - Software 0 09-20-2008 03:37 PM
How Do I Turn Off Services In sysv-rc-conf ? taurusx5 Linux - Software 1 09-02-2008 11:50 AM
Help with list of services using chkconfig command pxumsgdxpcvjm Linux - General 2 03-04-2006 05:09 PM
Debian-and tool like chkconfig and services banana2 Linux - Software 1 01-12-2003 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration