Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use Ubuntu 12.04.1
I just wanted to find good tool for managing services, and I see that it is not existing...
Native "update-rc.d" managing services, but don't provide information, and not native "chkconfig" provide information, but throw error when I try to activate some service in some run level.
Any way, I just listed /etc/rc0.d/ directory, and found start up link for networking script (link starting with "S"):

user@comp:/etc/rc0.d$ ls -la
total 20
drwxr-xr-x   2 root root  4096 окт.  11 16:45 .
drwxr-xr-x 139 root root 12288 окт.  21 11:55 ..
lrwxrwxrwx   1 root root    17 окт.  11 16:45 K09apache2 -> ../init.d/apache2
lrwxrwxrwx   1 root root    29 окт.  11 04:39 K10unattended-upgrades -> ../init.d/unattended-upgrades
lrwxrwxrwx   1 root root    27 окт.  11 04:39 K20speech-dispatcher -> ../init.d/speech-dispatcher
-rw-r--r--   1 root root   353 июля  26 20:23 README
lrwxrwxrwx   1 root root    18 окт.  11 04:39 S20sendsigs -> ../init.d/sendsigs
lrwxrwxrwx   1 root root    17 окт.  11 04:39 S30urandom -> ../init.d/urandom
lrwxrwxrwx   1 root root    22 окт.  11 04:39 S31umountnfs.sh -> ../init.d/umountnfs.sh
lrwxrwxrwx   1 root root    20 окт.  11 04:39 S35networking -> ../init.d/networking
lrwxrwxrwx   1 root root    18 окт.  11 04:39 S40umountfs -> ../init.d/umountfs
lrwxrwxrwx   1 root root    20 окт.  11 04:39 S60umountroot -> ../init.d/umountroot
lrwxrwxrwx   1 root root    14 окт.  11 04:39 S90halt -> ../init.d/halt

My only question: Is it OK?
If it OK, why should networking service start in halt run level?
If it not OK, how I fix it?

share|improve this question
1  
I am not familiar with Ubuntu, but it most likely that Ubuntu also switches to systemd management of services –  Serge Oct 21 '12 at 16:24
    
I tried to find command and package, no one of them... –  Rodnower Oct 21 '12 at 16:28
1  
Ubuntu uses Upstart as its init process. –  Pedro Romano Oct 21 '12 at 17:06

1 Answer 1

up vote 1 down vote accepted

Have a look at /etc/init.d/halt. This file surely belongs in /etc/rc0.d - and the only thing it defines is the stop functionality (i.e. /etc/init.d/halt start is a no-op). We can hence assume that scripts in /etc/rc0.d are called with the stop rather than start argument.

Then having a look at /etc/init.d/networking, we see:

stop)
    check_network_file_systems
    check_network_swap

    log_action_begin_msg "Deconfiguring network interfaces"
    if ifdown -a --exclude=lo $verbose; then
        log_action_end_msg $?
    else
        log_action_end_msg $?
    fi
    ;;

which first makes sure that no filesystems are mounted on the network anymore (which should be the case after umountnfs.sh ran) and then disables networking (via ifdown) to, for example, release DHCP leases or anything else sensibly one would want to do upon network deconfiguration.

To conclude, having a link to /etc/init.d/networking in /etc/rc0.d is perfectly fine.

(Note that I use Debian, but the scripts should essentially be the same.)

Furthermore, you should normally use update-rc.d, which is able of enabling/disabling services, either for specific runlevels or in general, and ls in order to see which services are enabled/disabled. I guess Ubuntu won’t switch to systemd any time soon, although one can apparently install it in Debian already, if one choses to do so.

share|improve this answer
    
Unfortunately I changed computer, but I sure that your explanation answering to my question. Thank you very much. –  Rodnower Nov 3 '12 at 13:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.