xref: /aosp_15_r20/system/netd/server/netd.rc (revision 8542734a0dd1db395a4d42aae09c37f3c3c3e7a1)
1*8542734aSAndroid Build Coastguard Workerservice netd /system/bin/netd
2*8542734aSAndroid Build Coastguard Worker    class main
3*8542734aSAndroid Build Coastguard Worker    capabilities CHOWN DAC_OVERRIDE DAC_READ_SEARCH FOWNER IPC_LOCK KILL NET_ADMIN NET_BIND_SERVICE NET_RAW SETUID SETGID
4*8542734aSAndroid Build Coastguard Worker    user root
5*8542734aSAndroid Build Coastguard Worker    group root net_admin
6*8542734aSAndroid Build Coastguard Worker    socket dnsproxyd stream 0660 root inet
7*8542734aSAndroid Build Coastguard Worker    socket mdns stream 0660 root system
8*8542734aSAndroid Build Coastguard Worker    socket fwmarkd stream 0660 root inet
9*8542734aSAndroid Build Coastguard Worker    onrestart restart zygote
10*8542734aSAndroid Build Coastguard Worker    onrestart restart zygote_secondary
11*8542734aSAndroid Build Coastguard Worker    # b/121354779: netd itself is not updatable, but on startup it dlopen()s the resolver library
12*8542734aSAndroid Build Coastguard Worker    # from the DNS resolver APEX. Mark it as updatable so init won't start it until all APEX
13*8542734aSAndroid Build Coastguard Worker    # packages are ready.
14*8542734aSAndroid Build Coastguard Worker    updatable
15*8542734aSAndroid Build Coastguard Worker
16*8542734aSAndroid Build Coastguard Worker# Moved from external/android-clat/vendor-464xlat.rc. Since
17*8542734aSAndroid Build Coastguard Worker# clatd is modularized and shipped in apex, migrate the
18*8542734aSAndroid Build Coastguard Worker# clat vendor property to netd.
19*8542734aSAndroid Build Coastguard Worker#
20*8542734aSAndroid Build Coastguard Worker# Certain vendors disable 464xlat by setting a vendor property.
21*8542734aSAndroid Build Coastguard Worker# The connectivity code in the Tethering APEX needs to disable
22*8542734aSAndroid Build Coastguard Worker# 464xlat when the property is set, but it is only allowed to
23*8542734aSAndroid Build Coastguard Worker# access non-vendor system properties. So copy the property to
24*8542734aSAndroid Build Coastguard Worker# a property available to system APIs in android.sysprop.
25*8542734aSAndroid Build Coastguard Worker#
26*8542734aSAndroid Build Coastguard Worker# Arguably this script should live close to the code that uses
27*8542734aSAndroid Build Coastguard Worker# it, but scrips in APEXes are not allowed to use "on property".
28*8542734aSAndroid Build Coastguard Worker# So put it here close to clatd, which is at least related to
29*8542734aSAndroid Build Coastguard Worker# 464xlat.
30*8542734aSAndroid Build Coastguard Workeron property:persist.vendor.net.doxlat=true
31*8542734aSAndroid Build Coastguard Worker    setprop net.464xlat.cellular.enabled true
32*8542734aSAndroid Build Coastguard Worker
33*8542734aSAndroid Build Coastguard Workeron property:persist.vendor.net.doxlat=false
34*8542734aSAndroid Build Coastguard Worker    setprop net.464xlat.cellular.enabled false
35