{"id":401,"date":"2021-10-12T08:24:24","date_gmt":"2021-10-12T14:24:24","guid":{"rendered":"http:\/\/www.scottharvanek.com\/?p=401"},"modified":"2022-03-10T09:07:11","modified_gmt":"2022-03-10T15:07:11","slug":"oxidized-container-via-podman","status":"publish","type":"post","link":"https:\/\/www.scottharvanek.com\/?p=401","title":{"rendered":"Oxidized Container via Podman"},"content":{"rendered":"\n<p>I hadn&#8217;t really dived into familiarizing myself with <a href=\"https:\/\/podman.io\">Podman<\/a> however, it does offer some really unique advantages over say <a href=\"https:\/\/www.docker.com\">Docker<\/a>.  Firstly, Docker requires that you run a daemon to manage your containers whilst Podman can start individual containers at boot via systemd.  This is a huge benefit and so it looks like I&#8217;ll be moving most of my Docker containers over to Podman management.  Podman is very easy to understand since&#8230; if you understand Docker, you understand Podman, the commands are even the same.<\/p>\n\n\n\n<p>So on to <a href=\"https:\/\/hub.docker.com\/r\/oxidized\/oxidized\/\">Oxidized<\/a> which is a RANCID replacement ( thank god ).  It has a great community around it and support for lots and lots of different device types and works great with Gitlab.<\/p>\n\n\n\n<p>So the important part for me was to get the systemd script setup for Oxidized, and here&#8217;s what that looks like;<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-gray-background-color has-background\"><code>more \/etc\/systemd\/system\/oxidized.service \n&#91;Unit]\nDescription=Podman container-oxidized.service\nDocumentation=man:podman-generate-systemd(1)\nWants=network.target\nAfter=network-online.target\n\n&#91;Service]\nRestart=on-failure\nExecStart=\/usr\/bin\/podman start oxidized\nExecStop=\/usr\/bin\/podman stop -t 10 oxidized\nExecStopPost=\/bin\/rm -rf \/etc\/oxidized\/pid\nKillMode=none\nType=forking\nPIDFile=\/var\/run\/containers\/storage\/overlay-containers\/...\/userdata\/conmon.pid\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>The command to initially generate this was;<\/p>\n\n\n\n<p><code>podman generate systemd --name oxidized<\/code><\/p>\n\n\n\n<p>However we have to enable Podman to also remove the .pid from Oxidized as sometimes that is not cleanly resolved so that is why;<\/p>\n\n\n\n<p><code>ExecStopPost=\/bin\/rm -rf \/etc\/oxidized\/pid <\/code><\/p>\n\n\n\n<p>Has been added, finally save this file to say; <\/p>\n\n\n\n<p><code>\/etc\/systemd\/system\/oxidized.service<\/code><\/p>\n\n\n\n<p>And enable\/start it via systemctl;<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-gray-background-color has-background\"><code>systemctl daemon-reload\nsystemctl enable oxidized\nsystemctl start oxidized<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I hadn&#8217;t really dived into familiarizing myself with Podman however, it does offer some really unique advantages over say Docker. Firstly, Docker requires that you run a daemon to manage your containers whilst Podman can start individual containers at boot &hellip; <a href=\"https:\/\/www.scottharvanek.com\/?p=401\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-401","post","type-post","status-publish","format-standard","hentry","category-opensource"],"_links":{"self":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts\/401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=401"}],"version-history":[{"count":3,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions"}],"predecessor-version":[{"id":430,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions\/430"}],"wp:attachment":[{"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scottharvanek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}