Problem: Printers are not completely removed

Problem:

Printers are not completely removed.

Step 1:

First use the normal way via UMC to delete the printer.

After that there might be some leftovers:
Check if the printers are not shown in udm anymore

udm shares/printer list |grep DN

Step 2:

Check testparm -sv or samba-tool drs showrepl if they bother with this kind of messages:

Load smb config files from /etc/samba/smb.conf
WARNING: No path in service SUN-PRT05_Kopierraum - making it unavailable!
NOTE: Service SUN-PRT05_Kopierraum is flagged unavailable.
WARNING: No path in service SUN-PRT04_Kopierraum - making it unavailable!
NOTE: Service SUN-PRT04_Kopierraum is flagged unavailable.
Loaded services file OK.

(Bug 41923 )

Step 3:

Leftovers can be found in cups: Pleas check this article 17233

lpstat -a
SUN-PRT04_Kopierraum akzeptiert anfragen seit Sa 07 Mär 2020 06:25:15 CET
SUN-PRT05_Kopierraum akzeptiert anfragen seit Sa 07 Mär 2020 06:25:15 CET

lpadmin -x SUN-PRT05_Kopierraum
lpadmin -x SUN-PRT04_Kopierraum

Step 4:

Check for leftovers from the listener:

# ls -lah /var/cache/univention-printserver
insgesamt 16K
drwxr-xr-x  2 root root    4,0K Mär  3  2020 .
drwxr-xr-x 29 root root    4,0K Dez 27 15:35 ..
-rwxr-xr-x  1 root nogroup  165 Mär  3  2020 1583275982.315447.sh
-rwxr-xr-x  1 root nogroup  165 Mär  3  2020 1583276139.504710.sh
# cat 1583275982.315447.sh
#!/bin/sh
/usr/sbin/univention-lpadmin -u deny:@schueler-sun -p SUN-PRT04_Kopierraum -L Kopierraum -m UTAX-TA/TA5555i.PPD -v lpd://sun-prt04.schein.me -E
 cat 1583276139.504710.sh
#!/bin/sh
/usr/sbin/univention-lpadmin -u deny:@schueler-sun -p SUN-PRT05_Kopierraum -L Kopierraum -m UTAX-TA/TA5555i.PPD -v lpd://sun-prt05.schein.me -E

# mv 158327* ~/univention-support/ 

Step 5:

Leftovers in samba

# ls -lah /var/cache/samba/printing/
-rw------- 1 root root           28K Jan 14 01:42 SUN-PRT04_Kopierraum.tdb
-rw------- 1 root root           28K Jan 20 15:43 SUN-PRT05_Kopierraum.tdb
# mv /var/cache/samba/printing/SUN-PRT05_Kopierraum.tdb ~/univention-support/
# mv /var/cache/samba/printing/SUN-PRT04_Kopierraum.tdb ~/univention-support/

Step 6:

leftovers in der samba registry:

# net registry enumerate 'HKLM\Software\Microsoft\Windows NT\CurrentVersion\Print\Printers\' | grep ^Keyname
Keyname   = SUN-PRT04_Kopierraum
Keyname   = SUN-PRT05_Kopierraum
# net registry deletekey_recursive 'HKLM\Software\Microsoft\Windows NT\CurrentVersion\Print\Printers\'"SUN-PRT04_Kopierraum"
# net registry deletekey_recursive 'HKLM\Software\Microsoft\Windows NT\CurrentVersion\Print\Printers\'"SUN-PRT05_Kopierraum"

Step 7:

check local.config.conf

ls -lah /etc/samba/local.config.conf

root@slave-sun: /etc/samba/local.config.d# mv printer.SUN-PRT04_Kopierraum.local.config.conf ~/univention-support/
root@slave-sun: /etc/samba/local.config.d# mv printer.SUN-PRT05_Kopierraum.local.config.conf ~/univention-support/

And

# rgrep SUN-PRT05 /etc/samba/* 
/etc/samba/local.config.conf:include = /etc/samba/local.config.d/printer.SUN-PRT05_Kopierraum.local.config.conf

Step 7 helped with this problem:
WARNING: No path in service IPC$ - making it unavailable!

2 Likes
Mastodon