Re: [systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Lennart Poettering
On Mon, 02.02.15 17:03, Sebastien Bacher (seb...@ubuntu.com) wrote:

> Thanks Martin, I did the changes you suggested, new patch attached
> 
> Cheers,
> Sebastien Bacher

Thanks, applied!

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Sebastien Bacher
Thanks Martin, I did the changes you suggested, new patch attached

Cheers,
Sebastien Bacher

Le 02/02/2015 16:32, Martin Pitt a écrit :
> Since ./configure allows you to specify paths independent from
> --enable-split-usr, IMHO it is more robust to do
>
>   #define DEFAULT_INIT ROOTLIBDIR "/systemd/systemd"

>From af6f3318bcad9b8c1109747b5d9f5ebed963397f Mon Sep 17 00:00:00 2001
From: Sebastien Bacher 
Date: Mon, 2 Feb 2015 15:48:40 +0100
Subject: [PATCH] Ensure that systemd is the init called after using bootchart

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| 2 +-
 man/systemd-bootchart.xml | 4 ++--
 src/bootchart/bootchart.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/man/bootchart.conf.xml b/man/bootchart.conf.xml
index a364826..e11ccb5 100644
--- a/man/bootchart.conf.xml
+++ b/man/bootchart.conf.xml
@@ -124,7 +124,7 @@
 
 Init=[path]
 Configures bootchart to run a non-standard
-binary instead of /sbin/init. This
+binary instead of /usr/lib/systemd/systemd. This
 option is only relevant if bootchart was invoked from the
 kernel command line with
 init=/usr/lib/systemd/systemd-bootchart.
diff --git a/man/systemd-bootchart.xml b/man/systemd-bootchart.xml
index 0068e92..ff86be2 100644
--- a/man/systemd-bootchart.xml
+++ b/man/systemd-bootchart.xml
@@ -116,7 +116,7 @@
 systemd-bootchart
 instead of the init process. In turn,
 systemd-bootchart
-will invoke /sbin/init.
+will invoke /usr/lib/systemd/systemd.
 
 
 
@@ -218,7 +218,7 @@
 -i
 --init path
 Use this init binary. Defaults to
-/sbin/init.
+/usr/lib/systemd/systemd.
 
 
 
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 0808ba4..b49e2c9 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -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) {
-- 
2.1.4

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Lennart Poettering
On Mon, 02.02.15 16:14, Sebastien Bacher (seb...@ubuntu.com) wrote:

> Hey systemd hackers,
> 
> While trying systemd-bootchart on my Ubuntu vivid system I ran into some
> issues. My system has upstart as /sbin/init, but I use
> init=/lib/systemd/systemd and that works fine. Today I tried to change
> that to /lib/systemd/systemd-bootchart but the charting failed on a
> missing /run/log. Turns out that it's because systemd-bootchart runs
> /sbin/init by default, would it make sense to run the systemd binary
> instead? I'm attaching a patch that does that

Generally makes sense. The canonical path for systemd is
/usr/lib/systemd/systemd, hence we should invoke that.

That siad, please make the change Martin suggested in the other mail
and reuse ROOTLIBDIR. Looks good otherwise.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Martin Pitt
"Jóhann B. Guðmundsson" [2015-02-02 15:35 +]:
> systemd-bootchart is integrated and intended to be used with systemd as the
> default init system

Right, that's exactly the point of this patch, isn't it?

> people should use alternative bootcharts to use with their alternative init
> system

For sure. The intent here was to get a systemd bootchart, not
bootchart the upstart boot.

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Jóhann B. Guðmundsson


On 02/02/2015 03:32 PM, Dimitri John Ledkov wrote:

On 2 February 2015 at 15:14, Sebastien Bacher  wrote:

Hey systemd hackers,

While trying systemd-bootchart on my Ubuntu vivid system I ran into some
issues. My system has upstart as /sbin/init, but I use
init=/lib/systemd/systemd and that works fine. Today I tried to change
that to /lib/systemd/systemd-bootchart but the charting failed on a
missing /run/log. Turns out that it's because systemd-bootchart runs
/sbin/init by default, would it make sense to run the systemd binary
instead? I'm attaching a patch that does that


+1 from me. Not because of upstart, but becuase I see people hacking
in /sbin/init symlink just because of bootchart.

Alternatively one can set Init option in the bootchart.conf file, but
defaulting to systemd install location is better imho.




systemd-bootchart is integrated and intended to be used with systemd as 
the default init system


people should use alternative bootcharts to use with their alternative 
init system


JBG
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Dimitri John Ledkov
On 2 February 2015 at 15:14, Sebastien Bacher  wrote:
> Hey systemd hackers,
>
> While trying systemd-bootchart on my Ubuntu vivid system I ran into some
> issues. My system has upstart as /sbin/init, but I use
> init=/lib/systemd/systemd and that works fine. Today I tried to change
> that to /lib/systemd/systemd-bootchart but the charting failed on a
> missing /run/log. Turns out that it's because systemd-bootchart runs
> /sbin/init by default, would it make sense to run the systemd binary
> instead? I'm attaching a patch that does that
>

+1 from me. Not because of upstart, but becuase I see people hacking
in /sbin/init symlink just because of bootchart.

Alternatively one can set Init option in the bootchart.conf file, but
defaulting to systemd install location is better imho.


-- 
Regards,

Dimitri.

Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Martin Pitt
Ça va Sebastien,

Sebastien Bacher [2015-02-02 16:14 +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 doesn't work out of systemd.

I'm not a native speaker either, but "out of systemd" sounds strange.
"only works with booting systemd."?

> -#define DEFAULT_INIT "/sbin/init"
> +#ifdef HAVE_SPLIT_USR
> +#define DEFAULT_INIT "/lib/systemd/systemd"
> +#else
> +#define DEFAULT_INIT "/usr/lib/systemd/systemd"
> +#endif

Since ./configure allows you to specify paths independent from
--enable-split-usr, IMHO it is more robust to do

  #define DEFAULT_INIT ROOTLIBDIR "/systemd/systemd"

The idea sounds sane in general, though. Specifying
init=/usr/lib/systemd/systemd-bootchart is pretty explicit about which
init system one wants.

Merci,

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Ensure that systemd is the init called after using bootchart

2015-02-02 Thread Sebastien Bacher
Hey systemd hackers,

While trying systemd-bootchart on my Ubuntu vivid system I ran into some
issues. My system has upstart as /sbin/init, but I use
init=/lib/systemd/systemd and that works fine. Today I tried to change
that to /lib/systemd/systemd-bootchart but the charting failed on a
missing /run/log. Turns out that it's because systemd-bootchart runs
/sbin/init by default, would it make sense to run the systemd binary
instead? I'm attaching a patch that does that

Cheers,
Sebastien Bacher
>From 60783beb0cad6dc55be8591b8648e00a38fe9210 Mon Sep 17 00:00:00 2001
From: Sebastien Bacher 
Date: Mon, 2 Feb 2015 15:48:40 +0100
Subject: [PATCH] Ensure that systemd is the init called after using bootchart

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 doesn't work out of systemd.
---
 man/bootchart.conf.xml| 2 +-
 man/systemd-bootchart.xml | 4 ++--
 src/bootchart/bootchart.c | 8 ++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/man/bootchart.conf.xml b/man/bootchart.conf.xml
index a364826..e11ccb5 100644
--- a/man/bootchart.conf.xml
+++ b/man/bootchart.conf.xml
@@ -124,7 +124,7 @@
 
 Init=[path]
 Configures bootchart to run a non-standard
-binary instead of /sbin/init. This
+binary instead of /usr/lib/systemd/systemd. This
 option is only relevant if bootchart was invoked from the
 kernel command line with
 init=/usr/lib/systemd/systemd-bootchart.
diff --git a/man/systemd-bootchart.xml b/man/systemd-bootchart.xml
index 0068e92..ff86be2 100644
--- a/man/systemd-bootchart.xml
+++ b/man/systemd-bootchart.xml
@@ -116,7 +116,7 @@
 systemd-bootchart
 instead of the init process. In turn,
 systemd-bootchart
-will invoke /sbin/init.
+will invoke /usr/lib/systemd/systemd.
 
 
 
@@ -218,7 +218,7 @@
 -i
 --init path
 Use this init binary. Defaults to
-/sbin/init.
+/usr/lib/systemd/systemd.
 
 
 
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 0808ba4..99ad745 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -76,7 +76,11 @@ 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"
+#ifdef HAVE_SPLIT_USR
+#define DEFAULT_INIT "/lib/systemd/systemd"
+#else
+#define DEFAULT_INIT "/usr/lib/systemd/systemd"
+#endif
 #define DEFAULT_OUTPUT "/run/log"
 
 /* graph defaults */
@@ -326,7 +330,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) {
-- 
2.1.4

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel