On a properly maintained system those files shouldn't get created in the first place. I've never had a single one in all the years I've been using pkg(8) (I originally started using it on 9.x when the old pkg_* tools were still the default).
find /usr/local -type f -name '*.pkgsave' -filter executable files only
Well, this shows I'm not that experienced with find(1) and I need to try and test whatever I come up with. I always get royally confused with theFor me is enough if you would like to complete the script that I have asked,adding the filter for detecting the pkgsave executable files to the command line that you have already wrote :
-perm
option. find /usr/local/ -type f -name '*.pkgsave' -perm +a+x
-perm [-|+]mode
The mode may be either symbolic (see chmod(1)) or an octal
number. If the mode is symbolic, a starting value of zero is
assumed and the mode sets or clears permissions without regard to
the process' file mode creation mask. If the mode is octal, only
bits 07777 (S_ISUID | S_ISGID | S_ISTXT | S_IRWXU | S_IRWXG |
S_IRWXO) of the file's mode bits participate in the comparison.
If the mode is preceded by a dash (“-”), this primary evaluates
to true if at least all of the bits in the mode are set in the
file's mode bits. If the mode is preceded by a plus (“+”), this
primary evaluates to true if any of the bits in the mode are set
in the file's mode bits. Otherwise, this primary evaluates to
true if the bits in the mode exactly match the file's mode bits.
Note, the first character of a symbolic mode may not be a dash
(“-”).
# find /usr/local/etc/rc.d -type f -name '*.pkgsave' -perm +a+x
/usr/local/etc/rc.d/openvpn.pkgsave
/usr/local/etc/rc.d/avahi-dnsconfd.pkgsave
/usr/local/etc/rc.d/avahi-daemon.pkgsave
/usr/local/etc/rc.d/cupsd.pkgsave
/usr/local/etc/rc.d/uuidd.pkgsave
/usr/local/etc/rc.d/cbsdd.pkgsave
/usr/local/etc/rc.d/cbsd-statsd-jail.pkgsave
/usr/local/etc/rc.d/cbsdrsyncd.pkgsave
/usr/local/etc/rc.d/cbsd-statsd-hoster.pkgsave
/usr/local/etc/rc.d/dbus.pkgsave
/usr/local/etc/rc.d/cbsd-statsd-bhyve.pkgsave
You still want to remove those, it just clutters the system, taking up space for absolutely no reason.I have a LOT of pkgsave's executable files on /usr/local,but I see that none of them is executed when FreeBSD starts.
Those are the only two directories where services are started from during boot. Technically speaking you need to look at /etc/rc.d and whatever directories have been set inSo,the directories to scan are only /usr/local/etc/rc.d/ and /etc/rc.d ?
local_startup
(see /etc/defaults/rc.conf). But most people simply use the default and have this set to /usr/local/etc/rc.d.ok. So,at the moment I'm / we are without a satisfactory solution.
On a properly maintained system those files shouldn't get created in the first place.
Mutual exclusivity at its finest.You have good arguments to get this added.
"Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime”
-- Lao Tzu
Mutual exclusivity at its finest.
This means that things can't happen at the same time. I find the posts i quoted quite the contrary.what do you mean with "mutual exclusivity at its finest"
This means that things can't happen at the same time. I find the posts i quoted quite the contrary.
I just wanted to say that filing a PR is not appropriate in this case because the problem does not appear on well maintained systems.
Not really. If you maintain a system properly and don't muck around with the package database then you won't get those files. That said, people make mistakes and screw up, this thread is testament of that. It's a relatively simple change that would prevent some potential disastrous consequences if you do happen to screw up your system this way.Mutual exclusivity at its finest.
Sure man,I seen your command on post #34,this one :
find /usr/local -type f -name '*.pkgsave' -exec chmod a-x {} \;
chmod a-x {} \;
but:
1) the annoying executable files are located only on /usr/local/etc/rc.d and I have already removed them,copying them on another directory
2) actually my goal is to free space from the whole disk. If you tell to me that my system will continue to work great if I remove every *.pkgsave file stored on the disk,I will do it.
Ok, but are we not seeking long-term general solutions and learnings, rather than just one-off fixes?
# find /usr/local/etc/rc.d -type f -name '*.pkgsave' -delete