Is there a way to log activities done by a rpm?

我们两清 提交于 2019-12-06 15:58:12
Ravindra Mijar

I was able to log the activities of my rpm by a little extension to a link I had mentioned earlier - Create log file when installing rpm. After creating this file, I started echo-ing my log messages to the file I created in the spec file.

echo "this is a log message" >> $RPM_BUILD_ROOT/var/log/mylogfile.txt

So, wherever I wanted to note an important activity done by the rpm, I was adding such statements. I also observed that this file got removed when I uninstalled the rpm.

rpm registers all installation information in a /var/lib/rpm database. One can query the database at any time, format to taste (including the http://www.rpm.org/wiki/RpmLog format) and save the output wherever you wish. Use --queryformat (examples in /usr/lib/rpm/rpmpopt*) and sort the installed/queried packages by install time first.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!