LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to stop services with chkconfig or sysv-rc-conf utility for ubuntu (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-stop-services-with-chkconfig-or-sysv-rc-conf-utility-for-ubuntu-896806/)

nkd 08-11-2011 12:29 PM

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

pljvaldez 08-11-2011 12:57 PM

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

nkd 08-11-2011 01:27 PM

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

pljvaldez 08-11-2011 02:49 PM

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.

culaterout 08-11-2011 06:22 PM

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...

nkd 08-13-2011 01:21 PM

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

eSelix 08-13-2011 02:01 PM

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.

nkd 08-18-2011 04:12 AM

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


All times are GMT -5. The time now is 02:43 PM.