Bug 26823 - denyhosts Runtime directory needed bot not preserved
Summary: denyhosts Runtime directory needed bot not preserved
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: David GEIGER
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-19 01:05 CEST by Juan Magallón
Modified: 2020-07-11 06:58 CEST (History)
1 user (show)

See Also:
Source RPM: denyhosts-3.1-7.mga8.src.rpm
CVE:
Status comment:


Attachments

Description Juan Magallón 2020-06-19 01:05:03 CEST
Current denyhosts is configured to use /run/denyhosts as runtime dir.
Problem is that service file is setup with:

RuntimeDirectoryPreserve=restart

And then comands fail when service is stopped, because runtime dir is removed:

pandora:/lib/systemd/system# ps -ef | grep deny
root        5086       1  0 00:58 ?        00:00:00 /usr/bin/python3 -s /usr/bin/denyhosts.py --daemon --config=/etc/denyhosts.conf
root        5088    4620  0 00:58 pts/0    00:00:00 grep deny
pandora:/lib/systemd/system# denyhosts.py --purge-all
DenyHosts could not obtain lock (pid: 5086)
[Errno 17] File exists: '/run/denyhosts/denyhosts.pid'
pandora:/lib/systemd/system# systemctl stop denyhosts
pandora:/lib/systemd/system# denyhosts.py --purge-all
DenyHosts could not obtain lock (pid: )
[Errno 2] No such file or directory: '/run/denyhosts/denyhosts.pid'

Runtime dir (also it is installed in rpm file) should be preserved,
even after stop:

RuntimeDirectoryPreserve=yes

And also packages seems to include a PID file that perhaps should not
be there:

pandora:/lib/systemd/system# rpm -ql denyhosts | grep run
/run/denyhosts
/run/denyhosts/denyhosts.pid
Comment 1 David GEIGER 2020-06-19 12:57:44 CEST
Should be fixed with next denyhosts-3.1-8.mga8 update!

RPM does not include directly the PID file but it include the runtime dir and the PID file as a ghost dir/file to ensure that "/run/denyhosts" and "/run/denyhosts/denyhosts.pid" will be removed when user uninstall the package.

CC: (none) => geiger.david68210

Comment 2 Lewis Smith 2020-06-19 21:20:40 CEST
Just as for the companion bug 26822, thanks yet again to you David for sorting this immediately. Assigning to you, can you close it when the update happens (again, I would not see that).
CC'ing JohnnyS for info.

Summary: Runtime directory needed bot not preserved => denyhosts Runtime directory needed bot not preserved
CC: geiger.david68210 => cooker
Assignee: bugsquad => geiger.david68210

Comment 3 David GEIGER 2020-07-11 06:58:38 CEST
Closing as fixed!

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.