No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune.

I recently updated to 12.2 and a user immediately noticed that fortune no longer works.

I know it's not that important, and apparently there was some sort of holy war over inclusion of "offensive" fortunes, which resulted in a change to the default installation. I don't care about any of that, but the issue is that there's a base command that used to work, but doesn't now:

Code:
# which fortune
/usr/bin/fortune
# fortune
No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune.
# pwd
/usr/share/games/fortune
# ls -l
total 32
-r--r--r--  1 root  wheel  27042 Jul  8 18:50 freebsd-tips
-r--r--r--  1 root  wheel   1104 Jul  8 18:50 freebsd-tips.dat

I can install old fortunes through ports, but I don't actually want any of the potentially controversial ones, I just want the FreeBSD tips, which are already on the system, right where it says it's looking.

Any suggestions?

The only reason I'm even bringing up something so trivial is that the user had the command in his login files, so he was used to getting a FreeBSD tip every morning. Now that the system is upgraded, the very first thing he saw was an error message, which did not instill confidence. If I can make it work like it used to, he'll just be that much more comfortable.

Thanks!
 
Same behavior on FreeBSD-13, but if you do

fortune /usr/share/games/fortune/freebsd-tips

it works, so it's something about the default search path algorithm.

It's not ideal, but if you have the user modify his login files, it will work again.
 
You have to provide the category.
Code:
root@mail:~ # fortune freebsd-tips
Can't remember if you've installed a certain port or not? Try "pkg info
-x port_name".
 
The skeleton files (/usr/share/skel/) have all been updated so a new user will get the correct one. An upgrade won't change an existing user's own ~/.login file though. Those will need to be modified by the users themselves.
 
He's a reasonably sophisticated user, so I can just explain the situation and he can edit his own login file. I'd rather explain that it was a political thing than make him think it's "broken"...even though changing default ancient behavior is pretty close to breaking something!

Looks like he wrote his .bash_profile almost 25 years ago.

Thanks, guys, always glad to have an easy one!
 
Back
Top