From 4f8c3e2552edc1e0f23f7d30ded876f21ccd223c503c9a165933435f22ad4d52 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 27 Sep 2016 09:44:14 +0000 Subject: [PATCH] - systemd-sysv-convert: make sure that/var/lib/systemd/sysv-convert/database is always initialized (bsc#982211) If "--save" command was used and the sysv init script wasn't enabled at all, the database file wasn't created at all. This makes the subsequent call to "--apply" fail even though it's a valid scenario. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=954 --- systemd-mini.changes | 11 +++++++++++ systemd-sysv-convert | 12 +++++------- systemd.changes | 11 +++++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/systemd-mini.changes b/systemd-mini.changes index b948b00c..1f4f2d70 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon Sep 26 14:23:14 UTC 2016 - fbui@suse.com + +- systemd-sysv-convert: make sure that + /var/lib/systemd/sysv-convert/database is always initialized (bsc#982211) + + If "--save" command was used and the sysv init script wasn't enabled + at all the database file wasn't created at all. This makes the + subsequent call to "--apply" fail even though this should not + considered as an error. + ------------------------------------------------------------------- Mon Sep 26 09:09:27 UTC 2016 - fbui@suse.com diff --git a/systemd-sysv-convert b/systemd-sysv-convert index 8ba3f211..4d98e4f6 100644 --- a/systemd-sysv-convert +++ b/systemd-sysv-convert @@ -118,9 +118,9 @@ case "$1" in find_service $service $runlevel priority=$? if [ $priority -lt 255 ]; then - echo "$service $runlevel $priority" >> /var/lib/systemd/sysv-convert/database + echo "$service $runlevel $priority" fi - done + done >>/var/lib/systemd/sysv-convert/database done ;; --show) @@ -158,11 +158,9 @@ case "$1" in [ -f "/lib/systemd/system/$service.service" ] && service_file="/lib/systemd/system/$service.service" [ -f "/usr/lib/systemd/system/$service.service" ] && service_file="/usr/lib/systemd/system/$service.service" - if [ -z "${results_runlevel[$service]}" ]; then - echo No information found about service $service found. >/dev/stderr - fail=1 - continue - fi + # If $service is not present in the database, + # then it simply means that the sysv init + # service was not enabled at all. for runlevel in ${results_runlevel[$service]}; do echo ln -sf $service_file /etc/systemd/system/runlevel$runlevel.target.wants/$service.service >/dev/stderr mkdir -p "/etc/systemd/system/runlevel$runlevel.target.wants" diff --git a/systemd.changes b/systemd.changes index b948b00c..1f4f2d70 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon Sep 26 14:23:14 UTC 2016 - fbui@suse.com + +- systemd-sysv-convert: make sure that + /var/lib/systemd/sysv-convert/database is always initialized (bsc#982211) + + If "--save" command was used and the sysv init script wasn't enabled + at all the database file wasn't created at all. This makes the + subsequent call to "--apply" fail even though this should not + considered as an error. + ------------------------------------------------------------------- Mon Sep 26 09:09:27 UTC 2016 - fbui@suse.com