Re: [systemd-devel] [PATCH] shutdown: pass own argv to /run/initramfs/shutdown

2014-09-30 Thread Marius Tessmann

On 09/30/2014 05:03 AM, Zbigniew Jędrzejewski-Szmek wrote:

On Fri, Aug 29, 2014 at 05:51:45PM +0200, Marius Tessmann wrote:

Since commit b1e90ec515408aec2702522f6f68c4920b56375b systemd passes
its log settings to systemd-shutdown via command line parameters.
However, systemd-shutdown doesn't pass these parameters to
/run/initramfs/shutdown, causing it to fall back to the default log
settings.

Hi,
sorry for the late reply.

Your patch should work fine if /run/initramfs/shutdown accepts
those arguments, i.e. if it another systemd binary. But otherwise
it might fail, no?


Well, yes. I didn't really think about other implementations. I just checked
the Dracut source and it shouldn't break anything there since it only parses
the first argument as the verb [1]. I don't know what other implementations
are out there, but I doubt they would break since they have no reason to 
parse

anything but the first argument in the first place.

Also, the Initrd Interface [2] doesn't even mention what arguments are 
passed

to the shutdown binary (not even the verb), so one could argue that
implementations should expect this to change. ;)

Imho it would be enough to mention this in the release notes so that it can
be fixed if necessary. Other implementations may even want to make use 
of the

new parameters. ;)

If possible breakage for other implementations is not acceptable I would 
love

to know how else this could/should be fixed properly.

[1] 
https://git.kernel.org/cgit/boot/dracut/dracut.git/tree/modules.d/99shutdown/shutdown.sh#n7

[2] http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/



Zbyszek


This fixes the following bugs about the shutdown not being quiet
despite "quiet" being in the kernel parameters:

https://bugs.freedesktop.org/show_bug.cgi?id=79582
https://bugs.freedesktop.org/show_bug.cgi?id=57216
---
  src/core/shutdown.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 1e88b05..d361cbe 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -313,7 +313,7 @@ int main(int argc, char *argv[]) {
  access("/run/initramfs/shutdown", X_OK) == 0) {
  r = switch_root_initramfs();
  if (r >= 0) {
-arguments[0] = (char*) "/shutdown";
+argv[0] = (char*) "/shutdown";
  
  setsid();

  make_console_stdio();
@@ -321,7 +321,7 @@ int main(int argc, char *argv[]) {
  log_info("Successfully changed into root pivot.\n"
   "Returning to initrd...");
  
-execv("/shutdown", arguments);

+execv("/shutdown", argv);
  log_error("Failed to execute shutdown binary: %m");
  } else
  log_error("Failed to switch root to \"/run/initramfs\": 
%s", strerror(-r));
--
2.1.0

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



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


[systemd-devel] [PATCH] shutdown: pass own argv to /run/initramfs/shutdown

2014-08-29 Thread Marius Tessmann
Since commit b1e90ec515408aec2702522f6f68c4920b56375b systemd passes
its log settings to systemd-shutdown via command line parameters.
However, systemd-shutdown doesn't pass these parameters to
/run/initramfs/shutdown, causing it to fall back to the default log
settings.

This fixes the following bugs about the shutdown not being quiet
despite "quiet" being in the kernel parameters:

https://bugs.freedesktop.org/show_bug.cgi?id=79582
https://bugs.freedesktop.org/show_bug.cgi?id=57216
---
 src/core/shutdown.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 1e88b05..d361cbe 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -313,7 +313,7 @@ int main(int argc, char *argv[]) {
 access("/run/initramfs/shutdown", X_OK) == 0) {
 r = switch_root_initramfs();
 if (r >= 0) {
-arguments[0] = (char*) "/shutdown";
+argv[0] = (char*) "/shutdown";
 
 setsid();
 make_console_stdio();
@@ -321,7 +321,7 @@ int main(int argc, char *argv[]) {
 log_info("Successfully changed into root pivot.\n"
  "Returning to initrd...");
 
-execv("/shutdown", arguments);
+execv("/shutdown", argv);
 log_error("Failed to execute shutdown binary: %m");
 } else
 log_error("Failed to switch root to 
\"/run/initramfs\": %s", strerror(-r));
-- 
2.1.0

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


[systemd-devel] [PATCH 2/3] systemd-firstboot: fix typo in man page

2014-08-28 Thread Marius Tessmann
---
 man/systemd-firstboot.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/systemd-firstboot.xml b/man/systemd-firstboot.xml
index 5da0a75..8d97302 100644
--- a/man/systemd-firstboot.xml
+++ b/man/systemd-firstboot.xml
@@ -101,7 +101,7 @@
 allows systemd-firstboot to operate
 on mounted but not booted disk images and in early
 boot. It is not recommended to use
-systemd-firsboot on the running
+systemd-firstboot on the running
 system while it is up.
 
 
-- 
2.1.0

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


[systemd-devel] [PATCH 1/3] systemd-firstboot.service: fix man page section

2014-08-28 Thread Marius Tessmann
Found with systemd-analyze verify.
---
 units/systemd-firstboot.service.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/units/systemd-firstboot.service.in 
b/units/systemd-firstboot.service.in
index a8719a8..6cdde5b 100644
--- a/units/systemd-firstboot.service.in
+++ b/units/systemd-firstboot.service.in
@@ -7,7 +7,7 @@
 
 [Unit]
 Description=First Boot Wizard
-Documentation=man:systemd-firstboot(8)
+Documentation=man:systemd-firstboot(1)
 DefaultDependencies=no
 Conflicts=shutdown.target
 After=systemd-readahead-collect.service systemd-readahead-replay.service 
systemd-remount-fs.service systemd-sysusers.service
-- 
2.1.0

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


[systemd-devel] [PATCH 3/3] systemd-journal-upload: fix invalid After=

2014-08-28 Thread Marius Tessmann
After= belongs into [Unit], not [Install]. Found with systemd-analyze
verify.
---
 units/systemd-journal-upload.service.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/units/systemd-journal-upload.service.in 
b/units/systemd-journal-upload.service.in
index e79f962..359ff10 100644
--- a/units/systemd-journal-upload.service.in
+++ b/units/systemd-journal-upload.service.in
@@ -7,6 +7,7 @@
 
 [Unit]
 Description=Journal Remote Upload Service
+After=network.target
 
 [Service]
 ExecStart=@rootlibexecdir@/systemd-journal-upload \
@@ -18,4 +19,3 @@ WatchdogSec=20min
 
 [Install]
 WantedBy=multi-user.target
-After=network.target
-- 
2.1.0

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