{"id":524,"date":"2026-01-07T22:14:45","date_gmt":"2026-01-07T22:14:45","guid":{"rendered":"https:\/\/lab2prod.net\/?p=524"},"modified":"2026-01-07T22:27:53","modified_gmt":"2026-01-07T22:27:53","slug":"writing-my-first-linux-service","status":"publish","type":"post","link":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/","title":{"rendered":"Building my first Linux Service"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Today I decided why not try to improve upon my last post where I created two scripts. One script for starting 3 game servers, the second script to check the status of said servers. After much consideration on how to make this process even more efficient I decided to build 3 services instead. Eliminating cronjobs and extra scripts laying around in my directories. With this method I can run a service file instead that runs even on reboot with no extra configuration. Then, utilize my checkall script after modifying it a bit to serve the same function it did before. Here are some clips of building &amp; debugging the service, to real-time server testing! I only preview 1 server service in these videos but I have built services for all 3 already which work great.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1080 \/ 1080;\" width=\"1080\" autoplay controls loop muted src=\"https:\/\/lab2prod.net\/wp-content\/uploads\/2026\/01\/buildingaservicefinal.mp4\" playsinline><\/video><figcaption class=\"wp-element-caption\">Building a service<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1920 \/ 1080;\" width=\"1920\" controls src=\"https:\/\/lab2prod.net\/wp-content\/uploads\/2026\/01\/servertest.mp4\"><\/video><figcaption class=\"wp-element-caption\">Testing the server after reboot<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Today I decided why not try to improve upon my last post where I created two scripts. One script for starting 3 game servers, the second script to check the status of said servers. After much consideration on how to make this process even more efficient I decided to build 3 services instead. Eliminating cronjobs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[14,19,31,30,32,9,16,33,35,34,20],"class_list":["post-524","post","type-post","status-publish","format-standard","hentry","category-blog","tag-bash","tag-beammp","tag-blog","tag-building","tag-gaming","tag-lab2prod","tag-linux","tag-linux-service","tag-scripting","tag-scripts","tag-servers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building my first Linux Service - lab2prod<\/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:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building my first Linux Service - lab2prod\" \/>\n<meta property=\"og:description\" content=\"Today I decided why not try to improve upon my last post where I created two scripts. One script for starting 3 game servers, the second script to check the status of said servers. After much consideration on how to make this process even more efficient I decided to build 3 services instead. Eliminating cronjobs [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/\" \/>\n<meta property=\"og:site_name\" content=\"lab2prod\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-07T22:14:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-07T22:27:53+00:00\" \/>\n<meta name=\"author\" content=\"Dylan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dylan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/\"},\"author\":{\"name\":\"Dylan\",\"@id\":\"https:\\\/\\\/lab2prod.net\\\/#\\\/schema\\\/person\\\/c8ce717b9ac2e1088846b6583e10ade7\"},\"headline\":\"Building my first Linux Service\",\"datePublished\":\"2026-01-07T22:14:45+00:00\",\"dateModified\":\"2026-01-07T22:27:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/\"},\"wordCount\":144,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/lab2prod.net\\\/#\\\/schema\\\/person\\\/c8ce717b9ac2e1088846b6583e10ade7\"},\"keywords\":[\"bash\",\"beammp\",\"blog\",\"building\",\"gaming\",\"lab2prod\",\"linux\",\"linux service\",\"scripting\",\"scripts\",\"servers\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/\",\"url\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/\",\"name\":\"Building my first Linux Service - lab2prod\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lab2prod.net\\\/#website\"},\"datePublished\":\"2026-01-07T22:14:45+00:00\",\"dateModified\":\"2026-01-07T22:27:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/2026\\\/01\\\/07\\\/writing-my-first-linux-service\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/lab2prod.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building my first Linux Service\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/lab2prod.net\\\/#website\",\"url\":\"https:\\\/\\\/lab2prod.net\\\/\",\"name\":\"lab2prodnet\",\"description\":\"An idiot admires complexity, a genius admires simplicity.. - Terrence Andrew Davis\",\"publisher\":{\"@id\":\"https:\\\/\\\/lab2prod.net\\\/#\\\/schema\\\/person\\\/c8ce717b9ac2e1088846b6583e10ade7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/lab2prod.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/lab2prod.net\\\/#\\\/schema\\\/person\\\/c8ce717b9ac2e1088846b6583e10ade7\",\"name\":\"Dylan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/lab2prod.net\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/weblogo-1.jpeg\",\"url\":\"https:\\\/\\\/lab2prod.net\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/weblogo-1.jpeg\",\"contentUrl\":\"https:\\\/\\\/lab2prod.net\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/weblogo-1.jpeg\",\"width\":960,\"height\":700,\"caption\":\"Dylan\"},\"logo\":{\"@id\":\"https:\\\/\\\/lab2prod.net\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/weblogo-1.jpeg\"},\"sameAs\":[\"http:\\\/\\\/lab2prod.net\"],\"url\":\"https:\\\/\\\/lab2prod.net\\\/index.php\\\/author\\\/webadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building my first Linux Service - lab2prod","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:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/","og_locale":"en_US","og_type":"article","og_title":"Building my first Linux Service - lab2prod","og_description":"Today I decided why not try to improve upon my last post where I created two scripts. One script for starting 3 game servers, the second script to check the status of said servers. After much consideration on how to make this process even more efficient I decided to build 3 services instead. Eliminating cronjobs [&hellip;]","og_url":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/","og_site_name":"lab2prod","article_published_time":"2026-01-07T22:14:45+00:00","article_modified_time":"2026-01-07T22:27:53+00:00","author":"Dylan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dylan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/#article","isPartOf":{"@id":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/"},"author":{"name":"Dylan","@id":"https:\/\/lab2prod.net\/#\/schema\/person\/c8ce717b9ac2e1088846b6583e10ade7"},"headline":"Building my first Linux Service","datePublished":"2026-01-07T22:14:45+00:00","dateModified":"2026-01-07T22:27:53+00:00","mainEntityOfPage":{"@id":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/"},"wordCount":144,"commentCount":0,"publisher":{"@id":"https:\/\/lab2prod.net\/#\/schema\/person\/c8ce717b9ac2e1088846b6583e10ade7"},"keywords":["bash","beammp","blog","building","gaming","lab2prod","linux","linux service","scripting","scripts","servers"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/","url":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/","name":"Building my first Linux Service - lab2prod","isPartOf":{"@id":"https:\/\/lab2prod.net\/#website"},"datePublished":"2026-01-07T22:14:45+00:00","dateModified":"2026-01-07T22:27:53+00:00","breadcrumb":{"@id":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/lab2prod.net\/index.php\/2026\/01\/07\/writing-my-first-linux-service\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lab2prod.net\/"},{"@type":"ListItem","position":2,"name":"Building my first Linux Service"}]},{"@type":"WebSite","@id":"https:\/\/lab2prod.net\/#website","url":"https:\/\/lab2prod.net\/","name":"lab2prodnet","description":"An idiot admires complexity, a genius admires simplicity.. - Terrence Andrew Davis","publisher":{"@id":"https:\/\/lab2prod.net\/#\/schema\/person\/c8ce717b9ac2e1088846b6583e10ade7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lab2prod.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/lab2prod.net\/#\/schema\/person\/c8ce717b9ac2e1088846b6583e10ade7","name":"Dylan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lab2prod.net\/wp-content\/uploads\/2025\/10\/weblogo-1.jpeg","url":"https:\/\/lab2prod.net\/wp-content\/uploads\/2025\/10\/weblogo-1.jpeg","contentUrl":"https:\/\/lab2prod.net\/wp-content\/uploads\/2025\/10\/weblogo-1.jpeg","width":960,"height":700,"caption":"Dylan"},"logo":{"@id":"https:\/\/lab2prod.net\/wp-content\/uploads\/2025\/10\/weblogo-1.jpeg"},"sameAs":["http:\/\/lab2prod.net"],"url":"https:\/\/lab2prod.net\/index.php\/author\/webadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/posts\/524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/comments?post=524"}],"version-history":[{"count":3,"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/posts\/524\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/posts\/524\/revisions\/529"}],"wp:attachment":[{"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/media?parent=524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/categories?post=524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab2prod.net\/index.php\/wp-json\/wp\/v2\/tags?post=524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}