/usr/share/tcos/hooks-addons/16dbus-avahi is in initramfs-tools-tcos 0.89.93ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 103 104 105 106 107 108 | # hook to include DBus/avahi
# need dbus,dbus-x11,avahi-daemon packages
if [ -n "$TCOS_DBUS" ]; then
stat_before
mkdir -p $DESTDIR/usr/lib/dbus-1.0
mkdir -p $DESTDIR/etc/dbus-1/system.d
mkdir -p $DESTDIR/etc/dbus-1/session.d
cpifexists $(which dbus-daemon) /usr/bin/
cpifexists $(which dbus-uuidgen) /usr/bin/
cpifexists /usr/bin/dbus-launch /usr/bin/
cpifexists /etc/dbus-1/system.conf /etc/dbus-1/
cpifexists /etc/dbus-1/session.conf /etc/dbus-1/
if [ -f /etc/dbus-1/system.d/pulseaudio-system.conf ]; then
cpifexists /etc/dbus-1/system.d/pulseaudio-system.conf /etc/dbus-1/system.d/
fi
cat << EOF >> $DESTDIR/etc/passwd
messagebus:x:104:107::/var/run/dbus:/bin/false
avahi:x:106:113:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
EOF
cat << EOF >> $DESTDIR/etc/shadow
messagebus:*:14994:0:99999:7:::
avahi:*:14994:0:99999:7:::
EOF
cat << EOF >> $DESTDIR/etc/group
messagebus:x:107:
netdev:x:111:
avahi:x:113:
EOF
cat << EOF > $DESTDIR/scripts/tcos-bottom/15dbus-avahi
#!/bin/sh
if [ "\$1" = "prereqs" ]; then
exit 0
fi
mkdir -p /var/run/dbus /var/lib/dbus
mkdir -p /var/run/avahi-daemon
chown avahi:avahi /var/run/avahi-daemon
chmod 755 /var/run/avahi-daemon
chown messagebus:messagebus /var/lib/dbus /var/run/dbus
dbus-uuidgen > /var/lib/dbus/machine-id
start-stop-daemon --start --quiet --pidfile /var/run/dbus/dbus.pid \
--user messagebus --exec /usr/bin/dbus-daemon -- --system
[ -x /usr/sbin/avahi-daemon ] && avahi-daemon --no-drop-root -D
EOF
chmod +x $DESTDIR/scripts/tcos-bottom/15dbus-avahi
stat_after "DBus-Avahi"
fi # end of TCOS_DBUS
###############################################################################
if [ -n "$TCOS_AVAHI" ]; then
# avahi-utils avahi-daemon
cpifexists /usr/sbin/avahi-daemon /usr/bin/
mkdir -p $DESTDIR/var/run/avahi-daemon
mkdir -p $DESTDIR/etc/avahi/services
cpifexists /etc/avahi/avahi-daemon.conf /etc/avahi
cat << EOF > $DESTDIR/etc/nsswitch.conf
passwd: compat
group: compat
shadow: compat
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
EOF
cpifexists /etc/dbus-1/system.d/avahi-dbus.conf /etc/dbus-1/system.d/
cat << EOF > $DESTDIR/etc/avahi/services/tcos.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">tcos-%h</name>
<service>
<type>_workstation._tcp</type>
</service>
<service>
<type>_http._tcp</type>
<port>8998</port>
</service>
</service-group>
EOF
stat_after "Avahi"
fi # end of TCOS_AVAHI
|