service utility with Ubuntu 10.04 does not work properly when used to restart network

Tom H tomh0665 at gmail.com
Mon Mar 14 17:56:25 UTC 2011


On Mon, Mar 14, 2011 at 8:37 AM, Tapas Mishra <mightydreams at gmail.com> wrote:
> On Mon, Mar 14, 2011 at 5:08 PM, Tom H <tomh0665 at gmail.com> wrote:
>> On Mon, Mar 14, 2011 at 6:13 AM, Tapas Mishra <mightydreams at gmail.com> wrote:



>>> On Red Hat based systems I used to do service networking restart and
>>> hence I did the same here also.
>>
>> No. On an RH box, if NM's managing your interface(s), "service network
>> restart" (not "service networking restart") doesn't restart the
>> network.
>>
>> I'm assuming, of course, that the box is set up properly, meaning that
>> "chkconfig --list NetworkManager" returns "0:off 1:off 2:on 3:on 4:on
>> 5:on 6:off" and "chkconfig --list network" returns "0:off 1:off 2:off
>> 3:off 4:off 5:off 6:off"...
>
> I checked on my Ubuntu machine
>
> chkconfig --list NetworkManager
> NetworkManager: unknown service

Those commands were for an RH box. I've also given you commands for an
Ubuntu box. It's hard to believe that you're not doing this on
purpose...


>>>> If you're using "/etc/network/interfaces" and want to restart the
>>>> network service, use "/etc/init/networking.conf".
>>>
>>> How do I determine which one is in use.
>>
>> status networking
>> status network-manager
>> (status is short for "initctl status")
>> or
>> service networking status
>> service network-manager status
>>
>> Once you determine which one's active (whichever applies):
>> restart networking/restart network-manager
>> (restart is short for "initctl restart")
>> or
>> service networking restart/service network-manager restart
>
> Ok what is the difference between the two  I mean network-manager and
> networking?
>
> In case of networking who is controlling the network and lan card?

network-manager = Network Manager controls the NIC configuration
networking = /etc/network/interfaces controls the NIC's configuration



> Here after this message to understand it further I Googled about
> initctl and the stuff you mentioned.
> initctl list shows following things running
> http://pastebin.com/LrzuzZ7S
> I do not see bluetooth any where in above output.
> Now I check  sysv-rc-conf shows bluetooth and a cross X marked on it
> at run level 5.
> So I feel that in run level 5 bluetooth is running on my system.
>
> and when I do status bluetooth
> then
> status: Unknown job: bluetooth
>
> where as if I do
>
> chkconfig --list bluetooth
> bluetooth                 0:off  1:off  2:on   3:on   4:on   5:on   6:off
>
> so this is very surprising as in above output you see 5:on where as
> status wont recognize it.

That's because bluetooth is controlled through "/etc/init.d" and not
through "/etc/init".

As long as Ubuntu uses a hybrid startup setup, it's safer to use
"service..." because it applies to both upstart jobs and non-upstart
jobs.




More information about the ubuntu-users mailing list