Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Marc Espie
On Wed, Feb 28, 2018 at 07:48:34PM +, Zsolt Kantor wrote:
> Thanks Sebastien, I just figured out this. Now everything is clear.
> If I may propose something . . . those "Not found" items even if it is not an 
> error, is a little bit misleading . . . From a simple user's point of view 
> the pkg_check -F in normal circumstances should return cleanly. Maybe an 
> extra option for pkg_check in future that tells to show those "Not found" 
> items (by default not to show).
> 

Nope. That's the whole point of pkg_check -F

Notice that it's an option. You enabled it, you want to check the files
on your machine further.

There is definitely some handholding needed afterwards.



Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Chris Bennett
On Wed, Feb 28, 2018 at 07:58:22PM +, Zsolt Kantor wrote:
> 
> 
> By the way. For a simple user (I'm using OpenBSD just for fun, and learning) 
> it is worth to enable the weekly script, or not?
> 

Absolutely! For "fun", check to see all of the things it does.

Do you need to run it weekly? You can decide that for yourself.
I always run it immediately after an install or upgrade.
And I run it again after adding the packages I use.
/bin/sh /etc/weekly

Did you write a useful script and you forgot where you put it?
locate cool_script.pl
Then you can edit it or possibly want to run it securely?
/usr/bin/perl /usr/local/sbin/cool_script.pl
instead of evil hacker's /usr/bin/cool_script.pl that does nasty things!
try echo $PATH to see what version gets run first.

OpenBSD is a lot of fun and a fantastic system to learn the "right" way
to do things.

My advice is to read a few man pages every day for every program in the
base install.

Also, if you don't like reading man pages as they come up, read man
mandoc and see how you can make them html or pdf, etc.

Have fun! I do.
Chris Bennett




Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Zsolt Kantor


By the way. For a simple user (I'm using OpenBSD just for fun, and learning) it 
is worth to enable the weekly script, or not?

Thanks,
Zsolt



Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Zsolt Kantor
Thanks Sebastien, I just figured out this. Now everything is clear.
If I may propose something . . . those "Not found" items even if it is not an 
error, is a little bit misleading . . . From a simple user's point of view the 
pkg_check -F in normal circumstances should return cleanly. Maybe an extra 
option for pkg_check in future that tells to show those "Not found" items (by 
default not to show).



On Wednesday, February 28, 2018 9:06 PM, Sebastien Marie  
wrote:



On Wed, Feb 28, 2018 at 06:56:17PM +, Zsolt Kantor wrote:

> Another question.
> pkg_check -F uses pkg_locate script to locate package files, directories.
> pkg_locate uses locate to do that.
> Question: If I use pkg_locate bsd.rd nothing is returned, but if I use locate 
> bsd.rd the ramdisk kernel is returned. Why? Is pkg_locate not working 
> correctly? Or I'm missing something?

pkg_locate uses a database populated with all files from ports
(installed packages or not).

locate uses a database populated with updatedb, and it contains only
files installed on filesystem (it is updated weekly).

so pkg_locate bsd.rd searchs if a file "bsd.rd" exists in some port
(installed or not); whereas locate bsd.rd searchs if a file "bsd.rd"
exists in current filesystem.

-- 
Sebastien Marie



Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Sebastien Marie
On Wed, Feb 28, 2018 at 06:56:17PM +, Zsolt Kantor wrote:
> Another question.
> pkg_check -F uses pkg_locate script to locate package files, directories.
> pkg_locate uses locate to do that.
> Question: If I use pkg_locate bsd.rd nothing is returned, but if I use locate 
> bsd.rd the ramdisk kernel is returned. Why? Is pkg_locate not working 
> correctly? Or I'm missing something?

pkg_locate uses a database populated with all files from ports
(installed packages or not).

locate uses a database populated with updatedb, and it contains only
files installed on filesystem (it is updated weekly).

so pkg_locate bsd.rd searchs if a file "bsd.rd" exists in some port
(installed or not); whereas locate bsd.rd searchs if a file "bsd.rd"
exists in current filesystem.

-- 
Sebastien Marie



Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Zsolt Kantor
Another question.
pkg_check -F uses pkg_locate script to locate package files, directories.
pkg_locate uses locate to do that.
Question: If I use pkg_locate bsd.rd nothing is returned, but if I use locate 
bsd.rd the ramdisk kernel is returned. Why? Is pkg_locate not working 
correctly? Or I'm missing something?



Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Vijay Sankar


Quoting Marc Espie :


On Tue, Feb 27, 2018 at 10:14:51PM +, Zsolt Kantor wrote:
What exactly does the pkg_check -F option?  If I use it, it does  
some filesystem check, and some "Locating unknown files".


At the end I get: "Locating unknown files: ok", "Locating unknown  
directories: ok", and a long list of "not found" directories and  
files, like below.

Not found:
/boot
/bsd
/bsd.rd
/bsd.sp
/bsd.syspatch61
/etc/X11/xenodm/authdir
. . . .


Those are objects that are expected on a normal system, but that are not
there, see the locate(8) dbs under /usr/lib/locate/src.db and
/usr/X11R6/lib/locate/xorg.db

Not having /bsd and /bsd.rd   seems really strange.


I am using 6.2 -current from

builder.ftlcloud.ca$ sysctl kern.version
kern.version=OpenBSD 6.2-current (GENERIC.MP) #6: Sun Feb 18 20:12:24 CST 2018
vi...@builder.ftlcloud.ca:/usr/src/sys/arch/amd64/compile/GENERIC.MP

and ran pkg_check -F

Not much going on on the package build system

builder.ftlcloud.ca$ w
 6:53AM  up 9 days, 10:40, 3 users, load averages: 0.49, 0.26, 0.11
USERTTY FROM  LOGIN@  IDLE WHAT
vijayp0 10.0.0.1546:49AM 0 /usr/bin/perl  
/usr/sbin/pkg_check -F
vijayp1 10.72.3.61   Tue01PM 17:16 /usr/bin/ftp -V -m -C -o  
/usr/ports/

vijayp2 10.0.0.1546:52AM 0 w

There were no "errors" when pkg_check was run using the root account  
but it gave detailed information that helped me understand what was  
wrong with everything I am doing :) Thank you very much for pkg_check.


When running pkg_check using the user account that I use to build  
ports, I did get the type of errors the OP mentioned.


DETAILS BELOW AS ROOT

builder.ftlcloud.ca# pkg_check -F
Packing-list sanity: ok
Direct dependencies: ok
Reverse dependencies: ok
Files from packages: ok
--- e2fsprogs-1.42.12p4 ---
/usr/local/include/et/com_err.h doesn't link to /usr/local/include/com_err.h
/usr/local/man/man3/uuid_generate_random.3 doesn't link to  
/usr/local/man/man3/uuid_generate.3
/usr/local/man/man3/uuid_generate_time.3 doesn't link to  
/usr/local/man/man3/uuid_generate.3

/usr/local/man/man5/ext3.5 doesn't link to /usr/local/man/man5/ext2.5
/usr/local/man/man5/ext4.5 doesn't link to /usr/local/man/man5/ext2.5
/usr/local/man/man8/fsck.ext2.8 doesn't link to /usr/local/man/man8/e2fsck.8
/usr/local/man/man8/fsck.ext3.8 doesn't link to /usr/local/man/man8/e2fsck.8
/usr/local/man/man8/fsck.ext4.8 doesn't link to /usr/local/man/man8/e2fsck.8
/usr/local/man/man8/fsck.ext4dev.8 doesn't link to  
/usr/local/man/man8/e2fsck.8

/usr/local/man/man8/mkfs.ext2.8 doesn't link to /usr/local/man/man8/mke2fs.8
/usr/local/man/man8/mkfs.ext3.8 doesn't link to /usr/local/man/man8/mke2fs.8
/usr/local/man/man8/mkfs.ext4.8 doesn't link to /usr/local/man/man8/mke2fs.8
/usr/local/man/man8/mkfs.ext4dev.8 doesn't link to  
/usr/local/man/man8/mke2fs.8

/usr/local/sbin/findfs doesn't link to /usr/local/sbin/e2label
/usr/local/sbin/fsck.ext2 doesn't link to /usr/local/sbin/e2fsck
/usr/local/sbin/fsck.ext3 doesn't link to /usr/local/sbin/e2fsck
/usr/local/sbin/fsck.ext4 doesn't link to /usr/local/sbin/e2fsck
/usr/local/sbin/fsck.ext4dev doesn't link to /usr/local/sbin/e2fsck
/usr/local/sbin/mkfs.ext2 doesn't link to /usr/local/sbin/mke2fs
/usr/local/sbin/mkfs.ext3 doesn't link to /usr/local/sbin/mke2fs
/usr/local/sbin/mkfs.ext4 doesn't link to /usr/local/sbin/mke2fs
/usr/local/sbin/mkfs.ext4dev doesn't link to /usr/local/sbin/mke2fs
/usr/local/sbin/tune2fs doesn't link to /usr/local/sbin/e2label
--- g95-4.9.4p7 ---
/usr/local/bin/x86_64-unknown-openbsd6.2-egfortran doesn't link to  
/usr/local/bin/egfortran

--- gawk-4.2.0 ---
/usr/local/bin/gawk-4.2.0 doesn't link to /usr/local/bin/gawk
--- gcc-4.9.4p7 ---
/usr/local/bin/x86_64-unknown-openbsd6.2-egcc doesn't link to  
/usr/local/bin/egcc
/usr/local/bin/x86_64-unknown-openbsd6.2-egcc-ar doesn't link to  
/usr/local/bin/egcc-ar
/usr/local/bin/x86_64-unknown-openbsd6.2-egcc-nm doesn't link to  
/usr/local/bin/egcc-nm
/usr/local/bin/x86_64-unknown-openbsd6.2-egcc-ranlib doesn't link to  
/usr/local/bin/egcc-ranlib
/usr/local/bin/x86_64-unknown-openbsd6.2-gcc-4.9.4 doesn't link to  
/usr/local/bin/egcc

--- iodbc-3.52.12 ---
/usr/local/man/man1/iodbctestw.1 doesn't link to  
/usr/local/man/man1/iodbctest.1

--- libexecinfo-0.3p0v0 ---
/usr/local/man/man3/backtrace_symbols.3 doesn't link to  
/usr/local/man/man3/backtrace.3
/usr/local/man/man3/backtrace_symbols_fd.3 doesn't link to  
/usr/local/man/man3/backtrace.3

--- python-3.6.4 ---
/usr/local/bin/python3.6m doesn't link to /usr/local/bin/python3.6
.
.
.

In dbus-1.12.2p0v0:x11/dbus,-main:
/etc/machine-id
In isc-dhcp-server-4.3.6p0:net/isc-dhcp,-main:
/var/db/dhcpd.leases
In libxml-2.9.7:textproc/libxml,-main:
/var/db/xmlcatalog
In 

Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Sebastien Marie
On Wed, Feb 28, 2018 at 12:51:46PM +0100, Marc Espie wrote:
> On Tue, Feb 27, 2018 at 10:14:51PM +, Zsolt Kantor wrote:
> > What exactly does the pkg_check -F option?  If I use it, it does some 
> > filesystem check, and some "Locating unknown files".
> > 
> > At the end I get: "Locating unknown files: ok", "Locating unknown 
> > directories: ok", and a long list of "not found" directories and files, 
> > like below.
> > Not found:
> > /boot
> > /bsd
> > /bsd.rd
> > /bsd.sp
> > /bsd.syspatch61
> > /etc/X11/xenodm/authdir
> > . . . . 
> 
> Those are objects that are expected on a normal system, but that are not
> there, see the locate(8) dbs under /usr/lib/locate/src.db and 
> /usr/X11R6/lib/locate/xorg.db   
> 
> Not having /bsd and /bsd.rd   seems really strange.
> 

hum ? for me, it is the opposite.

pkg_check looks at {src,xorg}.db and PKG_DB for the list of expected
files. But these files aren't in these lists, so it reports them as "not
found" in the list of expected files.

For /bsd{,.rd} it is normal: the files don't come with usual sets but
are copied "as it".

-- 
Sebastien Marie



Re: Please explain the pkg_check F option, thank you.

2018-02-28 Thread Marc Espie
On Tue, Feb 27, 2018 at 10:14:51PM +, Zsolt Kantor wrote:
> What exactly does the pkg_check -F option?  If I use it, it does some 
> filesystem check, and some "Locating unknown files".
> 
> At the end I get: "Locating unknown files: ok", "Locating unknown 
> directories: ok", and a long list of "not found" directories and files, like 
> below.
> Not found:
> /boot
> /bsd
> /bsd.rd
> /bsd.sp
> /bsd.syspatch61
> /etc/X11/xenodm/authdir
> . . . . 

Those are objects that are expected on a normal system, but that are not
there, see the locate(8) dbs under /usr/lib/locate/src.db and 
/usr/X11R6/lib/locate/xorg.db   

Not having /bsd and /bsd.rd   seems really strange.



Please explain the pkg_check F option, thank you.

2018-02-27 Thread Zsolt Kantor
What exactly does the pkg_check -F option?  If I use it, it does some 
filesystem check, and some "Locating unknown files".

At the end I get: "Locating unknown files: ok", "Locating unknown directories: 
ok", and a long list of "not found" directories and files, like below.
Not found:
/boot
/bsd
/bsd.rd
/bsd.sp
/bsd.syspatch61
/etc/X11/xenodm/authdir
. . . . 


At the really end I get this: Locating unknown directories: ok

I don't understand what is with that list of "not found" files.
In the manual page it does not say much about this option (or I don't 
understand much), it only states: "-F  Check the filesystem for random 
objects.".

Q1: What are those random objects?
Q2: It actually checks the file system?? (like fsck)
Q3: What's about that long list of not found directories and files?