On 06/18/2018 05:30 PM, John Paul Adrian Glaubitz wrote:
I thought that as well, but according to the documentation, "$1" is equal to "2" for upgrades and that's what I am testing:
if [ "$1" == "2" ]; then service google-network-daemon start fi
This fails during build.
However, when I add testing for "/.buildenv" as suggested by Marcus, it works:
if [ "$1" == "2" ] && ! [ -e /.buildenv ]; then service google-network-daemon start fi
I have just verified that this change does the right thing on SLE-11-SP4 and SLE-12-SP3: Index: google-compute-engine.changes =================================================================== --- google-compute-engine.changes (revision 4c54794cf9a7b720f0f1091d2a152b0e) +++ google-compute-engine.changes (working copy) @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Jun 18 15:53:01 UTC 2018 - adrian.glaubitz@suse.com + +- Ensure that google-ip-forwarding-daemon service and + google-network-setup are actually stopped and disabled + during upgrade +- Ensure that google-network-daemon service is actually + enabled and started during upgrade + ------------------------------------------------------------------- Thu Jun 14 10:31:14 UTC 2018 - adrian.glaubitz@suse.com Index: google-compute-engine.spec =================================================================== --- google-compute-engine.spec (revision 4c54794cf9a7b720f0f1091d2a152b0e) +++ google-compute-engine.spec (working copy) @@ -169,7 +169,23 @@ %post init %if 0%{?suse_version} > 1140 %service_add_post google-accounts-daemon.service google-clock-skew-daemon.service google-instance-setup.service google-network-daemon.service google-shutdown-scripts.service google-startup-scripts.service -%else + if [ -f /usr/lib/systemd/system/google-ip-forwarding-daemon.service ]; then + systemctl stop --no-block google-ip-forwarding-daemon + systemctl disable google-ip-forwarding-daemon.service + fi + if [ -f /usr/lib/systemd/system/google-network-setup.service ]; then + systemctl stop --no-block google-network-setup + systemctl disable google-network-setup.service + fi + if [ "$1" == "2" ] && ! [ -e /.buildenv ]; then + systemctl enable google-network-daemon.service + systemctl start google-network-daemon.service + fi +%else + if [ "$1" == "2" ] && ! [ -e /.buildenv ]; then + service google-network-daemon start + fi + %fillup_and_insserv -fy google-accounts-daemon %fillup_and_insserv -fy google-clock-skew-daemon %fillup_and_insserv -fy google-instance-setup Adrian -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org