<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Restarting MM² when config.js file changes]]></title><description><![CDATA[<p dir="auto">This has been helpful for me, but I didn’t see it mentioned anywhere, so I thought I’d share.  For anyone looking for a simple way to automatically restart your MM² when you change the <code>config.js</code> file:</p>
<p dir="auto"><em>Note:</em> This assumes you are using <code>pm2</code> to start the server, as described here: <a href="https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror" target="_blank" rel="noopener noreferrer nofollow ugc">Auto Starting MagicMirror</a></p>
<ol>
<li>Create a file in the same location as your <code>mm.sh</code> script called <code>mm.json</code>.</li>
<li>Paste the contents of <a href="https://gist.github.com/shbatm/62f769bca0e0d6b48d86f722561e8de1" target="_blank" rel="noopener noreferrer nofollow ugc">this gist</a> into the file (adjust if needed for your setup).</li>
<li>Run <code>pm2 stop mm &amp;&amp; pm2 delete mm</code> to stop &amp; remove the current mm script.</li>
<li>Run <code>pm2 start mm.json</code> to restart MM.  Now any time you change <code>config.js</code>, <code>pm2</code> will automatically restart the process.</li>
<li>Run <code>pm2 save</code> to save your changes for the next reboot.</li>
</ol>
<p dir="auto"><strong>That’s it!</strong></p>
<p dir="auto">Originally inspired by: <a href="/topic/1455/restart-mirror">Restart Mirror?</a></p>
]]></description><link>https://forum.magicmirror.builders/topic/4422/restarting-mm-when-config-js-file-changes</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 07:26:53 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/4422.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Jul 2017 19:57:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Restarting MM² when config.js file changes on Sun, 22 Jan 2023 18:53:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/looolz" aria-label="Profile: looolz">@<bdi>looolz</bdi></a> my install script sets up to monitor config.js.    does sometimes…</p>
]]></description><link>https://forum.magicmirror.builders/post/107481</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/107481</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sun, 22 Jan 2023 18:53:15 GMT</pubDate></item><item><title><![CDATA[Reply to Restarting MM² when config.js file changes on Sun, 22 Jan 2023 18:23:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/shbatm" aria-label="Profile: shbatm">@<bdi>shbatm</bdi></a> Just want to tell you that I’ve googled this thread every single time I’ve setup a new mirror from scratch, and still love it. Thanks for making a post almost 6 years ago that still has all the info and works!</p>
]]></description><link>https://forum.magicmirror.builders/post/107479</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/107479</guid><dc:creator><![CDATA[looolz]]></dc:creator><pubDate>Sun, 22 Jan 2023 18:23:00 GMT</pubDate></item><item><title><![CDATA[Reply to Restarting MM² when config.js file changes on Mon, 26 Nov 2018 16:46:30 GMT]]></title><description><![CDATA[<p dir="auto">Wow. Cool idea.</p>
]]></description><link>https://forum.magicmirror.builders/post/47362</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/47362</guid><dc:creator><![CDATA[BKeyport]]></dc:creator><pubDate>Mon, 26 Nov 2018 16:46:30 GMT</pubDate></item><item><title><![CDATA[Reply to Restarting MM² when config.js file changes on Wed, 28 Nov 2018 13:39:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello !</p>
<p dir="auto">I’ve followed your tutorial and it seems to work. For example my MM starts on boot.<br />
But when my MM is open, if I press Alt+tab to open and modify my config.js file, nothing is happening (it is not restarting).<br />
I don’t know why, do you have any idea ?</p>
<p dir="auto">Thank you !</p>
<p dir="auto">Edit: After a reboot, this is working ! Ty<br />
Edit2: There is a way to not completly rebooting it ? I mean doing the same thing as pressing CTRL + R, so the mirror reboots but stays on a black screen (instead of going back on the Desktop)<br />
Edit3: If I do “pm2 stop mm.json” to stop the process and then start it again doing “pm2 start mm.json” then If I modify the config file, this is not working anymore</p>
]]></description><link>https://forum.magicmirror.builders/post/47361</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/47361</guid><dc:creator><![CDATA[William]]></dc:creator><pubDate>Wed, 28 Nov 2018 13:39:14 GMT</pubDate></item><item><title><![CDATA[Reply to Restarting MM² when config.js file changes on Sun, 09 Jul 2017 19:57:39 GMT]]></title><description><![CDATA[<p dir="auto">For those that do a lot of testing, something I’ve found very useful as well: extract the <code>config.js</code> file out into it’s own git repo; then just switch between branches when you want to test something, that way you don’t break your “main” config file.</p>
<pre><code class="language-shell">cd ~
mkdir mmConfig
cd mmConfig
git init
mv ~/MagicMirror/config/config.js ./config.js
ln -s /home/pi/mmConfig/config.js /home/pi/MagicMirror/config/config.js
git commit -am "Initial Commit"
git checkout -b testing
# Change and test config.js without fear of breaking it!
# Use checkout -f master to switch back to your main branch
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/25130</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25130</guid><dc:creator><![CDATA[shbatm]]></dc:creator><pubDate>Sun, 09 Jul 2017 19:57:39 GMT</pubDate></item></channel></rss>