On 06/18/2018 04:10 PM, Robert Schweikert wrote:
Is this also supposed to work with the RPM version found in SLE-11-SP4? My tests show that "$1" is unset on SLE-11-SP4.
I do not know to this question, however since I know what you are after and given SLES 11 has only 9 months to EOL I'll offer a diferent approach to skin the cat.
You can test if the init file of the service to be replaced exists, if yes (package upgrade) do the "replacement magic". If not fresh install, => nothing to do.
The current spec file actually does already the right thing: It deletes the old init scripts and installs the new one. What I cannot figure out is how to start the new google-network-daemon after installing the package. The problem is that during the build process, rpmbuild apparentely tries to install the package which then invokes the script code to start the google- network-daemon service: [ 146s] Preparing packages for installation... [ 146s] google-compute-engine-debuginfo-20180510-0 [ 146s] google-compute-engine-oslogin-20180510-0 [ 146s] google-compute-engine-debugsource-20180510-0 [ 146s] google-compute-engine-init-20180510-0 [ 147s] ... running 01-check-debuginfo [ 147s] ... testing for empty debuginfo packages [ 147s] ! [ 147s] ! google-compute-engine-debugsource-20180510-0.x86_64.rpm: no debug sources, deleting package [ 147s] ! google-compute-engine-debuginfo-20180510-0.x86_64.rpm: WARNING: this probably means the debug information is invalid [ 147s] ! [ 147s] ... running 02-check-gcc-output [ 147s] ... testing for serious compiler warnings [ 147s] (using /usr/lib/build/checks-data/check_gcc_output) [ 147s] (using /var/tmp/build-root/standard-x86_64/.build.log) [ 147s] ... running 03-check-binary-kernel-log [ 147s] ... running 04-check-filelist [ 147s] ... checking filelist [ 147s] ... running 05-check-invalid-requires [ 147s] dependency check for google-compute-engine-debuginfo-20180510-0.x86_64.rpm: [ 147s] ... running 06-check-installtest [ 147s] ... testing for pre/postinstall scripts that are not idempotent [ 147s] Starting google-network-daemon daemon Traceback (most recent call last): [ 147s] File "/usr/bin/google_network_daemon", line 8, in <module> [ 147s] load_entry_point('google-compute-engine==2.8.2', 'console_scripts', 'google_network_daemon')() [ 147s] File "/usr/lib64/python2.6/site-packages/google_compute_engine/networking/network_daemon.py", line 172, in main [ 147s] debug=debug) [ 147s] File "/usr/lib64/python2.6/site-packages/google_compute_engine/networking/network_daemon.py", line 60, in __init__ [ 147s] name='google-networking', debug=debug, facility=facility) [ 147s] File "/usr/lib64/python2.6/site-packages/google_compute_engine/logger.py", line 49, in Logger [ 147s] address='/dev/log', facility=facility) [ 147s] File "/usr/lib64/python2.6/logging/handlers.py", line 715, in __init__ [ 147s] self._connect_unixsocket(address) [ 147s] File "/usr/lib64/python2.6/logging/handlers.py", line 730, in _connect_unixsocket [ 147s] self.socket.connect(address) [ 147s] File "<string>", line 1, in connect [ 147s] socket.error: [Errno 2] No such file or directory [ 147s] ..failed [ 147s] postinstall script of google-compute-engine-init-20180510-0.x86_64.rpm failed -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org