chiark / gitweb /
bootchart: Ensure that systemd is the init called after using bootchart
authorSebastien Bacher <seb128@ubuntu.com>
Mon, 2 Feb 2015 14:48:40 +0000 (15:48 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 2 Feb 2015 16:40:35 +0000 (17:40 +0100)
When booting with systemd-bootchart, default to call the systemd binary
rather than the init binary on disk, which might be another init system.
Collecting data only works with booting systemd.

man/bootchart.conf.xml
man/systemd-bootchart.xml
src/bootchart/bootchart.c

index a364826..e11ccb5 100644 (file)
                         <varlistentry>
                                 <term><varname>Init=[path]</varname></term>
                                 <listitem><para>Configures bootchart to run a non-standard
-                                binary instead of <filename>/sbin/init</filename>. This
+                                binary instead of <filename>/usr/lib/systemd/systemd</filename>. This
                                 option is only relevant if bootchart was invoked from the
                                 kernel command line with
                                 init=/usr/lib/systemd/systemd-bootchart.</para></listitem>
index 0068e92..ff86be2 100644 (file)
                                 <command>systemd-bootchart</command>
                                 instead of the init process. In turn,
                                 <command>systemd-bootchart</command>
-                                will invoke <command>/sbin/init</command>.
+                                will invoke <command>/usr/lib/systemd/systemd</command>.
                                 </para></listitem>
                         </varlistentry>
 
                                 <term><option>-i</option></term>
                                 <term><option>--init <replaceable>path</replaceable></option></term>
                                 <listitem><para>Use this init binary. Defaults to
-                                <command>/sbin/init</command>.
+                                <command>/usr/lib/systemd/systemd</command>.
                                 </para></listitem>
                         </varlistentry>
 
index 0808ba4..b49e2c9 100644 (file)
@@ -76,7 +76,7 @@ int sysfd=-1;
 #define DEFAULT_HZ 25.0
 #define DEFAULT_SCALE_X 100.0 /* 100px = 1sec */
 #define DEFAULT_SCALE_Y 20.0  /* 16px = 1 process bar */
-#define DEFAULT_INIT "/sbin/init"
+#define DEFAULT_INIT ROOTLIBDIR "/systemd/systemd"
 #define DEFAULT_OUTPUT "/run/log"
 
 /* graph defaults */
@@ -326,7 +326,7 @@ int main(int argc, char *argv[]) {
         /*
          * If the kernel executed us through init=/usr/lib/systemd/systemd-bootchart, then
          * fork:
-         * - parent execs executable specified via init_path[] (/sbin/init by default) as pid=1
+         * - parent execs executable specified via init_path[] (/usr/lib/systemd/systemd by default) as pid=1
          * - child logs data
          */
         if (getpid() == 1) {