Artix Linux Forum

Artix Linux => System => Topic started by: mrbrklyn on 22 May 2025, 11:15:07

Title: Incompplete Man Pages
Post by: mrbrklyn on 22 May 2025, 11:15:07
man -k never works.  There is a substantial and useful part of the core unix help system that seems to be missing from the standard distro.

Can't we just lift the man database right out of slackware or something?
Title: Re: Incompplete Man Pages
Post by: clappingsnowdrop on 22 May 2025, 13:00:44
I'm not sure what you mean. Either:

You installed something but the man database isn't updated so man -k isn't showing up any results:
Code: [Select]
sudo mandb 
(Yes root access is required.)

Or manpages are not included in the installation in some programs.
If this then I'm going to assume that this post is for the Artix devs.

for the latter a good example might be:
7zip has no manpages, but p7zip has.
Code: [Select]
pacman -Fl 7zip | grep 'usr/share/man'
vs
pacman -Fl p7zip | grep 'usr/share/man'

edit: p7zip is only within the omniverse repo
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 23 May 2025, 03:52:49
I am not sure how I produced confusion.  I appologize. 

There is a man pacman for man-pages

flatbush:[ruben]:~$ sudo pacman -Ss  man-pages
system/man-pages 6.14-1 [installed]
    Linux man pages


and one for a great many languages.

But it is common to use
man -k

that database is empty and highly useful when one wants to explore different tools.

BTW - THIS
sudo mandb


Does fix the problem but this should work out of the box without intervention.  Thank you for the tip.
Title: Re: Incompplete Man Pages
Post by: gripped on 23 May 2025, 12:17:28
but this should work out of the box without intervention.
That's debatable.

