]> pere.pagekite.me Git - homepage.git/commitdiff
New entry.
authorPetter Reinholdtsen <pere@hungry.com>
Sun, 6 Jun 2010 21:59:38 +0000 (21:59 +0000)
committerPetter Reinholdtsen <pere@hungry.com>
Sun, 6 Jun 2010 21:59:38 +0000 (21:59 +0000)
blog/data/2010-06-06-upstart.txt [new file with mode: 0644]

diff --git a/blog/data/2010-06-06-upstart.txt b/blog/data/2010-06-06-upstart.txt
new file mode 100644 (file)
index 0000000..eb12f3b
--- /dev/null
@@ -0,0 +1,44 @@
+Title: Upstart or sysvinit - as init.d scripts see it
+Tags: english, debian, debian edu
+Date: 2010-06-06 23:55
+
+<p>If Debian is to migrate to upstart on Linux, I expect some init.d
+scripts to migrate (some of) their operations to upstart, and will
+need a way to behave differently when used with sysvinit and with
+upstart.  Because of this, I had a look at the environment variables
+set when a init.d script is running under upstart, and when it is
+not.</p>
+
+<p>With upstart, I notice these environment variables are set like
+this for a script started from rcS.d/ (ignoring some irrelevant
+ones):</p>
+
+<blockquote><pre>
+DEFAULT_RUNLEVEL=2
+previous=N
+PREVLEVEL=
+RUNLEVEL=
+runlevel=S
+UPSTART_EVENTS=startup
+UPSTART_INSTANCE=
+UPSTART_JOB=rc-sysinit
+</pre></blockquote>
+
+<p>With sysvinit, these environment variables are set for the same
+script.</p>
+
+<blockquote><pre>
+INIT_VERSION=sysvinit-2.88
+previous=N
+PREVLEVEL=N
+RUNLEVEL=S
+runlevel=S
+</pre></blockquote>
+
+<p>The RUNLEVEL and PREVLEVEL environment variables passed on from
+sysvinit is not set by upstart.  Not sure if it is intentional or not
+to not be compatible with sysvinit in this regard.</p>
+
+<p>For scripts needing to behave differently when upstart is used,
+looking for the UPSTART_JOB environment variable seem to be a good
+choice.</p>