/
README
103 lines (69 loc) · 3.32 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Bonjour Aliases
==================
A project born of the burning desire to be backwards compatible --
served with a dash of bitterness.
Motivation: CUPS 1.6 started to advertise printers as "printer @ server"
instead of the old "printer @ server.domain.com", thereby making
existing printer entries in MacOS clients unusable. This script eases
the transition period between the two standards (at least it did for me
and my users for all I know).
I elaborated a bit on the corresponding Debian bug report,
<http://bugs.debian.org/717245>.
WARNING: At the moment, all server name patterns are hard-coded, so this
very much only serves my needs. If Bonjour aliases sound like a good
idea to you, I suggest you simply email me and I'll be happy to make
this a all-purpose, all-weather software product.
WARNING 2: This script places a heavy burden on DBUS. I have seen it
crashing a couple of times on a machine that serves multiple interfaces
(each Bonjour record needs to be duplicated for every interface).
Caveat emptor!
While I'm at it...
Disclaimer and Licence
-------------------------
As Pilates once put it: if you choose to use this software, you're
completely on your own. You're responsible for any damage that you
incure by using this code in whatever way. "No fitness for a particular
purpose..." you know the drill.
Licence: Newest GPL. See <https://www.gnu.org/licenses/gpl.html>
This licence covers all code in this repository.
Quick Start
--------------
On Debian, install the requisites and verify that it's doing what it's
supposed to::
apt-get install libavahi-compat-libdnssd1 python-pip
pip install pybonjour
python bonjour_aliases.py
See, if, on a different machine in the same physical net, you can see
the aliases::
avahi-browse -a | grep [pattern]
If happy, install daemontools or runit and symlink this directory under
/etc/service::
apt-get install daemontools-run
update-service --add /root/bonjour_aliases/ bonjour_aliases
Check status, shutdown and start service::
svstat /etc/service/bonjour_aliases
svc -d /etc/service/bonjour_aliases
svc -u /etc/service/bonjour_aliases
After a few days start sending friendly bug reports (to me) and possibly
remind your users to switch their printer entries to the new convention.
Long, Winding Story
--------------------------------------------------------------------
This project currently solves one and only one scenario: It creates
name-aliases to Bonjour records from already published records. Say you
are running a printserver and it publishes your printers like this:
printer1 @ my.domain
You discover that, after an innocuous update, the very same printserver,
for whatever reasons, starts publishing the very same printers with
records named like this[0]:
printer1 @ my
Being the good sysadmin that I am, I wanted my users to not suffer the
inconvenience of discovering that they'd have to remove all Bonjour
printers only to add them again (thereby possibly losing their precious
settings).
The project conveniently includes a 'run' file that's suitable for
supervisors such as daemontools or runit.
[Note: Currently, names are hardcoded in the source code -- please do
contact me if you want a more generic version!]
2013-09-05, by Hagen Fuchs
[0] The printserver in question is the excellent CUPS, updating
from version 1.5 to 1.6.