[devel] скрипты

Stanislav Ievlev =?iso-8859-1?q?inger_=CE=C1_altlinux=2Eorg?=
Чт Фев 20 15:57:48 MSK 2003


Привет всем!

Пригалаю список скриптов в пакетах rpm, показавшийся мне подозрительным.
Вполне возможно, что я где-то был не прав. В любом случае хочется
комментариев от мантейнеров.

--
Станислав Иевлев.

----------- следующая часть -----------

LinPopUp :
if [ ! -f /var/lib/linpopup/messages.dat ]; then touch /var/lib/linpopup/messages.dat; chmod 0666 /var/lib/linpopup/messages.dat; chgrp nobody /var/lib/linpopup/messages.dat; else :; fi;
Zope-ZUtils :
if [ -e "/var/lib/zope/basic" ]; then echo "Basic site already exist and will not be upgareded"; else /usr/sbin/addzopesite.py basic 8000; fi;
exult:
postinstall scriptlet (through /bin/sh): chmod a+rx /usr/share/exult
golded+ :
postinstall scriptlet (through /bin/sh): for i in golded.log; do if [ ! -f "/var/log/ftn/$i" ]; then
 :>> "/var/log/ftn/$i" /bin/chown ftn:ftn "/var/log/ftn/$i" /bin/chmod 660 "/var/log/ftn/$i" fi done
  ||:
Зачем такой хак да еще и с такими правами?
 
gtklp :
postinstall scriptlet (through /bin/sh): [ -x /usr/bin/update-menus ] && /usr/bin/update-menus ||: #
Make CUPS settings compatible... /bin/mv /etc/cups/cupsd.conf /etc/cups/cupsd.conf~ /bin/cat /etc/cu
ps/cupsd.conf~ | /bin/sed -e s/\#RunAsUser\ no/RunAsUser\ no/ -e s/\#NoIzvrat\ yes/NoIzvrat\ yes/ > 
/etc/cups/cupsd.conf service cups restart postuninstall scriptlet (through /bin/sh): [ "$1" = 0 -a -
x /usr/bin/update-menus ] && /usr/bin/update-menus ||:

Вячеслав, ну Вы уже перестали меня удивлять ;)

inn :
postinstall scriptlet (through /bin/sh): if [ `/bin/cat /etc/news/inn.conf | /bin/grep '^server:' | 
wc -l` -lt 1 ]; then echo "server: `hostname -f`" >> /etc/news/inn.conf fi

Зачем свой собственный конфиг править?


isdn4net :
preuninstall scriptlet (through /bin/sh): echo -n "Deactivating isdn4linux card init:" /sbin/chkconf
ig --del isdnlog /sbin/chkconfig --del isdn4linux echo " done."

Явно не используется post/preun_service

jabber :
preinstall scriptlet (through /bin/sh): /usr/sbin/groupadd -r -f jabber \ 2>/dev/null ||: /usr/sbin/
useradd -r -g jabber -c 'Jabber server' -d /var/lib/jabber \ -s /dev/null jabber 2>/dev/null ||: pos
tinstall scriptlet (through /bin/sh): /bin/chown -R jabber /var/lib/jabber /bin/chown -R jabber /var
/log/jabber /bin/chown -R jabber /var/run/jabber /bin/chgrp -R jabber /var/lib/jabber /bin/chgrp -R 
jabber /var/log/jabber /bin/chgrp -R jabber /var/run/jabber if [ $1 = 1 ]; then /sbin/chkconfig --ad
d jabber else /sbin/service jabber condrestart ||: fi preuninstall scriptlet (through /bin/sh): if [
 $1 = 0 ]; then /sbin/chkconfig --del jabber ||: /sbin/service jabber condstop ||: fi

Зачем такие хаки? Может быть в триггер?

krb5-server :
postinstall scriptlet (through /bin/sh): # Remove the init script for older servers. [ -x /etc/rc.d/
init.d/krb5server ] && /sbin/chkconfig --del krb5server # Install the new ones. for i in krb5kdc kad
min krb524 kprop; do /sbin/chkconfig --add $i done

Явно не используется post/preun_service? Какой в этом грубинный смысл?

