FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-09-2011, 03:04 PM
Dan
 
Default Disable a service

Hi,
I would like to know which is the standard way to disable services. I
thought that the standard way is just to delete the link of the
service from rc*.d

For example to disable bluetooth I would just delete the link
/etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth

But then I used service manager from gnome to disable bluetooth. It
disabled the service but it didn't delete the link. So I guess that
there is a standard procedure to disable the service without deleting
the link. Which is that procedure?

Thanks,
Dan


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTi=8PHwgtS-DdaLMv=WYY8YOQ9mZtg@mail.gmail.com">http://lists.debian.org/BANLkTi=8PHwgtS-DdaLMv=WYY8YOQ9mZtg@mail.gmail.com
 
Old 04-09-2011, 03:50 PM
Michael Thompson
 
Default Disable a service

On 9 April 2011 16:04, Dan <ganchya@gmail.com> wrote:
> Hi,
> I would like to know which is the standard way to disable services. I
> thought that the standard way is just to delete the link of the
> service from rc*.d
>
> For example to disable bluetooth I would just delete the link
> /etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth
>
> But then I used service manager from gnome to disable bluetooth. It
> disabled the service but it didn't delete the link. So I guess that
> there is a standard procedure to disable the service without deleting
> the link. Which is that procedure?
>
> Thanks,
> Dan
Debian Linux has its own script to enable and disable services across
runlevels. It is called update-rc.d. Going by the above example, you
can enable apache webserver as follows:

# update-rc.d apache2 defaults

... this will enable the apache webserver to start in the default run
levels of 2,3,4 and 5. Of course, you can do it explicitly by giving
the run levels instead of the "defaults" keyword as follows:

# update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .

The above command modifies the sym-links in the respective /etc/rcX.d
directories to start or stop the service in the destined runlevels.
Here X stands for a value of 0 to 6 depending on the runlevel. One
thing to note here is the dot (.) which is used to terminate the set
which is important. Also 20 and 80 are the sequence codes which
decides in what order of precedence the scripts in the /etc/init.d/
directory should be started or stopped.

And to disable the service in all the run levels, you execute the command:

# update-rc.d -f apache2 remove

Here -f option which stands for force is mandatory.

But if you want to enable the service only in runlevel 5, you do this instead:

# update-rc.d apache2 start 20 5 . stop 80 0 1 2 3 4 6 .

--
Michael
http://photography.thompsonm.me.uk

To see a World in a Grain of Sand
And a Heaven in a Wild Flower,
Hold Infinity in the palm of your hand
And Eternity in an hour.
--William Blake


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTi=nGYYFYUg68NS7Y8EthhRWo6r0-g@mail.gmail.com">http://lists.debian.org/BANLkTi=nGYYFYUg68NS7Y8EthhRWo6r0-g@mail.gmail.com
 
Old 04-09-2011, 04:22 PM
Andrei Popescu
 
Default Disable a service

On Sb, 09 apr 11, 11:04:52, Dan wrote:
> Hi,
> I would like to know which is the standard way to disable services. I
> thought that the standard way is just to delete the link of the
> service from rc*.d
>
> For example to disable bluetooth I would just delete the link
> /etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth

This might work for a single runlevel, but has unexpected results if you
remove all symlinks:

