Learn to use your package manager

Do you create your own RPM packages?

postinstall scriptlet (/bin/sh):

blah blah > SOME_FILE_THAT_DOESNT_EXIST_IN_SPEC


preuninstall scriptlet (/bin/sh):

rm -f SOME_FILE_THAT_DOESNT_EXIST_IN_SPEC

DO. NOT. DO. THIS. It leads to your package being un-updateable, because the update will first blindly overwrite the old file, and then the removal of the old package will remove the newly created file, leaving you with no file at all.

RPMs must declare files they will own for everything to work smoothly. You can alter their contents in the {pre,post}{,un}install scripts, but the fact that they exist can't be left out of the catalogue in the spec.

EMC NetWorker lgtoclnt rpm was the poster boy of this anomaly for a long time, removing its own script in /etc/init.d (and therefore making itself un-startable at startup after an update, leading to documentation helpfully instructing you that you can't update, you must first remove and then do a fresh install instead) this way.

Unfortunately people other than EMC have also been able to participate in this. When you see this done by people who knew about the problem with lgtoclnt already... it is very frustrating.

Mikko Niska

Senior Cyber Security Specialist

6 å¹´

Hope not one of my packages back then :) . I recall having had excessive difficulties in understanding the logical flow designed by RPM packaging solution.?

要查看或添加评论,请登录

Atro Tossavainen ????????????????????????????????的更多文章

社区洞察

其他会员也浏览了