leafnode :
postinstall scriptlet (through /bin/sh): # get hostname to config -- works for first time fgrep -q h
ost.domain.country /etc/leafnode/config && { SERVERNAME=`hostname` [ -z "$SERVERNAME" ] && SERVERNAM
E="localhost" TMP=`mktemp -q leafnode-config-XXXXXXXXXX` [ $? = 0 ] && sed -e "s,host.domain.country
,$SERVERNAME,g" < /etc/leafnode/config > $TMP && \ cat $TMP > /etc/leafnode/config && rm $TMP } || :
 # TODO: use news for texpire? # TODO: config dir should be better guarded probably?

Зачем свой собственный конфиг править?

libcomedi :
postinstall scriptlet (through /sbin/ldconfig): cd /usr/lib ln -sf libcomedi.so.0.7.19 libcomedi.so 
ln -sf libcomedi.so.0.7.19 libcomedi.so.0 cd - postuninstall program: /sbin/ldconfig

А это что за хак? Может лучше правильный soname дать программе?

libfftw-devel :
postinstall scriptlet (through /bin/sh): /sbin/install-info --entry '* FFTW: (fftw). Fast Fourier Tr
ansform library.'\ --section Libraries /usr/share/info/fftw.info.gz /usr/share/info/dir postuninstal
l scriptlet (through /bin/sh): /sbin/install-info --entry '* FFTW: (fftw). Fast Fourier Transform li
brary.'\ --section Libraries --remove /usr/share/info/fftw.info.gz /usr/share/info/dir

Явно не используется макрос install_info.

libkrb5 :
postinstall scriptlet (through /bin/sh): if [ $1 = 1 ] ; then /bin/grep -Fq /usr/lib/krb5 /etc/ld.so
.conf || echo "/usr/lib/krb5" >> /etc/ld.so.conf /sbin/ldconfig fi postuninstall scriptlet (through 
/bin/sh): if [ $1 = 0 ] ; then TEMPFILE=`mktemp` if [ -n "$TEMPFILE" ] ; then /bin/fgrep -v /usr/lib
/krb5 /etc/ld.so.conf >> $TEMPFILE /bin/mv -f $TEMPFILE /etc/ld.so.conf /bin/chmod 655 /etc/ld.so.co
nf /bin/chown root:root /etc/ld.so.conf /sbin/ldconfig /bin/rm -f $TEMPFILE fi fi

Может библиотеки переместить в правильное место?

libqt3 :
postinstall scriptlet (through /bin/sh): /sbin/ldconfig rm -fr /tmp/.qt3 ||: rm -f /etc/.qt3/qt_plug
ins_3.*rc ||: [ -x /usr/bin/update-menus ] && /usr/bin/update-menus ||: # postuninstall scriptlet (t
hrough /bin/sh): /sbin/ldconfig [ "$1" = 0 -a -x /usr/bin/update-menus ] && /usr/bin/update-menus ||

Удалять в стандартных местах не стоит.

procps :
postinstall scriptlet (through /bin/sh): /sbin/ldconfig # remove obsolete files rm -f /etc/{psdevtab
,psdatabase} postuninstall program: /sbin/ldconfig

Наверное стоит переместить в trigger?

rp-pppoe-client :
preuninstall scriptlet (through /bin/sh): /sbin/chkconfig --del adsl #%files kmode-plugin #%config /
etc/modules.conf.pppoe #%dir /etc/ppp/plugins/ #/etc/ppp/plugins/rp-pppoe.so #%doc doc/KERNEL-MODE-P
PPOE

Явно не используется post/preun_service?

sleezeball :
postinstall scriptlet (through /bin/sh): if ! grep -qs '^internal-banner' /etc/squid/mime.conf; then
 echo 'internal-banner - banner.gif - image' >>/etc/squid/mime.conf fi cat >/etc/squid/sleezeball.co
 nf <<EOF # The SleezeBall Configuration # The URL to redirect banners to REDIRECT_URL=http://${HOSTN
 AME}:3128/squid-internal-static/icons/banner.gif # Uncomment this to enable log # LOG=/var/log/squid
 /sleezeball.log EOF
 slmdm_kernel-smp :
 
Зачем править чужие конфиги?

wwebalizer :
 preinstall scriptlet (through /bin/sh): /usr/sbin/groupadd -r -f webalizer 2>/dev/null ||: /usr/sbin
 /useradd -g webalizer -G apache -c 'The Webalizer' \ -d /var/lib/webalizer -s /dev/null -r webalizer
  2>/dev/null || : postinstall scriptlet (through /bin/sh): # get hostname to webalizer.conf W_HOST=`
  hostname` [ $? = 0 ] || W_HOST=localhost W_TMP=`mktemp -q webalizer.conf-XXXXXXXXXX` [ $? = 0 ] && s
  ed -e "s,__HOST__,$W_HOST,g" < /etc/webalizer.conf > $W_TMP && \ mv $W_TMP /etc/webalizer.conf && ch
  mod 644 /etc/webalizer.conf postuninstall scriptlet (through /bin/sh): /usr/sbin/userdel -r webalize
  r 2>/dev/null ||
  
Да и свои незачем ?

xemacs-auctex :
  postinstall scriptlet (through /bin/sh): LANGUAGE=POSIX; export LANGUAGE for f in auctex.info; do if
   [ "$f" = "${f##*/}" ]; then f="/usr/share/info/xemacs/$f" fi /sbin/install-info --section=XEmacs --
   dir-file="/usr/share/info/xemacs/dir" --info-file="$f" done preuninstall scriptlet (through /bin/sh)
   : LANGUAGE=POSIX; export LANGUAGE if [ $1 = 0 ]; then for f in auctex.info; do if [ "$f" = "${f##*/}
   " ]; then f="/usr/share/info/xemacs/$f" fi /sbin/install-info --section=XEmacs --delete --dir-file="
   /usr/share/info/xemacs/dir" --info-file="$f" done fi

Зачем LANGUAGE менять-то ?

zangband :
postinstall scriptlet (through /bin/sh): [ -x /usr/bin/update-menus ] && /usr/bin/update-menus ||: i
f [ -d /usr/games/lib/zangband//data ]; then rm -rf /usr/games/lib/zangband//data fi if [ -d /usr/ga
mes/lib/zangband//save ]; then for f in /usr/games/lib/zangband//save/*; do [ -e $f ] && install -m0
664 -g games -o games $f /var/lib/games/zangband//save/ done rm -rf /usr/games/lib/zangband//save fi
 preuninstall scriptlet (through /bin/sh): if [ -d /var/lib/games/zangband//data ]; then rm -rf /var
 /lib/games/zangband//data/* fi postuninstall scriptlet (through /bin/sh): [ "$1" = 0 -a -x /usr/bin/
 update-menus ] && /usr/bin/update-menus ||:

Наверное это излишне?

Наверное это перебор. Какой в этом глубокий смысл?


Подробная информация о списке рассылки Devel