<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://guides.hackclub.app/index.php?action=history&amp;feed=atom&amp;title=Systemd</id>
	<title>Systemd - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://guides.hackclub.app/index.php?action=history&amp;feed=atom&amp;title=Systemd"/>
	<link rel="alternate" type="text/html" href="https://guides.hackclub.app/index.php?title=Systemd&amp;action=history"/>
	<updated>2026-06-29T19:37:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://guides.hackclub.app/index.php?title=Systemd&amp;diff=97&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;The (generally) best way to run your apps 24/7 in the background on nest is through the use of systemd. It runs as PID 1 and is the first thing that starts in any nest container. For more information check out https://wiki.archlinux.org/title/Systemd (one of the best systemd docs in my opinion). === Tutorial === We are going to run your project as a systemd service, which are usually located in &lt;code&gt;/etc/systemd/system/&lt;name&gt;.service&lt;/code&gt;. To create/edit this, file yo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://guides.hackclub.app/index.php?title=Systemd&amp;diff=97&amp;oldid=prev"/>
		<updated>2026-06-28T14:18:24Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The (generally) best way to run your apps 24/7 in the background on nest is through the use of systemd. It runs as PID 1 and is the first thing that starts in any nest container. For more information check out https://wiki.archlinux.org/title/Systemd (one of the best systemd docs in my opinion). === Tutorial === We are going to run your project as a systemd service, which are usually located in &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;name&amp;gt;.service&amp;lt;/code&amp;gt;. To create/edit this, file yo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The (generally) best way to run your apps 24/7 in the background on nest is through the use of systemd. It runs as PID 1 and is the first thing that starts in any nest container. For more information check out https://wiki.archlinux.org/title/Systemd (one of the best systemd docs in my opinion).&lt;br /&gt;
=== Tutorial ===&lt;br /&gt;
We are going to run your project as a systemd service, which are usually located in &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;name&amp;gt;.service&amp;lt;/code&amp;gt;. To create/edit this, file you can either use &amp;lt;code&amp;gt;nano /etc/systemd/system/&amp;lt;name&amp;gt;.service&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;systemctl edit --full --force &amp;lt;name&amp;gt;.service&amp;lt;/code&amp;gt;. For this guide we will use the latter. If you use nano, you will also need to run &amp;lt;code&amp;gt;systemctl daemon-reload&amp;lt;/code&amp;gt; after.&lt;br /&gt;
&lt;br /&gt;
# Find out how you are running your project &amp;#039;&amp;#039;&amp;#039;exactly&amp;#039;&amp;#039;&amp;#039;. If you are running with node, run &amp;lt;code&amp;gt;which node&amp;lt;/code&amp;gt; and note down the full path you get (for example &amp;lt;code&amp;gt;/usr/local/bin/node&amp;lt;/code&amp;gt;). For anything else it&amp;#039;s the same, just run &amp;lt;code&amp;gt;which python/bun/etc&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Create a new systemctl service with &amp;lt;code&amp;gt;systemctl edit --full --force &amp;lt;name&amp;gt;.service&amp;lt;/code&amp;gt;, make sure name is unique and represents your project (for example: &amp;quot;cool-slack-bot&amp;quot; is good, python is bad). Example: &amp;lt;code&amp;gt;systemctl edit --full --force cool-slack-bot.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Paste this file, and edit it to match your project:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;systemd&amp;quot;&amp;gt;[Unit]&lt;br /&gt;
Description=Cool Slack Bot&lt;br /&gt;
Wants=network-online.target&lt;br /&gt;
After=network-online.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# If you are not using node, replace /usr/local/bin/node&lt;br /&gt;
# Also make sure to replace &amp;lt;project&amp;gt;, and index.js if necessary&lt;br /&gt;
ExecStart=/usr/local/bin/node /root/&amp;lt;project&amp;gt;/index.js&lt;br /&gt;
# Make sure to replace &amp;lt;project&amp;gt;&lt;br /&gt;
WorkingDirectory=/root/&amp;lt;project&amp;gt;&lt;br /&gt;
Restart=always&lt;br /&gt;
RestartSec=5&lt;br /&gt;
# Uncomment this if you have a .env file, change the path if needed:&lt;br /&gt;
# EnvironmentFile=/root/&amp;lt;project&amp;gt;/.env&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Enable and start your project using &amp;lt;code&amp;gt;systemctl enable &amp;lt;name&amp;gt;.service --now&amp;lt;/code&amp;gt;, then check if it&amp;#039;s running with &amp;lt;code&amp;gt;systemctl status &amp;lt;name&amp;gt;.service&amp;lt;/code&amp;gt;.&lt;br /&gt;
# If you need to view the latest logs for the service, use &amp;lt;code&amp;gt;journalctl -eu &amp;lt;name&amp;gt;&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>