[PATCH 2/2] Add some logging to our shell scripts

Vratislav Podzimek vpodzime at redhat.com
Mon Nov 4 09:03:29 UTC 2013


These information are hard to find anywhere else so let's log 'em all!

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 firstboot-windowmanager | 3 +++
 initial-setup           | 8 +++++++-
 initial-setup.spec      | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/firstboot-windowmanager b/firstboot-windowmanager
index 814b8df..39f26b5 100755
--- a/firstboot-windowmanager
+++ b/firstboot-windowmanager
@@ -14,10 +14,12 @@ for WM in ${WMS[@]}; do
 
     if [ $FOUND -eq 0 -a -x "$FILE" ]; then
         # start window manager
+        echo "Running $FOUND window manager ($FILE)" | logger
         "$FILE" "$@" &
         pid=$!
 
         # start the application
+        echo "Running $BINARY" | logger
         $BINARY
         res=$?
 
@@ -30,4 +32,5 @@ for WM in ${WMS[@]}; do
 done
 
 # No known window manager found
+echo "No supported window manager found!" | logger
 exit 1
diff --git a/initial-setup b/initial-setup
index 6fc3c6a..e2dd9ad 100755
--- a/initial-setup
+++ b/initial-setup
@@ -1,2 +1,8 @@
 #!/bin/sh
-python -m initial_setup && /bin/systemctl disable initial-setup-graphical.service initial-setup-text.service &>/dev/null
+
+echo "Running initial_setup" | logger
+if python -m initial_setup; then
+    echo "initial_setup finished successfully, disabling" | logger
+    /bin/systemctl disable initial-setup-graphical.service initial-setup-text.service &>/dev/null
+else
+    echo "initial_setup failed, keeping enabled" | logger
diff --git a/initial-setup.spec b/initial-setup.spec
index bba2dfc..0308691 100644
--- a/initial-setup.spec
+++ b/initial-setup.spec
@@ -36,6 +36,7 @@ Requires(postun): systemd
 Requires: firstboot(windowmanager)
 Requires: libreport-python
 Requires: python-di
+Requires: util-linux
 Conflicts: firstboot < 19.2
 
 %description
-- 
1.7.11.7



More information about the anaconda-patches mailing list