Feature request: write current pfSense version to syslog on boot



  • It would be great for troubleshooting issues to be able to see in the remote syslogs what version of pfsense is installed when it boots up.  If a simple line was output to syslog on boot I would know when a specific version was installed by going through the logs.

    May 31 15:02:56 pfsense bootinfo: 2.2-ALPHA (i386) built on Sat May 31 10:32:02 CDT 2014 FreeBSD 10.0-STABLE

    That would be nice to have :).

    There is an issue right now that I am trying to track down related to php-fpm but I installed so many different versions lately I can't really be sure when versions were installed looking at the remote syslog server I have logs going to for the system in question.



  • Well, there is this line in the boot log:

    May 20 22:19:21 pfsense kernel: FreeBSD 10.0-STABLE #55 e852cd6(HEAD)-dirty: Tue May 20 14:56:30 CDT 2014
    
    

    That timestamp corresponds roughly to:

    [2.2-ALPHA][root@pfsense.localdomain]/var/log(225): cat /etc/version.buildtime
    Tue May 20 14:44:56 CDT 2014
    
    

    I agree though, the /etc/version* info would be good to have in the bootlog.



  • That doesn't get sent to remote syslog servers though.  When the system is booting ethernet (maybe syslog too) is down for some parts of it.  The dmesg.boot also gets overwritten on each boot on each system so you will only have the last boot log on the systems.  Having it send the version to syslog after the system boots makes it so that the remote syslog server would get it (assuming the remote syslog server is up :)).


  • Administrator

    You can open a feature request at redmine.pfsense.org or better yet, send a pull request at github.com/pfsense/pfsense



  • I just might try the pull request route after I figure out the procedures to follow.  I am new to GIT but have experience with SVN.  Knowing where to put such a feature or where the developers would be ok with such a change might be the difficult part to determine for me though since I am not familiar with things yet.  There are lots of options.  Create a /bin/sh script and execute it from /etc/rc at the end.  Just put the code in /etc/rc.  Someplace else?



  • Well I submitted a FEATURE bug report on redmine with a diff and a note that I could submit a pull request if I find out how to do that from my fork on github.

    https://redmine.pfsense.org/issues/3699

    I added one line of output on bootup.  It only took 4 actual lines of script code in /etc/rc right before the Bootup complete message.  The name inside () is the platform (cdrom, nanobsd, pfSense, etc).

    Jun 7 21:05:52 pfsense kernel: pfSense (pfSense) 2.2-ALPHA i386 Thu Jun 05 17:02:09 CDT 2014
    Jun 7 21:05:52 pfsense kernel: Bootup complete

    There were lots of ways I could have written it but I think the above was the best idea I could think of.  I didn't want to change the Bootup complete line in case others depend on that for scripting or something to know when their systems started.



  • I cancelled my pull request because I realized that putting PFSENSE_ as a prefix for variables is not really a good idea.  I renamed the variables to more generic names without PFSENSE_ prefix but now I am trying to find out how to issue a pull request with 2 combined comits.

    I have my main master with the current changes but the differences that need to be submitted consist of 2 commits.  I read an article explaining how to do that but it seems it isn't working the same way.  Anyone know the correct way to do that?  I don't want to create another branch just to combine the two commits for a pull request.

    This is what I was trying to use but it didn't seem to work.  I got the editor to pop up during the rebase but I didn't get the two 'pick' entries like they explained.  I only saw one which didn't make sense to me so I aborted it.

    http://eli.thegreenplace.net/2014/02/19/squashing-github-pull-requests-into-a-single-commit/

    This is from a few days ago btw…

    User@PC ~/Downloads/User/user-pfsense-master/etc (master)
    $ git commit
    [master da70b16] Rename variables from last commit to not have the PFSENSE_ pref
    ix to give them more generic names.
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    User@PC ~/Downloads/User/user-pfsense-master/etc (master)
    $ cd ..
    
    User@PC ~/Downloads/User/user-pfsense-master (master)
    $ git push origin master
    Username for 'https://github.com': user
    Password for 'https://user@github.com':
    Counting objects: 32, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (4/4), 432 bytes | 0 bytes/s, done.
    Total 4 (delta 3), reused 0 (delta 0)
    To https://github.com/user/pfsense.git
       68e4048..da70b16  master -> master
    
    User@PC ~/Downloads/User/user-pfsense-master (master)
    $ git fetch upstream
    remote: Counting objects: 23, done.
    remote: Compressing objects: 100% (10/10), done.
    remote: Total 12 (delta 9), reused 5 (delta 2)
    Unpacking objects: 100% (12/12), done.
    From https://github.com/pfsense/pfsense
       ad03afb..6da518f  RELENG_2_1 -> upstream/RELENG_2_1
       2f9951f..6a0f34b  master     -> upstream/master
    
    User@PC ~/Downloads/User/user-pfsense-master (master)
    $ git merge upstream/master
    Merge made by the 'recursive' strategy.
     usr/local/www/interfaces_groups_edit.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    User@PC ~/Downloads/User/user-pfsense-master (master)
    $ git rebase -i origin/master
    
    *** I got the editor at this point but didn't see the two pick entries like the article claimed would be there so I aborted it.
    
    User@PC ~/Downloads/User/user-pfsense-master/etc (master)
    $ git log --oneline origin/master
    da70b16 Rename variables from last commit to not have the PFSENSE_ prefix to giv
    68e4048 Add pfSense version to syslog on bootup
    2f9951f Add some protection to parameters that come through _GET
    1c52509 Fix #3691, use curl instead of fetch to download update files
    88e545b Whitespace fixes
    2da4859 Allow the user to select "None" for OpenVPN client certificate, so long
    df13b07 Just use ID here instead.
    5344099 Various fixes to diag_dump_states.php (Add interface column, some extra
    e949001 Silent pbi_info
    29732bc Update csrf-magic to 1.0.4
    bc29d9f Reduce possible noise
    ee7f5e7 Merge pull request #1226 from ExolonDX/branch_master_04
    f133039 Merge pull request #1225 from ExolonDX/branch_master_03
    ccc3b02 Merge pull request #1224 from ExolonDX/branch_master_02
    960ed83 Merge pull request #1223 from ExolonDX/branch_master_01
    580a656 Tidy up "status_queues.php" XHTML
    2a351d3 Tidy up "status_openvpn.php" XHTML
    e6f98d5 Tidy up "diag_dns.php" XHTML
    2650922 Tidy up "crash_reporter.php" XHTML
    ed10564 allow ipaliases to be configured on lo0
    0db055f Merge pull request #1219 from nagyrobi/patch-13
    0bb15b9 Fix filename
    2fc7b00 Fix variable name
    cac386b remove openbgpd bits from system_gateways_edit and system.inc. The packa
    


  • I figured it out I think…

    User@PC ~/Downloads/User/user-pfsense-master/etc ((da70b16...))
    $ git rebase -i origin/master~2

    That shows the last 2 commits I did to my local git repo.  I renamed the last pick entry to squash per the article.

    EDIT:  Yea... that didn't work.  I ended up with 2 entries titled...
    Merge remote-tracking branch 'upstream/master'
    and the original 2 commits are still there.

    Since it is only 1 that was editing I think I will just delete the repo since nothing has been pulled from it yet and start over :).



  • New pull request was created.  This time I created a branch to work on and then merged that back to my personal master before submitting the pull request.  That feels like the right way to do it.

    EDIT: I found another article that explained what I should have done with my previous repo.  If I fall into that issue again I will try this route…

    git checkout -b {my_pull_request_feature_branch} upstream/master
    git cherry-pick {sha1_of_first_commit_for_feature_X} [sha1_of_another_commit_for_feature_X] …
    git push origin {my_pull_request_feature_branch}

    from: http://stackoverflow.com/questions/16984169/github-how-to-submit-individual-pull-request-in-case-of-multiple-commits


Log in to reply