You are not logged in.

#1 2012-02-08 11:57:06

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

[SOLVED] Network changes to the initscripts

I want to edit make runlevel 4 identical to runlevel 3, and runlevel 6 identical to runlevel 5.
Except runlevel 5 and runlevel 6 should not try to start the network.

How should I edit one of these runlevels, for example runlevel 3, to not start the network?

I also want the runlevel 5 (and maybe runlevels 3 and 1) to start the network while waiting
for user authorisation.

--
Ex animo
Hibernate

Last edited by Hibernate (2012-02-12 15:16:42)

Offline

#2 2012-02-08 14:11:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Network changes to the initscripts

Offline

#3 2012-02-09 10:43:44

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Re: [SOLVED] Network changes to the initscripts

I'm familiar with how to edit create and edit runlevels, it is the details over when the network is started I'm not.
If ”network” is a default daemon which lets the network start at init, I will only have to skip that daemon in
if the selected runlevel is 4 or 6; if so that will not be difficult.

I some I'll only have to execute "network &" at the end of the initscript if network was listed as a daemon and
if the runlevel is 5.

Offline

#4 2012-02-12 15:30:20

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Re: [SOLVED] Network changes to the initscripts

I changed network to @network under DAEMONS in /etc/rc.conf

Changed a little of the initscripts assignments for the runlevels in /etc/inittab:

rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi

I forgot that runlevel 6 was reboot, so I this is what they do now:

0: Halt
1(S): Single-user (didn't even start daemons so why add networkless)
2: Multi-user without network
3: Multi-user
4: X11 without network
5: X11
6: Reboot

In /etc/rc.multi add added some code to the #Start daemons part:

for daemon in "${DAEMONS[@]}"; do
    if [[ $RUNLEVEL = 2 || $RUNLEVEL = 4]]; then
        if [[ "$daemon" = 'network' || "$daemon" = '@network' ]]; then
            continue  # Skip this daemon.
        fi
    fi
    case ${daemon:0:1} in
        '!')  continue;;  # Skip this daemon.
        '@')  start_daemon_bkgd "${daemon#@}";;
        *)    start_daemon "$daemon";;
    esac
done

Offline

Board footer

Powered by FluxBB