Commit/Patch question for Ermal



  • Hi Ermal,

    I was the one that changed interfaces.inc so that the ppp.conf file
    wasn't written to disk on every reboot/power up. It seemed like
    unnecessary disk writes and boot delay at the time I made the change.

    Your commit reversed that change:
    http://redmine.pfsense.org/repositories/revision/1/67cd847c53f6bd7edfc0e582c7f8c4738a086365

    I was just wondering why it's necessary to re-write the config file on
    every reboot?

    Of course, I also filed this ticket "PPP config files not copied" (
    http://redmine.pfsense.org/issues/show/271#change-910 ) which is fixed
    by writing the config file at boot time. I guess it makes sense to
    write the config file at boot time if it doesn't exist already. Can we
    do that instead? It'll save a few write cycles to CF card users and a few milliseconds (seconds?) of boot time for everyone! :)

    Thanks,

    Gabriel



  • I am not sure why ppp.conf is in /etc either.
    So i would say to fix that on saving write cycles.

    As about boot time. What about me and my pppoe link should we delay its startup too?!
    Without a generic process for every type of ppp link that takes time to setup i will not revert that change.



  • Hi,


    I am not sure why ppp.conf is in /etc either.
    So i would say to fix that on saving write cycles.

    As about boot time. What about me and my pppoe link should we delay its startup too?!
    Without a generic process for every type of ppp link that takes time to setup i will not revert that change.


    I don't understand your response.

    I think ppp.conf is in /etc because that's where it is by default and no one thought to put it somewhere else. Do you have some idea where it would be ideally? The ppp.conf file will survive reboot intact no matter where it's saved onto the file system. So I don't understand how changing/fixing where the ppp.conf file is located will save write cycles.

    If for every type of ppp link we check to see that the .conf file exists at boot time, then we can prevent every type of link from delaying boot process by writing the .conf files over and over again when the user wants the same .conf files that existed when the box was shut down previously. We only need to write out .conf files in two scenarios. 1. When the user is editing the configuration, and 2. when the box is booting after an upgrade. We want the same config as before, but the file doesn't exist in the file system.

    So, I don't understand what you mean by "every type of link that takes time to set up" because if you don't write the config file at every boot, then the link takes no time to set up unless it's assigned to an interface and you want it to connect, and then we're still not taking time to write the file, just time for the connection to come up.

    Can you explain more about your concerns please? Have I failed to understand something? Why do we need to write the config file over again with every reboot?

    Thanks,

    Gabriel



  • I will not delve into why pfSense does this or that.
    Belive me there are reasons to setup the config file on every interface reload because of other factors.

    /etc should not be in any case the location for a configuration file since in embedded install it is read-only and there is no other ppp utility that writes in read-only file systems its config files.

    FYI, the first reason that everything is re-written over and over is for consistency. There are other factors as i said but you can find out yourself i guess.



  • There's no harm in writing it out every time (it would probably take a few thousand years to hit the write limit with what happens during reboots), and if you don't, it creates a huge number of possibilities for bugs or other inconsistencies.


Locked