,----[ man update-rc.d ]
| A common system administration error is to delete the links with the
| thought that this will "disable" the service, i.e., that this will pre‐
| vent the service from being started. However, if all links have been
| deleted then the next time the package is upgraded, the package's
| postinst script will run update-rc.d again and this will reinstall links
| at their factory default locations. The correct way to disable ser‐
| vices is to configure the service as stopped in all runlevels in which
| it is started by default. In the System V init system this means
| renaming the service's symbolic links from S to K.
`----

> But then I used service manager from gnome to disable bluetooth. It
> disabled the service but it didn't delete the link. So I guess that
> there is a standard procedure to disable the service without deleting
> the link. Which is that procedure?

Besides what is written in 'man update-rc.d' it is also necessary to run
insserv, which is not very well documented:

# mv /etc/rc3.d/S20bluetooth /etc/rc3.d/K00bluetooth
# insserv

(the actual number after the K doesn't really matter due to insserv)

Reactivating:
# mv /etc/rc3.d/K00bluetooth /etc/rc3.d/S20bluetooth
# insserv

(the number after the K might be different if insserv changed it and the
number after the S doesn't matter since insserv will re-order as needed.

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
 
Old 04-09-2011, 04:24 PM
Andrei Popescu
 
Default Disable a service

On Sb, 09 apr 11, 16:50:58, Michael Thompson wrote:
>
> And to disable the service in all the run levels, you execute the command:
>
> # update-rc.d -f apache2 remove
>
> Here -f option which stands for force is mandatory.

This will have unwanted side-effects, see the paragraph I quoted in my
other mail.

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
 
Old 04-09-2011, 04:37 PM
Camaleón
 
Default Disable a service

On Sat, 09 Apr 2011 11:04:52 -0400, Dan wrote:

> I would like to know which is the standard way to disable services. I
> thought that the standard way is just to delete the link of the service
> from rc*.d

I wondered the same in this thread:

http://lists.debian.org/debian-user/2010/12/msg00424.html

(that was a very interesting thread were people pointed out several ways
to achieve the same goal)

> For example to disable bluetooth I would just delete the link
> /etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth
>
> But then I used service manager from gnome to disable bluetooth. It
> disabled the service but it didn't delete the link. So I guess that
> there is a standard procedure to disable the service without deleting
> the link. Which is that procedure?

I finally disabled the service by issuing "update-rc.d service_name
disable". Full story here:

http://lists.debian.org/debian-user/2010/12/msg00505.html

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.04.09.16.37.35@gmail.com">http://lists.debian.org/pan.2011.04.09.16.37.35@gmail.com
 
Old 04-09-2011, 05:27 PM
Dan
 
Default Disable a service

On Sat, Apr 9, 2011 at 12:37 PM, Camaleón <noelamac@gmail.com> wrote:
> On Sat, 09 Apr 2011 11:04:52 -0400, Dan wrote:
>
>> I would like to know which is the standard way to disable services. I
>> thought that the standard way is just to delete the link of the service
>> from rc*.d
>
> I wondered the same in this thread:
>
> http://lists.debian.org/debian-user/2010/12/msg00424.html
>
> (that was a very interesting thread were people pointed out several ways
> to achieve the same goal)
>
>> For example to disable bluetooth I would just delete the link
>> /etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth
>>
>> But then I used service manager from gnome to disable bluetooth. It
>> disabled the service but it didn't delete the link. So I guess that
>> there is a standard procedure to disable the service without deleting
>> the link. Which is that procedure?
>
> I finally disabled the service by issuing "update-rc.d service_name
> disable". Full story here:
>
> http://lists.debian.org/debian-user/2010/12/msg00505.html
>

update-rc.d disable seems to be the best way. It renames the service
so that it starts with K instead with S. But I still do not know how
the gnome service manager is able to disable the service. It does not
make any change in the links in rc*.d and it does not make any change
in /etc/default/bluetooth


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTi=fTrROeu0+8BkmDUKzv9-=6xxXNw@mail.gmail.com">http://lists.debian.org/BANLkTi=fTrROeu0+8BkmDUKzv9-=6xxXNw@mail.gmail.com
 
Old 04-09-2011, 06:10 PM
Camaleón
 
Default Disable a service

On Sat, 09 Apr 2011 13:27:18 -0400, Dan wrote:

> On Sat, Apr 9, 2011 at 12:37 PM, Camaleón wrote:

(...)

>>> But then I used service manager from gnome to disable bluetooth. It
>>> disabled the service but it didn't delete the link. So I guess that
>>> there is a standard procedure to disable the service without deleting
>>> the link. Which is that procedure?
>>
>> I finally disabled the service by issuing "update-rc.d service_name
>> disable". Full story here:
>>
>> http://lists.debian.org/debian-user/2010/12/msg00505.html
>>
>>
> update-rc.d disable seems to be the best way. It renames the service so
> that it starts with K instead with S. But I still do not know how the
> gnome service manager is able to disable the service. It does not make
> any change in the links in rc*.d and it does not make any change in
> /etc/default/bluetooth

Hum... good question, let's dig a bit.

I also have "bluetooth" service disabled by using GNOME's "services-
admin" utility and indeed the service seems to be off ("/etc/init.d/
bluetooth status" returns "failed!") _but_ "grep -i bluetooth /var/log/
syslog*" and "ps aux | bluetooth" both commands return traces of some
kind of BT service/instance running in background/initalized :-?

Also, /etc/rc.d/* levels shows "S20" for bluetooth links in 3,4 and 5
runlevels while they should be "K".

Quite strange...

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.04.09.18.10.12@gmail.com">http://lists.debian.org/pan.2011.04.09.18.10.12@gmail.com
 
Old 04-09-2011, 08:28 PM
Freeman
 
Default Disable a service

On Sat, Apr 09, 2011 at 01:27:18PM -0400, Dan wrote:
> On Sat, Apr 9, 2011 at 12:37 PM, Camaleón <noelamac@gmail.com> wrote:
> > On Sat, 09 Apr 2011 11:04:52 -0400, Dan wrote:
> >
> >> I would like to know which is the standard way to disable services. I
> >> thought that the standard way is just to delete the link of the service
> >> from rc*.d
> >
> > I wondered the same in this thread:
> >
> > http://lists.debian.org/debian-user/2010/12/msg00424.html
> >
> > (that was a very interesting thread were people pointed out several ways
> > to achieve the same goal)
> >
> >> For example to disable bluetooth I would just delete the link
> >> /etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth
> >>
> >> But then I used service manager from gnome to disable bluetooth. It
> >> disabled the service but it didn't delete the link. So I guess that
> >> there is a standard procedure to disable the service without deleting
> >> the link. Which is that procedure?
> >
> > I finally disabled the service by issuing "update-rc.d service_name
> > disable". Full story here:
> >
> > http://lists.debian.org/debian-user/2010/12/msg00505.html
> >
>
> update-rc.d disable seems to be the best way. It renames the service
> so that it starts with K instead with S. But I still do not know how
> the gnome service manager is able to disable the service. It does not
> make any change in the links in rc*.d and it does not make any change
> in /etc/default/bluetooth
>

I have an Admin menu item called services that starts "services-admin," and
X app that shows all the init.d services. Is this what you are referring to?

There is a check box list of services. However, if I right click on the
listed service, I get a dialog box.

There I can authenticate as root, then click on Status to change between
start, stop and ignore, or Priority to edit the priotiry.

This does edit the rc*.d links.

--
Regards,
Freeman

"Microsoft is not the answer. Microsoft is the question. NO (or Linux) is the
answer." --Somebody


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110409202854.GA2826@Deneb.office">http://lists.debian.org/20110409202854.GA2826@Deneb.office
 
Old 04-09-2011, 09:05 PM
Joel Roth
 
Default Disable a service

On Sat, Apr 09, 2011 at 11:04:52AM -0400, Dan wrote:
> Hi,
> I would like to know which is the standard way to disable services. I
> thought that the standard way is just to delete the link of the
> service from rc*.d
>
> For example to disable bluetooth I would just delete the link
> /etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth

Some may disagree (and I've made this point before)
a standard way to prevent a script from
executing in Unixlike system is to set the
permissions.

chmod a-x /etc/init.d/bluetooth



> But then I used service manager from gnome to disable bluetooth. It
> disabled the service but it didn't delete the link. So I guess that
> there is a standard procedure to disable the service without deleting
> the link. Which is that procedure?
>
> Thanks,
> Dan
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/BANLkTi=8PHwgtS-DdaLMv=WYY8YOQ9mZtg@mail.gmail.com
>

--
Joel Roth


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110409210533.GA24051@sprite">http://lists.debian.org/20110409210533.GA24051@sprite
 
Old 04-09-2011, 09:29 PM
"John A. Sullivan III"
 
Default Disable a service

On Sat, 2011-04-09 at 11:05 -1000, Joel Roth wrote:
> On Sat, Apr 09, 2011 at 11:04:52AM -0400, Dan wrote:
> > Hi,
> > I would like to know which is the standard way to disable services. I
> > thought that the standard way is just to delete the link of the
> > service from rc*.d
> >
> > For example to disable bluetooth I would just delete the link
> > /etc/rc3.d/S20bluetooth that points to ../init.d/bluetooth
>
> Some may disagree (and I've made this point before)
> a standard way to prevent a script from
> executing in Unixlike system is to set the
> permissions.
>
> chmod a-x /etc/init.d/bluetooth
>
<snip>
I like that way but what happens when it is updated? It also generates
errors on boot and shutdown but those can be ignored. Thanks - John


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1302384591.13481.3.camel@denise.theartistscloset.c om">http://lists.debian.org/1302384591.13481.3.camel@denise.theartistscloset.c om
 

Thread Tools




All times are GMT. The time now is 09:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright Š2007 - 2008, www.linux-archive.org