Prior to the introduction of systemd Arch (AFAIKT) did no automatic updating of mandb. Then with systemd they started using a timer service to update mandb daily. Briefly, in 2016, they switched to a pacman hook (probably because they'd just created pacman hooks and wanted to use them?) before reverting back to the timer (https://gitlab.archlinux.org/archlinux/packaging/packages/man-db/-/commit/3c15b0614a4dd84f2e486f936b2ae76af10822a0)

It could be argued that as an Arch derived distro Artix should mirror Arch's behaviour in updating the mandb periodically or use pacman hooks to do so.
It could also be argued that as an Arch based distro without systemd Artix is simply doing what Arch did before systemd i.e. nothing (caveat 'I think').

If you want your mandb bang up to date after every upgrade a hook in /etc/pacman.d/hooks is probably the way to go.
This will of course slow down the process.
I did not know any of this until just now so I thank you for that.
Title: Re: Incompplete Man Pages
Post by: clappingsnowdrop on 23 May 2025, 13:41:03
@mrbrklyn

As what Gripped said it's done with soystemd these days and the alternative is that a pacman hook can be set.

Another way of this is to automate this with a daily cron job.
https://wiki.archlinux.org/title/Cron

If you are unaware it's a program that runs programs/scripts repeatedly on a set schedule (every minute, hourly, daily, weekly, monthly, yearly, or a custom schedule like every 1pm, 9pm of every other week in every 2 months for example.)

If the wiki is confusing (for me it is), this is also a good source: https://www.youtube.com/watch?v=7cbP7fzn0D8
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 23 May 2025, 20:11:07
but this should work out of the box without intervention.
That's debatable.

Prior to the introduction of systemd Arch (AFAIKT) did no automatic updating of mandb. Then with systemd they started using a timer service to update mandb daily. Briefly, in 2016, they switched to a pacman hook (probably because they'd just created pacman hooks and wanted to use them?) before reverting back to the timer (https://gitlab.archlinux.org/archlinux/packaging/packages/man-db/-/commit/3c15b0614a4dd84f2e486f936b2ae76af10822a0)

It could be argued that as an Arch derived distro Artix should mirror Arch's behaviour in updating the mandb periodically or use pacman hooks to do so.
It could also be argued that as an Arch based distro without systemd Artix is simply doing what Arch did before systemd i.e. nothing (caveat 'I think').

If you want your mandb bang up to date after every upgrade a hook in /etc/pacman.d/hooks is probably the way to go.
This will of course slow down the process.
I did not know any of this until just now so I thank you for that.


This has nothing to do with systemd.  Man pages has been a core part of Unix systems since the inception at AT&T (actually I don't know that but I am guessing since it has been taught to me to use them since 1994 or so).    If you want to know how sound works, you can run
Code: [Select]
man -k sound

It is a core part of the unix design  How it is implement is a design decision.  Not having it implemented at all,  that is an error in judgement.

or if you code

Code: [Select]
man -k printf
Title: Re: Incompplete Man Pages
Post by: lotuskip on 23 May 2025, 20:37:06
To get history right, 'man' is a core piece of old UNIX, while 'man -k' for accessing the database is not quite so.
See for instance man page for man from 7th Ed UNIX (https://man.freebsd.org/cgi/man.cgi?query=man&apropos=0&sektion=0&manpath=Unix+Seventh+Edition&arch=default&format=html), where '-k' does something very different. (Yes, I know that's from 46 years ago. But still. That's oldcore UNIX!)

I for one use 'man' a lot, 'man -k' never. So for me building the database would be a waste of resources. I say let those who want it generate it. I'm not arguing that it wouldn't be a good functionality. I'm sure it is. But not everybody needs it.
Title: Re: Incompplete Man Pages
Post by: gripped on 23 May 2025, 20:45:50
This has nothing to do with systemd.
Okey-doke.
You can lead a horse to water but you can't make him think....
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 24 May 2025, 00:03:02
This has nothing to do with systemd.
Okey-doke.
You can lead a horse to water but you can't make him think....


Neee Neee

Why do cows have bells?

man man

Quote
HISTORY
       1990, 1991 – Originally written by John W. Eaton ([email protected]).
 
       Dec 23 1992: Rik Faith ([email protected]) applied bug fixes supplied  by
       Willem Kasdorp ([email protected]).
 
       30th  April 1994 – 23rd February 2000: Wilf. ([email protected])
       has been developing and maintaining this package with the help of a  few
       dedicated people.
 
       30th  October  1996  –  30th  March 2001: Fabrizio Polacco <fpolacco@de‐
       bian.org> maintained and enhanced this package for the  Debian  project,
       with the help of all the community.
 
       31st March 2001 – present day: Colin Watson <[email protected]> is now
       developing and maintaining man-db.
 
Title: Re: Incompplete Man Pages
Post by: clappingsnowdrop on 24 May 2025, 00:04:13

That's debatable.

Prior to the introduction of systemd Arch (AFAIKT) did no automatic updating of mandb. Then with systemd they started using a timer service to update mandb daily. Briefly, in 2016, they switched to a pacman hook (probably because they'd just created pacman hooks and wanted to use them?) before reverting back to the timer (https://gitlab.archlinux.org/archlinux/packaging/packages/man-db/-/commit/3c15b0614a4dd84f2e486f936b2ae76af10822a0)

It could be argued that as an Arch derived distro Artix should mirror Arch's behaviour in updating the mandb periodically or use pacman hooks to do so.
It could also be argued that as an Arch based distro without systemd Artix is simply doing what Arch did before systemd i.e. nothing (caveat 'I think').

This has nothing to do with systemd.

But it does:
On the first sentence in the Cron arch page link I gave above:
Quote
There are many cron implementations, but none of them are installed by default as the base system uses systemd/Timers instead.
I looked into their gitlab site, but I can't find anything that's too old.
In the forums there seems to be implications that Cron was used in tandem with mandb.
https://bbs.archlinux.org/viewtopic.php?id=93244


and it seems to solidify (not conclusive but good enough) gripped's assumption of:
It could also be argued that as an Arch based distro without systemd Artix is simply doing what Arch did before systemd i.e. nothing (caveat 'I think').
https://bbs.archlinux.org/viewtopic.php?pid=616805#p616805



Checked in my kvm endeavouros:
Code: [Select]
cat /usr/lib/systemd/system/timers.target.wants/man-db.timer

[Unit]
Description=Daily man-db regeneration
Documentation=man:mandb(8)

[Timer]
OnCalendar=daily
RandomizedDelaySec=12h
Persistent=true

[Install]
WantedBy=timers.target


It is a core part of the unix design  How it is implement is a design decision.  Not having it implemented at all,  that is an error in judgement.

To understand, in what you're really implying for is that Artix should have already installed Cron by default or something similar that would automate mandb?
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 24 May 2025, 00:51:59
I have never seen a working distro since the early 1990s and before without a working man and apropos

until now
Title: Re: Incompplete Man Pages
Post by: gripped on 24 May 2025, 00:55:32
You are making yourself look silly again. Just saying.
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 24 May 2025, 02:29:31
You are making yourself look silly again. Just saying.


It is not silly to expect  the Man Pages to work correctly out of the box.  I don't even know why we are in a side conversation about systemd and the history of Arch.  And I have no idea why you are making this personal.

Early Linux versions came, not only, with complete man pages, but a series of HowTo's that were critical learning tools.  This was all YEARS befores  Judd Vinet started Arch in March 2002.  The Howtos taught about terminals, ttys, init systems, socket programming, semiphores, pipes, routing strategy, packet filtering etc etc.

 The Man pages would let you find programs to tasks and syntax for core C and C++ programming, not to mention use of Make and autoconf.

Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 24 May 2025, 03:43:20

This has nothing to do with systemd.

But it does:
On the first sentence in the Cron arch page link I gave above:
Quote
There are many cron implementations, but none of them are installed by default as the base system uses systemd/Timers instead.
I looked into their gitlab site, but I can't find anything that's too old.
In the forums there seems to be implications that Cron was used in tandem with mandb.
https://bbs.archlinux.org/viewtopic.php?id=93244


and it seems to solidify (not conclusive but good enough) gripped's assumption of:
It could also be argued that as an Arch based distro without systemd Artix is simply doing what Arch did before systemd i.e. nothing (caveat 'I think').
https://bbs.archlinux.org/viewtopic.php?pid=616805#p616805



Checked in my kvm endeavouros:
Code: [Select]
cat /usr/lib/systemd/system/timers.target.wants/man-db.timer

[Unit]
Description=Daily man-db regeneration
Documentation=man:mandb(8)

[Timer]
OnCalendar=daily
RandomizedDelaySec=12h
Persistent=true

[Install]
WantedBy=timers.target


It is a core part of the unix design  How it is implement is a design decision.  Not having it implemented at all,  that is an error in judgement.

To understand, in what you're really implying for is that Artix should have already installed Cron by default or something similar that would automate mandb?


If I am no mistaken, cron IS installed by default.  Why would it not be?  How else do you do routine timely system maintenance like rotating system logs etc?
Title: Re: Incompplete Man Pages
Post by: gripped on 24 May 2025, 11:57:48
It is not silly to expect  the Man Pages to work correctly out of the box.  I don't even know why we are in a side conversation about systemd and the history of Arch.  And I have no idea why you are making this personal.
What's silly is to have it explained how we got to where we are at with the little used 'man -k' & 'man -f' not working, unless you manually update the database, and then state "This has nothing to do with systemd". Because it's handled by systemd on Arch. Handled by nothing on Artix. To me that's a systemd involvement even if indirectly.

I wonder about this: As someone who's used Artix a long time how is it you've only just noticed that  'man -k' & 'man -f' don't work 'out of the box'? One might suspect that it's not actually a feature you use much at all? Or have you just been stewing on this for years, regularly running 'man-k', discovering it still doesn't work, but doing nothing to remedy it. Because that might also be considered a bit silly by some. Certainly by me.

Your original post was
Quote
man -k never works.  There is a substantial and useful part of the core unix help system that seems to be missing from the standard distro.

Can't we just lift the man database right out of slackware or something?
Lift it out of Slackware ?
How about you just read the man page for man ? (bit ironic really)
Quote
u, --update

This option causes man to update its database caches of installed manual pages. This is only needed in rare situations, and it is normally better to run mandb(8) instead

man mandb
Quote
NAME

mandb - create or update the manual page index caches

I took no position in whether or not Artix should update mandb automatically. But on consideration I think, if anything, it should be a periodic thing, not a pacman hook, as the later would introduce regular lengthening of the time taken to complete pacman upgrades and installs for a feature used by very few. A cron job would not cover everyone as no cron is installed by default on a base install.

The thread started silly and just gets sillier :)
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 24 May 2025, 12:15:52
Quote
As someone who's used Artix a long time how is it you've only just noticed that  'man -k' & 'man -f' don't work 'out of the box'?


No I noticed this right away and this might not even be the first time I asked about this.  And it has been quite crippling.  I am very relieved to have gotten a manual solutions and NOW I can run

man -k openrc

Quote
flatbush:[ruben]:~$ man -k openrc
openrc (8)           - stops and starts services for the specified runlevel       
openrc-init (8)      - the parent of all processes                                
openrc-run (8)       - a means of hooking shell commands into a service           
openrc-settingsd (8) - system settings D-Bus service for OpenRC                   
openrc-shutdown (8)  - bring the system down                                      
rc-service (8)       - locate and run an OpenRC service with the given arguments
rc_config (3)        - functions to query OpenRC service configurations
rc_config_list (3)   - functions to query OpenRC service configurations
rc_config_load (3)   - functions to query OpenRC service configurations
rc_config_value (3)  - functions to query OpenRC service configurations
rc_plugin_hook (3)   - hooks plugins into OpenRC services
rc_service (3)       - functions to query OpenRC services
rc_service_add (3)   - functions to query OpenRC services
rc_service_daemon_set (3) - functions to query OpenRC services
rc_service_daemons_crashed (3) - functions to query OpenRC services
rc_service_delete (3) - functions to query OpenRC services
rc_service_description (3) - functions to query OpenRC services
rc_service_exists (3) - functions to query OpenRC services
rc_service_extra_commands (3) - functions to query OpenRC services
rc_service_in_runlevel (3) - functions to query OpenRC services
rc_service_mark (3)  - functions to query OpenRC services
rc_service_plugable (3) - functions to query OpenRC services
rc_service_resolve (3) - functions to query OpenRC services
rc_service_schedule_clear (3) - functions to query OpenRC services
rc_service_schedule_start (3) - functions to query OpenRC services
rc_service_delete (3) - functions to query OpenRC services
rc_service_description (3) - functions to query OpenRC services
rc_service_exists (3) - functions to query OpenRC services
rc_service_extra_commands (3) - functions to query OpenRC services
rc_service_in_runlevel (3) - functions to query OpenRC services
rc_service_mark (3)  - functions to query OpenRC services
rc_service_plugable (3) - functions to query OpenRC services
rc_service_resolve (3) - functions to query OpenRC services
rc_service_schedule_clear (3) - functions to query OpenRC services
rc_service_schedule_start (3) - functions to query OpenRC services
rc_service_started_daemon (3) - functions to query OpenRC services
rc_service_state (3) - functions to query OpenRC services
rc_service_value_get (3) - functions to query OpenRC services
rc_service_value_set (3) - functions to query OpenRC services
rc_services_in_runlevel (3) - functions to query OpenRC services
rc_services_in_state (3) - functions to query OpenRC services
rc_services_scheduled (3) - functions to query OpenRC services
rc_services_scheduled_by (3) - functions to query OpenRC services
rc_yesno (3)         - functions to query OpenRC service configurations

No I am feeling like Jim on Taxi with wild eyes and saying... OOOOHHHH
Look  - it has it all!


BTW -
flatbush:[ruben]:~$ sudo pacman -Ss man|wc
   4366   21896  194052
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 24 May 2025, 12:24:31
Quote
As someone who's used Artix a long time how is it you've only just noticed that  'man -k' & 'man -f' don't work 'out of the box'?


No I noticed this right away and this might not even be the first time I asked about this.  And it has been quite crippling.  I am very relieved to have gotten a manual solutions and NOW I can run

man -k openrc

Quote
flatbush:[ruben]:~$ man -k openrc
openrc (8)           - stops and starts services for the specified runlevel       
openrc-init (8)      - the parent of all processes                                
openrc-run (8)       - a means of hooking shell commands into a service           
openrc-settingsd (8) - system settings D-Bus service for OpenRC                   
openrc-shutdown (8)  - bring the system down                                      
rc-service (8)       - locate and run an OpenRC service with the given arguments
rc_config (3)        - functions to query OpenRC service configurations
rc_config_list (3)   - functions to query OpenRC service configurations
rc_config_load (3)   - functions to query OpenRC service configurations
rc_config_value (3)  - functions to query OpenRC service configurations
rc_plugin_hook (3)   - hooks plugins into OpenRC services
rc_service (3)       - functions to query OpenRC services
rc_service_add (3)   - functions to query OpenRC services
rc_service_daemon_set (3) - functions to query OpenRC services
rc_service_daemons_crashed (3) - functions to query OpenRC services
rc_service_delete (3) - functions to query OpenRC services
rc_service_description (3) - functions to query OpenRC services
rc_service_exists (3) - functions to query OpenRC services
rc_service_extra_commands (3) - functions to query OpenRC services
rc_service_in_runlevel (3) - functions to query OpenRC services
rc_service_mark (3)  - functions to query OpenRC services
rc_service_plugable (3) - functions to query OpenRC services
rc_service_resolve (3) - functions to query OpenRC services
rc_service_schedule_clear (3) - functions to query OpenRC services
rc_service_schedule_start (3) - functions to query OpenRC services
rc_service_delete (3) - functions to query OpenRC services
rc_service_description (3) - functions to query OpenRC services
rc_service_exists (3) - functions to query OpenRC services
rc_service_extra_commands (3) - functions to query OpenRC services
rc_service_in_runlevel (3) - functions to query OpenRC services
rc_service_mark (3)  - functions to query OpenRC services
rc_service_plugable (3) - functions to query OpenRC services
rc_service_resolve (3) - functions to query OpenRC services
rc_service_schedule_clear (3) - functions to query OpenRC services
rc_service_schedule_start (3) - functions to query OpenRC services
rc_service_started_daemon (3) - functions to query OpenRC services
rc_service_state (3) - functions to query OpenRC services
rc_service_value_get (3) - functions to query OpenRC services
rc_service_value_set (3) - functions to query OpenRC services
rc_services_in_runlevel (3) - functions to query OpenRC services
rc_services_in_state (3) - functions to query OpenRC services
rc_services_scheduled (3) - functions to query OpenRC services
rc_services_scheduled_by (3) - functions to query OpenRC services
rc_yesno (3)         - functions to query OpenRC service configurations

No I am feeling like Jim on Taxi with wild eyes and saying... OOOOHHHH
Look  - it has it all!


BTW -
flatbush:[ruben]:~$ sudo pacman -Ss man|wc
   4366   21896  194052



and man-db is a separate package from man-pages
Title: Re: Incompplete Man Pages
Post by: clappingsnowdrop on 24 May 2025, 13:17:25
If I am no mistaken, cron IS installed by default.  Why would it not be?  How else do you do routine timely system maintenance like rotating system logs etc?

So I had to do a quick check on default stable iso releases since my installation is manual (had to do a custom setup for my needs so using my setup isn't the best reference to use). I don't have cronie. I've written scripts for my automation needs.

On the stable Xfce and Plasma s6-init images. Yes cronie is installed, but no entry for mandb in crontab nor in cron.daily folder.

You'll have to take this inquiry to the Artix devs because this matter is OS default setup.

As for the Unix design you've mentioned earlier, that will have to be in another thread. I do not mind talking about it. But a different thread just to keep it organized.

Since the matter has been solved (about man -k not showing anything). There's nothing else for me to say in this matter.

My last cent for you. Just use a daily cron job to automate this. The video link I gave is really easy to absorb. There are other methods(that I can think of), but it'd require you to write a bash(with sudo mandb whitelist) or an init script (I prefer writing a script because I don't have to install cron just for mandb but is less user friendly).

Cheers.
Title: Re: Incompplete Man Pages
Post by: ####### on 24 May 2025, 13:55:25
With Debian based systems this is run on updates, possibly only when packages with man pages are updated, but that is pretty much every time. It can take a long time to run, e.g. trying here after not having run it for ages, then again to compare:
Code: [Select]
$ time sudo mandb
...
109 man subdirectories contained newer manual pages.
29798 manual pages were added.
0 stray cats were added.
482 old database entries were purged.

real 0m28.751s
user 0m0.097s
sys 0m0.092s

$ time sudo mandb
...
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.

real 0m0.606s
user 0m0.022s
sys 0m0.022s
So it can potentially slow down updates quite a bit. I run it manually before using man -k which I rarely do, although admittedly it's something I only found out about after a few years of using Artix. As mandb is only needed if the man pages are changed, a cron job seems inefficient, and man -k wouldn't give the correct results until the next day if you installed new or updated packages just after it had completed it's daily run. Perhaps there should be some mention of mandb in the Artix wiki under installation or configuration, as there doesn't seem to be at present?
Title: Re: Incompplete Man Pages
Post by: gripped on 24 May 2025, 15:08:38
No I noticed this right away and this might not even be the first time I asked about this.  And it has been quite crippling.  I am very relieved to have gotten a manual solutions and NOW I can run
Unless the index only goes back so far Search suggests this is the first time you posted about man pages, at least on this site.
If it was crippling for years I fail to understand why you wouldn't a. read the man page for man & b. just ask ?

I'm glad you have it working now. I also thanked you already because I learnt something I didn't know. But I'll thank you again.
But I do think you could be a little bit more gracious when someone takes the time to explain why something isn't working as expected and gives a possible way to remedy it
Title: Re: Incompplete Man Pages
Post by: mrbrklyn on 24 May 2025, 15:30:27
No I noticed this right away and this might not even be the first time I asked about this.  And it has been quite crippling.  I am very relieved to have gotten a manual solutions and NOW I can run
Unless the index only goes back so far Search suggests this is the first time you posted about man pages, at least on this site.
If it was crippling for years I fail to understand you wouldn't a. read the man page for man & b. just ask ?

I'm glad you have it working now. I also thanked you already because I learnt something I didn't know. But I'll thank you again.
But I do think you could be a little bit more gracious when someone takes the time to explain why something isn't working as expected and gives a possible way to remedy it

Ah - I am sorry if I didn't seem gracious.  Thank you for your diligence and help.
Title: Re: Incompplete Man Pages
Post by: ugluk on 26 May 2025, 14:17:05
I uninstall cron first thing.