Print
Category: Solaris
Hits: 949

When the system is installed repository.db is under 10Mb, but as the system is configured, the repository gets bigger and bigger. I've seen repositories of 150Mb or more. This triggers the error, as repository.db spends lots of cpu and memory reading the file.

One current example:

# ls -lah /etc/svc/repository.db
-rw------- 1 root root 66M Nov 25 08:21 /etc/svc/repository.db

# prstat
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
15 root 80016K 76216K cpu1 20 0 0:02:59 11.50% svc.configd/31

# truss -p 15
/15: pread(4, "\r B ;02 O $ P\0 B1A AF5".., 32768, 0x013C8000) = 32768
/15: pread(4, "\r\0\002 b $ i\0 AFC AD5".., 32768, 0x013F8000) = 32768
...
repeated a lot

# pfiles 15
...
4: S_IFREG mode:0600 dev:240,65538 ino:94218 uid:0 gid:0 size:68911104 (66MB)
O_RDWR|O_CREAT|O_LARGEFILE FD_CLOEXEC
advisory write lock set by process 15
/etc/svc/repository.db
offset:0

In my case it was a buggy config of ldap/client which caused lots of entries at the repository.db files.

I had to recreate repository.db from scratch:

vi /etc/svc/profile/sysconfig/$(hostname).xml
...edited incorrect old info (wrong LDAP server)..

export SVCCFG_DOOR_PATH=/system/volatile/my_repository_door
export SVCCFG_REPOSITORY=/system/volatile/my_repository.db
svccfg import /lib/svc/manifest/*/*
cp /system/volatile/my_repository.db /etc/svc/repository.db
rm /etc/svc/repository-*
reboot

And then all went back to normal:

# ls -lah /etc/svc/repository.db
-rw------- 1 root root 9M Nov 25 10:12 /etc/svc/repository.db

# prstat
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
   15 root      124616K  120320K sleep    59    0   0:00:50 0.000% svc.configd/31