Change file using shell, how?



  • Hi there,

    I’m having trouble getting changes into a file /var/etc/syslog.conf in a nano installation (2.2.5, upgraded today from 2.2.2 using auto upgrade).

    Here is what I do:

    /etc/rc.conf_mount_rw
    vi /var/etc/syslog.conf
    /etc/rc.conf_mount_ro
    

    The file shows up changed if I open it in vi again. However after reboot all my changes are gone. :(

    I already changed this file a long time ago trying to get a syslog host configured. This was on pfSense 2.2.2 or even earlier. But I can’t for the life of me remember what I did to edit this file. This cannot have been much of a challenge back then otherwise I would have created notes on that.

    Any help please?

    -flo-



  • I also tried to change the file using "Edit File" in Diagnostics btw. I did feel rather clumsy in comparison to having shell and vi at my command.  8)

    Anyway this did not work either.  :-\

    -flo-



  • The configuration files in /var are rebuilt from the configuration XML - they're not designed to be edited manually.

    Is there no way to make your change in the web user interface?



  • I added a syslog server to /var/etc/syslog.conf which I want to remove now. If this file would be overwritten completely from the config then these settings should just disappear which unfortunately they don't.

    Also I know of no way to set / overwrite syslog settings in the UI. Do you? This would be most convenient.

    Of course I can make a fresh install but I would like to avoid this.

    -flo-


  • Banned

    I have no idea how you changed that file long time ago, considering it's regenerated on every reboot with system_syslogd_start() - see system.inc. Just delete it and run that function from Diagnostics - Command Prompt.



  • This worked, thank you!! No clue what was wrong here.

    -flo-


Log in to reply