LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   dealing with the runlevels (https://www.linuxquestions.org/questions/linux-networking-3/dealing-with-the-runlevels-679038/)

kellogs 10-25-2008 05:32 PM

dealing with the runlevels
 
Hello all

Help me with this one:

----some details for prob #1----

I have recently installed apache server, as well as ddclient - a dynamic IP reporting tool. Good for hosting a webserver from a dynamic IP machine.
My connection is a PPPoE one, and for that I use an USB modem. Naturally, linux does not support this kind of crap ootb, so I managed some bridging between a virtual ethernet interface and the physical modem (which speaks ATM). I have found some tutorials over the web describing a method to automatically bring up that connection upon boot. Using a script. Called S96dial. ran from rc5.d.

----problem #1---

Thing is, I have been trying to convince my system to behave as follows: first bring up the internet, then start ddclient, and then httpd. I have managed to do just so, but ... :D however, in the course of action, I have also managed to annoy iptables. /var/log/prcsys now says:

Code:

Applying iptables firewall rules:
iptables-restore v1.3.7: Problem when communicating with ipset, errno=92.

I have inspected my iptables config, its all ok, and iptables runs ok (apparently, anyway). Is there something to worry about? Because those 2 lines definitely were not showing up at boot.

----problem #2----

And guess how I made my system first load the net connection, and only then those 2 daemons http and ddclient ?
:D

S51network and S52network-up scripts from runlevel 5 now have new names:
_S51network and _S52network-up. Yes, those 2 do not make it through anymore. So right now I have no support for my ethernet NICs, but I am not at all bothered. That is just fine if u ask me, but I wanted to ask some other persons too, just to be sure I aint doing anything dangerous to my configuration.

---details to prob# 2-----

Why I have chosen to do this - cause my S64dial (renamed it so it would start before the targeted daemons) script would just not get along with whatever those 2 'network' scripts did. Always got <<[Failed]>> lines complaining about ppp0 and nas0 interfaces (used for internet); then, when X loaded everything I could see my connection to the net (which was opening okay because of S64dial script) was now dead or corrupted (and nonfunctional). Sigh.


Thanks

pinniped 10-27-2008 04:46 AM

You're giving a lot of irrelevant information and skipping very important parts. For example, what modem do you have? Linux will run with most (if not all) PPPoE modems via the ethernet cable and Linux will also run with quite a few modems which use a USB connection. For all we know, you could be doing things the hard way (and the wrong way).

kellogs 10-27-2008 12:46 PM

Quote:

Originally Posted by pinniped (Post 3322917)
You're giving a lot of irrelevant information and skipping very important parts. For example, what modem do you have? Linux will run with most (if not all) PPPoE modems via the ethernet cable and Linux will also run with quite a few modems which use a USB connection. For all we know, you could be doing things the hard way (and the wrong way).

hey,

believe me on this one. No other way to get online with a ST330 Thomson modem. Tried it very hard to make it work as close as possible to OOTB about an year ago. And failed. However, connectivity is not an issue. Just wanted to find out if I really broke iptables (#1) and anything else besides my ethernet NICs (#2). Anything else I need to stdinput ?

Thanks
kellogs

pinniped 10-28-2008 05:15 AM

It is possible you are just doing some things in the wrong order. If you actually do alter the iptables rules it is also fairly easy to isolate your computer. Can you provide a link to the information you used to set up? It's impossible to guess what might have gone wrong if we don't even know what you did.

kellogs 10-28-2008 06:31 PM

Ok . there goes:

- configuring the internet connection:
http://forum.mandriva.com/viewtopic....653472c20f3cd3
(last post on the thread). This left me with a S96dial script for runlevel 5. And worked ok.

PHP Code:

urpmi apachechkconfig httpd
urpmi ddclientchkconfig ddclient 

-my rc5 folder looks now like this like this:
PHP Code:

[root@localhost kellogs]# ls /etc/rc.d/rc5.d/
K00dund@        S04acpi@         S25haldaemon@         S53pcscd@       S64dial@
K00netconsole@  S04dkms@         S29numlock@           S53shorewall@   S65atieventsd@
K00pand@        S05harddrake@    S35vboxadd-timesync@  S54dm@          S65ddclient@
K59hidd@        S09hcfpci@       S40atd@               S54mandi@       S90crond@
K84bgpd@        S09hsf@          S50resolvconf@        S54netfs@       S90webmin@
K84ospf6d@      S13partmon@      S50syslog@            S54nfs-common@  S91smb@
K84ospfd@       S14acpid@        _S51network@          S55keytable@    S92httpd@
K84ripd@        S15mdadm@        _S52network-up@       S55snmpd@       S95jexec@
K84ripngd@      S17alsa@         S53avahi-daemon@      S55sshd@        S95kheader@
K85zebra@       S17watchquagga@  S53consolekit@        S56ntpd@        S99haldaemon@
K95rwflowpack@  S18sound@        S53cups@              S56xinetd@      S99local@
S03iptables@    S24messagebus@   S53openvpn@           S57mysqld@      S99vncserver

S64dial was renamed from S96dial

Basically that was it. Cant remember anything else besides attempting to rename S96dial -> Sxxdial for about 4-5 times, and commenting / uncommenting _S51network and _S52network-up scripts. Oh, and also added K44dial to runlevels 0,1,6. Does it matter is K44 and not K64 ?

Thanks for helping.

pinniped 10-29-2008 01:47 AM

I suspect that shorewall complains because you don't have any interfaces configured at all. Your network connection script needs to run before shorewall so that shorewall can set up the rules correctly.

Since shorewall is S53 and your network setup scripts (which you disabled) are S51,S52, I suggest you set those older scripts to 50,51 and your dialup script should be S52; you will also have to move the resolvconf and syslog to S49. There should be no need to completely disable your network startup scripts as you have done. If you don't want to use a particular interface, just configure it so that it's not activated. So aside from changing the priority of those links, activate those network scripts again and tell us about the errors which come up.

Quote:

Oh, and also added K44dial to runlevels 0,1,6. Does it matter is K44 and not K64 ?
The startup/shutdown priorities are usually different (after all, the shutdown will usually proceed in the opposite order). What is important is that dependent services are shut down in the correct order. For example, let's say you have "networking" and "ssh" - when they start, "networking" will be run first to set up your network interface, then "ssh" will be run to set up the ssh daemon (which will probably use the interface which you had just configured). When shutting down, "ssh" must be shut down first - if you shut down "networking" first then any current ssh sessions have their connections cut without any warning. Shutting down in the wrong order can cause more serious problems for some things.

What script do you use to start; the one referenced at http://www.linux-usb.org/SpeedTouch/mandrake/index.html ?

The only scripts I can see are not proper service startup/shutdown scripts; they only do one thing (start up) but they cannot stop or restart the service.

kellogs 10-30-2008 09:11 AM

Quote:

suspect that shorewall complains because you don't have any interfaces configured at all. Your network connection script needs to run before shorewall so that shorewall can set up the rules correctly.

Since shorewall is S53 and your network setup scripts (which you disabled) are S51,S52, I suggest you set those older scripts to 50,51 and your dialup script should be S52; you will also have to move the resolvconf and syslog to S49. There should be no need to completely disable your network startup scripts as you have done. If you don't want to use a particular interface, just configure it so that it's not activated. So aside from changing the priority of those links, activate those network scripts again and tell us about the errors which come up.
Done as you have said. Result:

PHP Code:

[root@localhost kellogs]# cat /var/log/prcsys.log
Cannot readlink /etc/rc5.d//S52dial~
Activating Compat-mode for non LSB-script watchquagga
Activating Compat
-mode for non LSB-script dial
Activating Compat
-mode for non LSB-script S52dial~
Activating Compat-mode for non LSB-script ddclient
Activating Compat
-mode for non LSB-script webmin
Starting Conexant HCF controllerless PCI modem
/etc/rc5.d//S09hcfpci: line 28: /usr/sbin/hcfpciconfig: No such file or directory
Starting Conexant HSF softmodem
/etc/rc5.d//S09hsf: line 28: /usr/sbin/hsfconfig: No such file or directory
Checking if partitions have enough free diskspace:              [  OK  ]
Applying iptables firewall rules:
iptables-restore v1.3.7Problem when communicating with ipseterrno=92.

                                                                
[FAILED]
Starting acpi daemon:                                           [  OK  ]
ALSA driver (version 1.0.14is already running.Doing alsactl to[  OK  mixer settings:
Starting VirtualBox host to guest time synchronisation VirtualBox Additions module not loaded!
Starting atd:                                                   [  OK  ]
Starting numlock:                                               [  OK  ]
Starting system message busUnknown username "polkituser" in message bus configuration file
                                                                
[  OK  ]
Starting system logger:                                         [  OK  ]
Starting kernel logger:                                         [  OK  ]
Starting resolvconf:                                            [  OK  ]
Starting HAL daemon:                                            [  OK  ]
Bringing up loopback interface:                                 [  OK  ]
Bringing up interface eth0:                                     [  OK  ]
Bringing up interface eth1:                                     [  OK  ]
Bringing up interface nas0:  Device nas0 does not seem to be presentdelaying initialization.
                                                                [
FAILED]
Bringing up interface ppp0:  Failed to activate ppp0retrying in the background
                                                                
[FAILED]
Waiting for network to be up                                    [  OK  ]
Mounting other filesystems:                                     [  OK  ]
Starting smart card daemon:                                     [  OK  ]
Loading keymapus                                              [  OK  ]
The BackSpace key sends: ^?                                     [  OK  ]
Starting openvpn:                                               [  OK  ]
Starting xinetd                                                 [  OK  ]
Starting ConsoleKit:                                            [  OK  ]
Starting display manager:                                       [  OK  ]
Starting snmpd:                                                 [  OK  ]
Starting Avahi daemon:                                          [  OK  ]
Starting sshd:                                                  [  OK  ]
Starting NFS common utilities
Starting rpc
.statd                                              [FAILED]
Adding loopback device to routing table ...
Starting CUPS printing system:                                  [  OK  ]
Starting atieventsd:                                            [  OK  ]
Syncing time for ntpd:                                          [FAILED]
Starting ntpd:                                                  [  OK  ]
Starting MySQL:                                                 [  OK  ]
Compiling...
Initializing...
Determining Zones...
   
IPv4 Zonesnet loc
   Firewall Zone
fw
Validating interfaces file
...
Validating hosts file...
Pre-processing Actions...
   
Pre-processing /usr/share/shorewall/action.Drop...
   
Pre-processing /usr/share/shorewall/action.Reject...
Validating Policy file...
Determining Hosts in Zones...
   
net Zoneeth0:0.0.0.0/0
   loc Zone
eth1:0.0.0.0/0
Deleting user chains
...
Compiling /etc/shorewall/routestopped ...
Creating Interface Chains...
Compiling Common Rules
Compiling IP Forwarding
...
Compiling /etc/shorewall/rules...
Compiling Actions...
Compiling /usr/share/shorewall/action.Drop for Chain Drop...
Compiling /usr/share/shorewall/action.Reject for Chain Reject...
Compiling /etc/shorewall/policy...
Compiling Traffic Control Rules...
Compiling Rule Activation...
Shorewall configuration compiled to /var/lib/shorewall/.start
Processing 
/etc/shorewall/params ...
Starting Shorewall....
Initializing...
Processing /etc/shorewall/init ...
Clearing Traffic Control/QOS
Deleting user chains
...
Processing /etc/shorewall/continue ...
   
WARNINGDISABLE_IPV6=Yes in shorewall.conf but this system does not appear to have ip6tables
Enabling Loopback 
and DNS Lookups
Creating 
Interface Chains...
Setting up SMURF control...
Processing /etc/shorewall/initdone ...
Setting up Black List...
Setting up ARP filtering...
Setting up Accept Source Routing...
Setting up SYN Flood Protection...
Setting up Rules...
Setting up Actions...
Creating action chain Drop
Creating action chain Reject
Creating action chain dropBcast
Creating action chain dropInvalid
Creating action chain dropNotSyn
Applying Policies
...
Activating Rules...
Processing /etc/shorewall/start ...
Processing /etc/shorewall/started ...
done.
Starting mandi daemonmandi_daemon_add_watch(): READABLE
unable to open white 
list file
                                                                
[  OK  ]
Starting crond:                                                 [  OK  ]
Starting jexec servicesStarting httpdhttpdapr_sockaddr_info_get() failed for localhost
httpd
Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                                [FAILED]
Starting SMB services:                                          [  OK  ]
Starting NMB services:                                          [  OK  ]
Starting VNC server:                                            [  OK  ]
Total time: 108 seconds 

My ppp connection was non-functional imediately after login. It acquired a valid IP address, but could not be used for browsing / chating (havent tried anything else). It needed a restart, and everything worked thereafter.



Quote:

The only scripts I can see are not proper service startup/shutdown scripts; they only do one thing (start up) but they cannot stop or restart the service.
My bad. Now the script looks like this:

PHP Code:

#!/bin/bash
start() {
    
count=0
    
while [[ $((count++)) -lt 40 ]] 
    do
        
sync=$(dmesg grep 'ADSL line is up')
        if [ ! -
"$sync
        
then
            br2684ctl 
--c 0 -a 0.35
            sleep 1
            ifconfig nas0 192.168.0.1 netmask 255.255.255.0
            sleep 3
            pppoe
-start
            
exit 0
        fi
        sleep 1
    done
    
echo "The SpeedTouch firmware did not load" 
}

stop() {
    
pppoe-stop
    sleep 2
}

status() {
    
pppoe-status
}

case 
"$1" in
  start
)
    
start
    
;;
  
stop)
      
stop
    
;;
  
status)
    
status
    
;;
  
restart)
    
stop
    start
    
;;
  
reload)
    
stop
    start
    
;;
  *)
    
printf "*** Usage: $0 {start|stop|status|restart|reload}\n"
    
exit 1
esac

exit 



All times are GMT -5. The time now is 09:53 PM.