Mailinglist Archive: opensuse-packaging (218 mails)

< Previous Next >
[opensuse-packaging] Need help with %post script
  • From: Dave Plater <dplater@xxxxxxxxxxxxxxxx>
  • Date: Thu, 03 Dec 2009 12:22:30 +0200
  • Message-id: <4B179166.3040907@xxxxxxxxxxxxxxxx>
Hi, I'm trying to build bacula-3.0.3 to be submitted to contrib and I'm
stuck on a postinstall script problem. First osc failed because the
service needed service network to be enabled so I added the line
"/sbin/chkconfig --add network" to the script and now I have the error :-
|... running 06-check-installtest
... testing for pre/postinstall scripts that are not idempotent
+ '[' -n instsys ']'
+ exit 0
network: unknown service
postinstall script of bacula-client-3.0.3-28.1.x86_64.rpm failed
mount: / is busy
System halted.
|

which seems like a catch 22 situation.
Here is the whole script which comes from the original upstream specfile
from the source rpm and I've hacked it for opensuse :-
%post client
# add our link
if [ "$1" -ge 1 ] ; then
/sbin/chkconfig --add network
/sbin/chkconfig --add bacula-fd
fi

# generate passwords if needed
if [ -d %{sysconf_dir} ]; then
cd %{sysconf_dir}
for file in *.conf; do
for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX
XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX
XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PA
need_password=`grep $string $file 2>/dev/null`
if [ -n "$need_password" ]; then
pass=`openssl rand -base64 33`
sed "s-$string-$pass-g" $file > $file.new
cp -f $file.new $file; rm -f $file.new
fi
done
done
fi

/sbin/ldconfig

Appreciate any help,
Dave P


--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >