# Weird issue with net.eth0/net.eth1 startup order

## hanj

I feel like this is going to be a super stupid question. I'm working on a new box that will be a firewall. I have syslog-ng and stunnel in place, and no matter what I do, it will try to start before net.eth0 is up. net.eth0 starts directly after those services and the following services start up fine. I just do a restart on stunnel/syslog-ng after it's booted and it's fine.

Stunnel and syslog-ng are both in the default run level.

```
             bootmisc | boot

                devfs |                       sysinit

                dhcpd |      default

                dmesg |                       sysinit

                 fsck | boot

             hostname | boot

              hwclock | boot

             iptables |      default

              keymaps | boot

            killprocs |              shutdown

                local |      default

           localmount | boot

              modules | boot

             mount-ro |              shutdown

                 mtab | boot

                mysql |      default

             net.eth0 |      default

             net.eth1 |      default

               net.lo | boot

             netmount |      default

           ntp-client |      default

              openvpn |      default

              postfix |      default

               procfs | boot

                 root | boot

            savecache |              shutdown

                 sshd |      default

              stunnel |      default

                 swap | boot

               sysctl | boot

            syslog-ng |      default

         termencoding | boot

                 udev |                       sysinit

       udev-postmount |      default

              urandom | boot

           vixie-cron |      default

```

Not sure what the deal is here. I've even reconfigured my network so net.eth1 is the local network, but it appears that net.eth1 always starts before net.eth0.

Net.eth1 starts.. all good.

Syslog fails

Stunnel fails

net.eth0 starts.. all good

rest of the services start fine.

thanks!

hanji

----------

## Circuitsoft

Check the depend() section in /etc/init.d/syslog-ng and /etc/init.d/stunnel. Make sure there is a "need net" statement in them. There may also be such options in /etc/conf.d/<syslog/stunnel>

Lastly, check /etc/rc.conf for rc_depend_strict

----------

## hanj

 *Circuitsoft wrote:*   

> Check the depend() section in /etc/init.d/syslog-ng and /etc/init.d/stunnel. Make sure there is a "need net" statement in them. There may also be such options in /etc/conf.d/<syslog/stunnel>
> 
> Lastly, check /etc/rc.conf for rc_depend_strict

 

Thanks for writing! I did have 'need net' in the init script. I think it thinks it has it because net.eth1 is up.. and that is the problem. I need net.eth0 up first I think. I added 'rc_depend_strict' to rc.conf and rebooted.. no change. The problem remains. I didn't see anything specific with syslog-ng/stunnel options for conf.d/ I might look at the socket argument for stunnel though.

Thanks!

hanji

Edit: I just tried to add 'socket = a:SO_BINDTODEVICE=eth1' to stunnel.conf, but no dice on reboot. Same problem.

----------

## Hu

What if you add RC_NEED="net.eth0" to /etc/conf.d/stunnel and /etc/conf.d/syslog-ng?

----------

## hanj

 *Hu wrote:*   

> What if you add RC_NEED="net.eth0" to /etc/conf.d/stunnel and /etc/conf.d/syslog-ng?

 

I tried this.. no change. Same problem.

Thanks!

hanji

----------

