{"id":36081,"date":"2024-12-05T07:46:31","date_gmt":"2024-12-05T06:46:31","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=36081"},"modified":"2024-12-05T07:46:34","modified_gmt":"2024-12-05T06:46:34","slug":"freebsd-basics-5-providing-services-using-jails","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/","title":{"rendered":"FreeBSD basics \u2013 5 \u2013 Providing services using Jails"},"content":{"rendered":"\n<p>This post builds on top of the <a href=\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-4-jails\/\" target=\"_blank\" rel=\"noreferrer noopener\">previous post<\/a> in which we&#8217;ve created a simple thin Jail. The goal of this post is, to put a bit of automation around this and to provide a simple PostgreSQL as a service platform. We want to do this by creating one PostgreSQL instance per Jail (without any restrictions on resource usage for now, no monitoring and so on). Before we start with this, let&#8217;s remove the sample thinjail1 we&#8217;ve created in the last post:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,6,7,8,10,45]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ jls\n   JID  IP Address      Hostname                      Path\n     1  192.168.122.160 thinjail1                     \/usr\/local\/jails\/containers\/thinjail1\nroot@freebsd14:~ $ service jail stop thinjail1\nStopping jails: thinjail1.\nroot@freebsd14:~ $ chflags -R 0 \/usr\/local\/jails\/containers\/thinjail1\nroot@freebsd14:~ $ rm -rf \/usr\/local\/jails\/containers\/thinjail1\/*\nroot@freebsd14:~ $ jls\n   JID  IP Address      Hostname                      Path\nroot@freebsd14:~ $ zfs destroy zroot\/jails\/containers\/thinjail1\n<\/pre><\/div>\n\n\n<p>We&#8217;ll also remove the ZFS snapshot because we&#8217;ll be creating a new one containing additional packages and configuration:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,2]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ zfs destroy zroot\/jails\/templates\/14.1-RELEASE@base\nroot@freebsd14:~ $ zfs list -t snapshot\nNAME                                       USED  AVAIL  REFER  MOUNTPOINT\nzroot\/ROOT\/default@2024-11-26-10:56:43-0   394M      -  1.46G  -\nzroot\/ROOT\/default@2024-12-04-08:41:41-0  2.23M      -  2.49G  -\nzroot\/ROOT\/default@2024-12-04-08:42:46-0  1.86M      -  2.58G  -\n<\/pre><\/div>\n\n\n<p>Remember that this was our base for the Jail:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ ls -al \/usr\/local\/jails\/templates\/14.1-RELEASE\/\ntotal 95\ndrwxr-xr-x  18 root wheel   22 Dec  2 13:35 .\ndrwxr-xr-x   3 root wheel    3 Dec  2 13:29 ..\n-rw-r--r--   2 root wheel 1011 May 31  2024 .cshrc\n-rw-r--r--   2 root wheel  495 May 31  2024 .profile\n-r--r--r--   1 root wheel 6109 May 31  2024 COPYRIGHT\ndrwxr-xr-x   2 root wheel   49 Dec  2 13:40 bin\ndrwxr-xr-x  15 root wheel   69 Dec  2 13:40 boot\ndr-xr-xr-x   2 root wheel    2 May 31  2024 dev\ndrwxr-xr-x  30 root wheel  105 Dec  2 13:40 etc\ndrwxr-xr-x   4 root wheel   78 Dec  2 13:40 lib\ndrwxr-xr-x   3 root wheel    5 May 31  2024 libexec\ndrwxr-xr-x   2 root wheel    2 May 31  2024 media\ndrwxr-xr-x   2 root wheel    2 May 31  2024 mnt\ndrwxr-xr-x   2 root wheel    2 May 31  2024 net\ndr-xr-xr-x   2 root wheel    2 May 31  2024 proc\ndrwxr-xr-x   2 root wheel  150 Dec  2 13:40 rescue\ndrwxr-x---   2 root wheel    7 May 31  2024 root\ndrwxr-xr-x   2 root wheel  150 Dec  2 13:40 sbin\nlrwxr-xr-x   1 root wheel   11 May 31  2024 sys -&gt; usr\/src\/sys\ndrwxrwxrwt   2 root wheel    2 May 31  2024 tmp\ndrwxr-xr-x  14 root wheel   14 May 31  2024 usr\ndrwxr-xr-x  24 root wheel   24 May 31  2024 var\n<\/pre><\/div>\n\n\n<p>What we&#8217;re doing now is to install PostgreSQL into this base so we&#8217;ll have that available immediately when we create new Jails afterwards. To do this we can ask pkg to perform it&#8217;s actions against a chroot environment instead of the host system by using the &#8220;-c&#8221; switch:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ pkg -c \/usr\/local\/jails\/templates\/14.1-RELEASE\/ install postgresql17-server-17.2 postgresql17-contrib-17.2\nUpdating FreeBSD repository catalogue...\nFreeBSD repository is up to date.\nAll repositories are up to date.\nThe following 17 package(s) will be affected (of 0 checked):\n\nNew packages to be INSTALLED:\n        gettext-runtime: 0.22.5\n        icu: 74.2_1,1\n        indexinfo: 0.3.1\n        libedit: 3.1.20240808,1\n        libffi: 3.4.6\n        liblz4: 1.10.0,1\n        libxml2: 2.11.9\n        llvm15: 15.0.7_10\n        lua53: 5.3.6_1\n        mpdecimal: 4.0.0\n        perl5: 5.36.3_2\n        postgresql17-client: 17.2\n        postgresql17-contrib: 17.2\n        postgresql17-server: 17.2\n        python311: 3.11.10\n        readline: 8.2.13_1\n        zstd: 1.5.6\n\nNumber of packages to be installed: 17\n\nThe process will require 1 GiB more space.\n231 MiB to be downloaded.\n\nProceed with this action? &#x5B;y\/N]: y\n&#x5B;1\/17] Fetching indexinfo-0.3.1.pkg: 100%    6 KiB   5.9kB\/s    00:01    \n&#x5B;2\/17] Fetching libxml2-2.11.9.pkg: 100%  873 KiB 893.6kB\/s    00:01    \n...\nTo use PostgreSQL, enable it in rc.conf using\n\n  sysrc postgresql_enable=yes\n\nTo initialize the database, run\n\n  service postgresql initdb\n\nYou can then start PostgreSQL by running:\n\n  service postgresql start\n\nFor postmaster settings, see ~postgres\/data\/postgresql.conf\n\nNB. FreeBSD&#039;s PostgreSQL port logs to syslog by default\n    See ~postgres\/data\/postgresql.conf for more info\n\nNB. If you&#039;re not using a checksumming filesystem like ZFS, you might\n    wish to enable data checksumming. It can be enabled during\n    the initdb phase, by adding the &quot;--data-checksums&quot; flag to\n    the postgresql_initdb_flags rcvar. Otherwise you can enable it later by\n    using pg_checksums.  Check the initdb(1) manpage for more info\n    and make sure you understand the performance implications.\n<\/pre><\/div>\n\n\n<p>We can easily verify this by looking at \/usr\/local\/bin of our base:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,23]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ ls -al \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg*\n-rwxr-xr-x  1 root wheel  99224 Dec  3 02:06 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_amcheck\n-rwxr-xr-x  1 root wheel  43616 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_archivecleanup\n-rwxr-xr-x  1 root wheel 161128 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_basebackup\n-rwxr-xr-x  1 root wheel  78336 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_checksums\n-rwxr-xr-x  1 root wheel  53784 Dec  3 02:06 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_config\n-rwxr-xr-x  1 root wheel  57272 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_controldata\n-rwxr-xr-x  1 root wheel 101656 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_createsubscriber\n-rwxr-xr-x  1 root wheel  72136 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_ctl\n-rwxr-xr-x  1 root wheel 422632 Dec  3 02:06 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_dump\n-rwxr-xr-x  1 root wheel 121896 Dec  3 02:06 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_dumpall\n-rwxr-xr-x  1 root wheel  67904 Dec  3 02:06 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_isready\n-rwxr-xr-x  1 root wheel 103840 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_receivewal\n-rwxr-xr-x  1 root wheel 101768 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_recvlogical\n-rwxr-xr-x  1 root wheel  68312 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_resetwal\n-rwxr-xr-x  1 root wheel 207752 Dec  3 02:06 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_restore\n-rwxr-xr-x  1 root wheel 153560 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_rewind\n-rwxr-xr-x  1 root wheel  49024 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_test_fsync\n-rwxr-xr-x  1 root wheel  39088 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_test_timing\n-rwxr-xr-x  1 root wheel 178256 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_upgrade\n-rwxr-xr-x  1 root wheel 110984 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pg_waldump\n-rwxr-xr-x  1 root wheel 207416 Dec  3 02:06 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pgbench\nroot@freebsd14:~ $ ls -al \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/po*\n-rwxr-xr-x  1 root wheel    4149 Oct 31 02:09 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pod2html\n-rwxr-xr-x  1 root wheel   15046 Oct 31 02:09 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pod2man\n-rwxr-xr-x  1 root wheel   10815 Oct 31 02:09 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pod2text\n-rwxr-xr-x  1 root wheel    4113 Oct 31 02:09 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/pod2usage\n-rwxr-xr-x  1 root wheel    3664 Oct 31 02:09 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/podchecker\n-rwxr-xr-x  1 root wheel 9548040 Dec  3 02:18 \/usr\/local\/jails\/templates\/14.1-RELEASE\/usr\/local\/bin\/postgres\n<\/pre><\/div>\n\n\n<p>In the same way we can ask pkg to operate in a chroot, we can also ask sysrc to operate in a chroot and directly enable the PostgreSQL service:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,3]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ sysrc -R \/usr\/local\/jails\/templates\/14.1-RELEASE\/ postgresql_enable=yes\npostgresql_enable:  -&gt; yes\nroot@freebsd14:~ $ cat \/usr\/local\/jails\/templates\/14.1-RELEASE\/etc\/rc.conf\npostgresql_enable=&quot;yes&quot;\n<\/pre><\/div>\n\n\n<p>Now we have everything we need and can create a new ZFS snapshot:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,2]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ zfs snapshot zroot\/jails\/templates\/14.1-RELEASE@postgresql17\nroot@freebsd14:~ $ zfs list -t snapshot\nNAME                                              USED  AVAIL  REFER  MOUNTPOINT\nzroot\/ROOT\/default@2024-11-26-10:56:43-0          394M      -  1.46G  -\nzroot\/ROOT\/default@2024-12-04-08:41:41-0         2.23M      -  2.49G  -\nzroot\/ROOT\/default@2024-12-04-08:42:46-0         1.86M      -  2.58G  -\nzroot\/jails\/templates\/14.1-RELEASE@postgresql17     0B      -  1.34G  -\n<\/pre><\/div>\n\n\n<p>Looking at the configuration for the Jail in the last post, it looks like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ cat \/etc\/jail.conf.d\/thinjail1.conf \nthinjail1 {\n  # STARTUP\/LOGGING\n  exec.start = &quot;\/bin\/sh \/etc\/rc&quot;;\n  exec.stop = &quot;\/bin\/sh \/etc\/rc.shutdown&quot;;\n  exec.consolelog = &quot;\/var\/log\/jail_console_${name}.log&quot;;\n\n  # PERMISSIONS\n  allow.raw_sockets;\n  exec.clean;\n  mount.devfs;\n\n  # HOSTNAME\/PATH\n  host.hostname = &quot;${name}&quot;;\n  path = &quot;\/usr\/local\/jails\/containers\/${name}&quot;;\n\n  # NETWORK\n  ip4.addr = 192.168.122.160;\n  interface = vtnet0;\n}\n<\/pre><\/div>\n\n\n<p>The dynamic parts in that configuration are the IP address, the path, the hostname and the name of the Jail. Everything else remains static for additional Jails. So we could create a simple script which creates a new Jail configuration based on a few parameters (there is no error handling, no sanity checks, and everything else which makes a good script a good script, this really is just for demonstration purposes):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#!\/usr\/local\/bin\/bash\n\n# The parameters for a new Jail\nJAILNAME=&quot;$1&quot;\nIPADDR=&quot;$2&quot;\n\n# This is where all the Jails go to\nBASEPATH=&quot;\/usr\/local\/jails\/containers\/&quot;\n\ncat &lt;&lt; EOF &gt; \/etc\/jail.conf.d\/${JAILNAME}.conf\n${JAILNAME} {\n  # STARTUP\/LOGGING\n  exec.start = &quot;\/bin\/sh \/etc\/rc&quot;;\n  exec.stop = &quot;\/bin\/sh \/etc\/rc.shutdown&quot;;\n  exec.consolelog = &quot;\/var\/log\/jail_console_${name}.log&quot;;\n  # PERMISSIONS\n  allow.raw_sockets;\n  allow.sysvipc = 1;\n  exec.clean;\n  mount.devfs;\n  # HOSTNAME\/PATH\n  host.hostname = &quot;${JAILNAME}.it.dbi-services.com&quot;;\n  path = &quot;${BASEPATH}\/${JAILNAME}&quot;;\n  # NETWORK\n  ip4.addr = ${IPADDR};\n  interface = vtnet0;\n}\nEOF\n\nzfs clone zroot\/jails\/templates\/14.1-RELEASE@postgresql17 zroot\/jails\/containers\/${JAILNAME}\nservice jail start ${JAILNAME}\njls\njexec -U postgres ${JAILNAME} \/usr\/local\/bin\/initdb --pgdata=\/var\/db\/postgres\/data17\njexec -l ${JAILNAME} service postgresql start\n<\/pre><\/div>\n\n\n<p>What this script is doing:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the Jail configuration based on the name and IP address<\/li>\n\n\n\n<li>Clone the ZFS snapshot we&#8217;ve created above<\/li>\n\n\n\n<li>Start the Jail<\/li>\n\n\n\n<li>Initialize PostgreSQL<\/li>\n\n\n\n<li>Start up PostgreSQL<\/li>\n<\/ul>\n\n\n\n<p>If you run that it looks like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ .\/new_jail.sh PG1 192.168.122.130\nStarting jails: PG1.\n   JID  IP Address      Hostname                      Path\n    11  192.168.122.130 PG1.it.dbi-services.com       \/usr\/local\/jails\/containers\/PG1\nThe files belonging to this database system will be owned by user &quot;postgres&quot;.\nThis user must also own the server process.\n\nThe database cluster will be initialized with locale &quot;C.UTF-8&quot;.\nThe default database encoding has accordingly been set to &quot;UTF8&quot;.\nThe default text search configuration will be set to &quot;english&quot;.\n\nData page checksums are disabled.\n\ncreating directory \/var\/db\/postgres\/data17 ... ok\ncreating subdirectories ... ok\nselecting dynamic shared memory implementation ... posix\nselecting default &quot;max_connections&quot; ... 100\nselecting default &quot;shared_buffers&quot; ... 128MB\nselecting default time zone ... Europe\/Vaduz\ncreating configuration files ... ok\nrunning bootstrap script ... ok\nperforming post-bootstrap initialization ... ok\nsyncing data to disk ... ok\n\ninitdb: warning: enabling &quot;trust&quot; authentication for local connections\ninitdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.\n\nSuccess. You can now start the database server using:\n\n    \/usr\/local\/bin\/pg_ctl -D \/var\/db\/postgres\/data17 -l logfile start\n\n2024-12-04 10:28:32.103 CET &#x5B;4809] LOG:  ending log output to stderr\n2024-12-04 10:28:32.103 CET &#x5B;4809] HINT:  Future log output will go to log destination &quot;syslog&quot;.\n<\/pre><\/div>\n\n\n<p>That&#8217;s it, PostgreSQL is up and running in the Jail:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ psql -h 192.168.122.130\npsql: error: connection to server at &quot;192.168.122.130&quot;, port 5432 failed: FATAL:  no pg_hba.conf entry for host &quot;192.168.122.130&quot;, user &quot;root&quot;, database &quot;root&quot;, no encryption\n<\/pre><\/div>\n\n\n<p>Pretty easy to do. Now additional PostgreSQL Jails can be added easily. What is really impressive is the size of the Jail on disk:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nroot@freebsd14:~ $ du -sh \/usr\/local\/jails\/containers\/PG1\n1.4G    \/usr\/local\/jails\/containers\/PG1\n<\/pre><\/div>\n\n\n<p>A bit more than a GB for a complete PostgreSQL service. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post builds on top of the previous post in which we&#8217;ve created a simple thin Jail. The goal of this post is, to put a bit of automation around this and to provide a simple PostgreSQL as a service platform. We want to do this by creating one PostgreSQL instance per Jail (without any [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,198,42],"tags":[2718,2256,46,77],"type_dbi":[3471,2749],"class_list":["post-36081","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-database-management","category-operating-systems","tag-bsd","tag-freebsd","tag-linux-unix","tag-postgresql","type-freebsd","type-postgresql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>FreeBSD basics \u2013 5 \u2013 Providing services using Jails - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FreeBSD basics \u2013 5 \u2013 Providing services using Jails\" \/>\n<meta property=\"og:description\" content=\"This post builds on top of the previous post in which we&#8217;ve created a simple thin Jail. The goal of this post is, to put a bit of automation around this and to provide a simple PostgreSQL as a service platform. We want to do this by creating one PostgreSQL instance per Jail (without any [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-05T06:46:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-05T06:46:34+00:00\" \/>\n<meta name=\"author\" content=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/\"},\"author\":{\"name\":\"Daniel Westermann\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"headline\":\"FreeBSD basics \u2013 5 \u2013 Providing services using Jails\",\"datePublished\":\"2024-12-05T06:46:31+00:00\",\"dateModified\":\"2024-12-05T06:46:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/\"},\"wordCount\":399,\"commentCount\":0,\"keywords\":[\"BSD\",\"FreeBSD\",\"Linux\/UNIX\",\"PostgreSQL\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Database management\",\"Operating systems\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/\",\"name\":\"FreeBSD basics \u2013 5 \u2013 Providing services using Jails - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2024-12-05T06:46:31+00:00\",\"dateModified\":\"2024-12-05T06:46:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FreeBSD basics \u2013 5 \u2013 Providing services using Jails\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\/\/x.com\/westermanndanie\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"FreeBSD basics \u2013 5 \u2013 Providing services using Jails - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/","og_locale":"en_US","og_type":"article","og_title":"FreeBSD basics \u2013 5 \u2013 Providing services using Jails","og_description":"This post builds on top of the previous post in which we&#8217;ve created a simple thin Jail. The goal of this post is, to put a bit of automation around this and to provide a simple PostgreSQL as a service platform. We want to do this by creating one PostgreSQL instance per Jail (without any [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/","og_site_name":"dbi Blog","article_published_time":"2024-12-05T06:46:31+00:00","article_modified_time":"2024-12-05T06:46:34+00:00","author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/"},"author":{"name":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"headline":"FreeBSD basics \u2013 5 \u2013 Providing services using Jails","datePublished":"2024-12-05T06:46:31+00:00","dateModified":"2024-12-05T06:46:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/"},"wordCount":399,"commentCount":0,"keywords":["BSD","FreeBSD","Linux\/UNIX","PostgreSQL"],"articleSection":["Database Administration &amp; Monitoring","Database management","Operating systems"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/","url":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/","name":"FreeBSD basics \u2013 5 \u2013 Providing services using Jails - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2024-12-05T06:46:31+00:00","dateModified":"2024-12-05T06:46:34+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/freebsd-basics-5-providing-services-using-jails\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"FreeBSD basics \u2013 5 \u2013 Providing services using Jails"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/36081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=36081"}],"version-history":[{"count":21,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/36081\/revisions"}],"predecessor-version":[{"id":36129,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/36081\/revisions\/36129"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=36081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=36081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=36081"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=36081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}