[systemd-devel] [PATCH] core: improve error message when machine id is missing

2014-10-24 Thread Jan Synacek
---
 src/core/machine-id-setup.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
index efb074f..eba35be 100644
--- a/src/core/machine-id-setup.c
+++ b/src/core/machine-id-setup.c
@@ -191,7 +191,11 @@ int machine_id_setup(const char *root) {
 else {
 fd = open(etc_machine_id, O_RDONLY|O_CLOEXEC|O_NOCTTY);
 if (fd  0) {
-log_error(Cannot open %s: %m, 
etc_machine_id);
+log_error(System cannot boot: Missing 
/etc/machine-id and /etc is mounted read-only.\n
+  Booting up is supported only 
when:\n
+  1) /etc/machine-id exists and is 
populated.\n
+  2) /etc/machine-id exists and is 
empty.\n
+  3) /etc/machine-id is missing and 
/etc is writable.\n);
 return -errno;
 }
 
-- 
1.9.3

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


Re: [systemd-devel] [PATCH] core: improve error message when machine id is missing

2014-10-23 Thread Jan Synacek
Jan Synacek jsyna...@redhat.com writes:

 ---
  src/core/machine-id-setup.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

 diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
 index efb074f..eba35be 100644
 --- a/src/core/machine-id-setup.c
 +++ b/src/core/machine-id-setup.c
 @@ -191,7 +191,11 @@ int machine_id_setup(const char *root) {
  else {
  fd = open(etc_machine_id, 
 O_RDONLY|O_CLOEXEC|O_NOCTTY);
  if (fd  0) {
 -log_error(Cannot open %s: %m, 
 etc_machine_id);
 +log_error(System cannot boot: Missing 
 /etc/machine-id and /etc is mounted read-only.\n
 +  Booting up is supported only 
 when:\n
 +  1) /etc/machine-id exists and is 
 populated.\n
 +  2) /etc/machine-id exists and is 
 empty.\n
 +  3) /etc/machine-id is missing and 
 /etc is writable.\n);
  return -errno;
  }
  
 -- 
 1.9.3


Not sure if this message ever got through, so resending.

-- 
Jan Synacek
Software Engineer, Red Hat


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


Re: [systemd-devel] [PATCH] core: improve error message when machine id is missing

2014-10-23 Thread Lennart Poettering
On Thu, 23.10.14 16:24, Jan Synacek (jsyna...@redhat.com) wrote:

 Jan Synacek jsyna...@redhat.com writes:
 
  ---
   src/core/machine-id-setup.c | 6 +-
   1 file changed, 5 insertions(+), 1 deletion(-)
 
  diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
  index efb074f..eba35be 100644
  --- a/src/core/machine-id-setup.c
  +++ b/src/core/machine-id-setup.c
  @@ -191,7 +191,11 @@ int machine_id_setup(const char *root) {
   else {
   fd = open(etc_machine_id, 
  O_RDONLY|O_CLOEXEC|O_NOCTTY);
   if (fd  0) {
  -log_error(Cannot open %s: %m, 
  etc_machine_id);
  +log_error(System cannot boot: Missing 
  /etc/machine-id and /etc is mounted read-only.\n
  +  Booting up is supported only 
  when:\n
  +  1) /etc/machine-id exists and 
  is populated.\n
  +  2) /etc/machine-id exists and 
  is empty.\n
  +  3) /etc/machine-id is missing 
  and /etc is writable.\n);
   return -errno;
   }
   
  -- 
  1.9.3
 
 
 Not sure if this message ever got through, so resending.

No, never saw it! Thanks for resending. There were some fdo mail issue
that caused dropped messages... I wonder if there were any other mails
I missed due to that...

Patch looks mostly good, but I'd prefer if we'd print this longer
explanation only if errno == EROFS, and otherwise leave the short one
there. Helpful messages are good, but helpful messages on the wrong
occasion are just confusing... ;-)

Lennart

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