[opensuse-packaging] triggerd: idea how to get rid many SuSEconfig scripts and simplify scriptlets
Hallo. I have been thinking about getting rid many of SuSEconfig scripts and making scriptlets more effective (call them once per transaction instead of four times per package). Because modification of RPM seems to be not acceptable, I tried to find a solution, which will work with unmodified RPM: Create a new daemon, running by default: triggerd triggerd can be an inotify based software and will have a configuration in /etc/trigger.d/. Each file there will contain a list of paths. If anything in specified path will change, script with the same name will be started with arguments saying, which directory (and maybe which file) have been changed. Specified path can be file, directory or recursive directory search. There will be a special flag (file), which will block/postpone the script calling. Paths: /etc/trigger.d/*: Configuration files. /usr/lib/trigger/*: Trigger scripts. /var/lib/triggerd/postpone/*: Postpone flags. Postpone calling of scripts until file here disappears. This daemon can obsolete many SuSEconfig scripts and even make scriptlets run faster - for example ldconfig: /etc/trigger.d/ldconfig: Symlink to /etc/ld.co.conf /usr/lib/trigger/ldconfig: Probably symlink to /sbin/ldconfig %pre touch var/lib/triggerd/postpone/ldconfig %preun touch var/lib/triggerd/postpone/ldconfig %posttrans if !.....zypp_is_running... ; then rm var/lib/triggerd/postpone/ldconfig fi In zypp: After completing of "transaction": rm var/lib/triggerd/postpone/ldconfig Transaction stuff in zypp / yast is not yet connected with RPM, so this is a work-around. RPM %posttrans will detect, that YaST/zypp is running, and will not delete postpone flag. zypp will delete it, when it will reach end of the "transaction" (i. e. if PreReq of next package has to be resolved or package list is complete). This implementation can replace all ocurrences of ldconfig except calls in "self prerequiring" scriptlets - scriptlets, which require working binaries from the same package. -- Best Regards / S pozdravem, Stanislav Brabec software developer --------------------------------------------------------------------- SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz Lihovarská 1060/12 tel: +420 284 028 966 190 00 Praha 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Monday 04 September 2006 12:45 schrieb Stanislav Brabec:
Hallo.
I have been thinking about getting rid many of SuSEconfig scripts and making scriptlets more effective (call them once per transaction instead of four times per package).
Because modification of RPM seems to be not acceptable, I tried to find a solution, which will work with unmodified RPM:
Create a new daemon, running by default: triggerd
were would be the difference to use the trigger scripts for this ? bye adrian -- Adrian Schroeter SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany email: adrian@suse.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, 4 Sep 2006, Adrian Schröter wrote:
Am Monday 04 September 2006 12:45 schrieb Stanislav Brabec:
Hallo.
I have been thinking about getting rid many of SuSEconfig scripts and making scriptlets more effective (call them once per transaction instead of four times per package).
Because modification of RPM seems to be not acceptable, I tried to find a solution, which will work with unmodified RPM:
Create a new daemon, running by default: triggerd
were would be the difference to use the trigger scripts for this ?
because rpm can only trigger on installation of a defined list of other packages, not handling the issue we most commonly have: trigger on modification of a directory to update some kind of index or cache file. -- with kind regards (mit freundlichem Grinsen), Ruediger Oertel (ro@novell.com,ro@suse.de,bugfinder@t-online.de) ---------------------------------------------------------------------- Linux Fatou 2.6.18-rc5-3-default #1 SMP Wed Aug 30 12:40:00 UTC 2006 x86_64 Key fingerprint = 17DC 6553 86A7 384B 53C5 CA5C 3CE4 F2E7 23F2 B417
Hello, Am Montag, 4. September 2006 12:45 schrieb Stanislav Brabec:
Create a new daemon, running by default: triggerd
"one more daemon" is not a really good solution... There are already too much daemons ;-) and some people will disable it as they did with zmd already. The idea with "touch a triggerfile" sounds good - you could combine it with SuSEconfig style scripts starting with test -e /var/run/trigger/ldconfig || exit 0 # [1] to speedup SuSEconfig. No need for a daemon. Regards, Christian Boltz [1] /var/run/trigger is a better path than /etc/trigger.d/ IMHO -- 1.-4.9.2006: Weinfest in Insheim Pig Slip, Hifi-Delity, AH-Band, Frank Petersen und die Deafen Goblins spielen bei der Landjugend. Mehr Infos: www.Landjugend-Insheim.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Christian Boltz píše v Po 04. 09. 2006 v 16:01 +0200:
Hello,
Am Montag, 4. September 2006 12:45 schrieb Stanislav Brabec:
Create a new daemon, running by default: triggerd
"one more daemon" is not a really good solution... There are already too much daemons ;-) and some people will disable it as they did with zmd already.
The idea with "touch a triggerfile" sounds good - you could combine it with SuSEconfig style scripts starting with test -e /var/run/trigger/ldconfig || exit 0 # [1] to speedup SuSEconfig.
SuSeconfig is deprecated and it was an idea how to get it rid. Using triggers in packages does not work well in some cases, triggering by directory change would be better - for example gtk-update-icon-cache has to be triggered by a touch in cca 240 packages, including KDE packages, absolutely unrelated to gtk (but because KDE and GNOME can share icon themes, it can contain data usable in GNOME). IMHO triggering by directory change can be implemented by two ways: - Trigger them inside RPM during RPM database update. (Unacceptable, will make our RPM incompatible with the rest of the world.) - In kernel using inotify. (Needs an extra daemon.)
No need for a daemon.
Yes, but there is a chance to run the "daemon" temporarily from RPM and terminate it, when RPM installation is over. Permanently running daemon could have more usage: - Update config files from /etc/sysconfig/foo - Restart daemons after config change - Update caches/indexes after manual installation of non-package. - ... -- Best Regards / S pozdravem, Stanislav Brabec software developer --------------------------------------------------------------------- SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz Lihovarská 1060/12 tel: +420 284 028 966 190 00 Praha 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (4)
-
Adrian Schröter
-
Christian Boltz
-
Ruediger Oertel
-
Stanislav Brabec