Netgate SG-1000 microFirewall

Author Topic: Change file using shell, how?  (Read 808 times)

0 Members and 1 Guest are viewing this topic.

Offline -flo-

  • Sr. Member
  • ****
  • Posts: 392
  • Karma: +31/-0
    • View Profile
Change file using shell, how?
« on: November 07, 2015, 09:26:00 am »
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:

Code: [Select]
/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-

Offline -flo-

  • Sr. Member
  • ****
  • Posts: 392
  • Karma: +31/-0
    • View Profile
Re: Change file using shell, how?
« Reply #1 on: November 07, 2015, 09:38:32 am »
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-

Offline David_W

  • Sr. Member
  • ****
  • Posts: 386
  • Karma: +74/-0
    • View Profile
Re: Change file using shell, how?
« Reply #2 on: November 07, 2015, 02:05:40 pm »
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?

Offline -flo-

  • Sr. Member
  • ****
  • Posts: 392
  • Karma: +31/-0
    • View Profile
Re: Change file using shell, how?
« Reply #3 on: November 07, 2015, 02:26:51 pm »
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-

Offline doktornotor

  • Hero Member
  • *****
  • Posts: 8551
  • Karma: +964/-278
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Change file using shell, how?
« Reply #4 on: November 07, 2015, 03:30:20 pm »
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.
Do NOT PM for help!

Offline -flo-

  • Sr. Member
  • ****
  • Posts: 392
  • Karma: +31/-0
    • View Profile
Re: Change file using shell, how?
« Reply #5 on: November 08, 2015, 03:36:49 am »
This worked, thank you!! No clue what was wrong here.

-flo-