I have mouted some volumes from /etc/fstab ( see below )
Because of this the DUC Index did not work, a white screen and an error "Task completed with errors: S20nethserver-duc-index #1 (exit status 256) apeared in red above a white screen.
To solve the problem i removed the block "# remove backup dir elem"
from the file //usr/share/duc/xml2json.py
This is the part that seems to stop the DUC Index from working.
'# remove backup dir elem
if(child.attrib[‘name’] == a[0]):
size = recToDelete(child, a)
child.attrib[‘size_actual’] = str(int(child.attrib[‘size_actual’]) - size)
if(int(child.attrib[‘size_actual’]) < MIN_SIZE):
elem.remove(child)
On one of my servers this was the solution and the DUC Index works again.
On another server i wanted to exclude the /mnt folder from being displayed, it was easy to change this in the same file as above, i jus added a line below in the middle of the block called # remove fake folder.
‘# remove fake folder
for child in elem:
if( child.attrib[‘name’] == ‘dev’ or
child.attrib[‘name’] == ‘proc’ or
child.attrib[‘name’] == ‘sys’ or
’# child.attrib[‘name’] == ‘mnt’ or << Added this for example
child.attrib[‘name’] == ‘selinux’):
elem.remove(child)
It now looks like this, and the DUC Index does not show the /mnt (and subdirs) anymore.
On another server:
I also reoved the '# remove backup dir elem part as described above, but then changed the contents of /etc/e-smith/events/actions/nethserver-duc-index
Under the section: # directory indexing i added the following line
/usr/bin/duc index $INDEX_DIR --exclude=mnt --database=$DUC_DB
After running
signal-event nethserver-duc-save
/etc/e-smith/events/nethserver-duc-save/S20nethserver-duc-index
It seems te produce the same result as the the first method. The /mnt is not shown and the DUC Index works perfect.
Conclusion:
Whenever you see this message in place of your DUC Index:
S20nethserver-duc-index #1 (exit status 256) apeared in red above a white screen.
Check your DUC Index while your mounted storage volume(s) are dismouted.
Example:
umount -a
signal-event nethserver-duc-save
/etc/e-smith/events/nethserver-duc-save/S20nethserver-duc-index
NOW YOUR DUC INDEX WORKS ?
mount -a ( note the difference with above, now mounting again )
signal-event nethserver-duc-save
/etc/e-smith/events/nethserver-duc-save/S20nethserver-duc-index
AGAIN THE ERROR ?
Then remove the “# remove backup dir elem” block from //usr/share/duc/xml2json.py
For who want’s to know, i installed on a VM with a 150 GB SSD as /vdb1 and a 2TB Storage as /vdb2, I changed my /etc/fstab and used bind mounts to relocate some folders to the storage drives.
My /etc/fstab as sample:
/dev/vdb1 /mnt/bigstorage xfs defaults 0 0
/dev/vdb1 /mnt/backup_storage xfs defaults 0 0
/mnt/bigstorage/DATA/opt /opt nofail,x-systemd.device-timeout=1 bind 0 0
/mnt/bigstorage/DATA/media /media nofail,x-systemd.device-timeout=1 bind 0 0
/mnt/bigstorage/DATA/var/lib/nethserver /var/lib/nethserver nofail,x-systemd.device-timeout=1 bind 0 0
/mnt/bigstorage/DATA/var/www /var/www nofail,x-systemd.device-timeout=1 bind 0 0
For me, it fixed the bug…
Greetings from the Netherlands!
Bastiaan de Jonge // Xonline