How to determine system is pfSense?



  • In ansible we're running into an issue where we need to distinguish between FreeBSD and pfSense (see https://github.com/ansible/ansible/issues/41970). What would be the best way to do this?


  • Netgate Administrator

    Not really my field but maybe:

    [2.4.3-RELEASE][admin@pfsense.fire.box]/root: sysctl kern.ident
    kern.ident: pfSense
    

    vs

    root@FreeBSD11:~ # sysctl kern.ident
    kern.ident: GENERIC
    

    Steve



  • I would treat only "pfSense" as pfSense and everything else as FreeBSD because custom built FreeBSD is likely to have a custom kernel as well.


  • Galactic Empire

    Would a uname -a give you what you want ?

    [2.4.3-RELEASE][admin@pfsense.xxxxxxxxxx.net]/root: uname -a
    FreeBSD pfsense.xxxxxxxxxx.net 11.1-RELEASE-p10 FreeBSD 11.1-RELEASE-p10 #23 r313908+9347c667615(factory-RELENG_2_4): Thu May 10 15:09:29 CDT 2018     root@buildbot2.netgate.com:/xbuilder/crossbuild-243/pfSense/tmp/obj/xbuilder/crossbuild-243/pfSense/tmp/FreeBSD-src/sys/pfSense  amd64
    [2.4.3-RELEASE][admin@pfsense.xxxxxxxxxx.net]/root:
    

    Raspberry PI running FreeBSD:-

    $ uname -a
    FreeBSD sftp 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 14:27:25 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/RPI2  arm
    $
    

  • Rebel Alliance Developer Netgate

    On modern pfSense installs, there are a number of ways. The uname data as already mentioned, the contents of /etc/platform, the presence of the pfSense pkg, and likely dozens/hundreds of other methods based on the presence of certain files around the filesystem specific to pfSense.


 

© Copyright 2002 - 2018 Rubicon Communications, LLC | Privacy Policy