<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://beardedmaker.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Run_a_Script_on_Startup_or_Shutdown</id>
		<title>Run a Script on Startup or Shutdown - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://beardedmaker.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Run_a_Script_on_Startup_or_Shutdown"/>
		<link rel="alternate" type="text/html" href="https://beardedmaker.com/wiki/index.php?title=Run_a_Script_on_Startup_or_Shutdown&amp;action=history"/>
		<updated>2026-04-21T20:47:07Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.4</generator>

	<entry>
		<id>https://beardedmaker.com/wiki/index.php?title=Run_a_Script_on_Startup_or_Shutdown&amp;diff=2815&amp;oldid=prev</id>
		<title>Beard at 05:58, 8 August 2018</title>
		<link rel="alternate" type="text/html" href="https://beardedmaker.com/wiki/index.php?title=Run_a_Script_on_Startup_or_Shutdown&amp;diff=2815&amp;oldid=prev"/>
				<updated>2018-08-08T05:58:05Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;redbox&amp;quot;&amp;gt;&lt;br /&gt;
Unfinished page...&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page describes how to set up a script to run on system startup or shutdown on a Linux system. I will not describe how to configure &amp;quot;Startup Applications&amp;quot; through the user preferences menu, as those settings are user-specific and only run on user login. This tutorial is more for advanced users and will allow you to run a script before, during, or after the startup/shutdown process. This is useful when you need to run things in a particular order or when you need the startup/shutdown process to wait for your script to finish.&lt;br /&gt;
&lt;br /&gt;
The setup will differ depending on if your system uses classic System V Init (SysV), Upstart, or Systemd.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;How do I know what my system uses?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo stat /proc/1/exe | head -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;output&amp;quot;&amp;gt;&lt;br /&gt;
File: '/proc/1/exe' -&amp;gt; '/lib/systemd/systemd'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; directory contains process information, and &amp;lt;code&amp;gt;/proc/1&amp;lt;/code&amp;gt; is the process running with PID 1. Init always runs with PID 1. The &amp;lt;code&amp;gt;exe&amp;lt;/code&amp;gt; file is a symlink to the executable that is running. This indicates what init your system uses. In this example, my system uses systemd. If the result shows &amp;lt;code&amp;gt;'/sbin/init'&amp;lt;/code&amp;gt; you may still need to investigate what that file is linked to, because it may not be the true SysV init :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo stat /sbin/init | head -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;output&amp;quot;&amp;gt;&lt;br /&gt;
File: '/sbin/init' -&amp;gt; '/lib/systemd/systemd'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= System V =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Upstart =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Systemd =&lt;/div&gt;</summary>
		<author><name>Beard</name></author>	</entry>

	</feed>