Menu

#611 Can find timemachine back disk when using $u in path

None
closed
nobody
None
1
2023-04-10
2016-04-07
No

Hi everyone, how are you?

My os is: Centos 7.0
Netatalk:3.1.8

afp.conf file:

;
; Netatalk 3.x configuration file
;

[Global]
mimic model = TimeCapsule6,106
log level = default:maxdebug
log file = /var/log/afpd.log
hosts allow = 172.16.0.0/16
ldap server = ldap://dc-c02.similar.il:3268/
ldap auth method = simple
ldap auth dn = cn=test,dc=similar,dc=il
ldap auth pw = Kofifo31
ldap userbase = ou=SimilarIL,dc=Similar,dc=IL
ldap userscope = one
ldap groupbase = ou=Security groups,ou=SimilarIL,dc=Similar,dc=il
ldap groupscope = one
ldap uuid attr = objectGUID
ldap name attr = sAMAccountName
ldap group attr = cn

[Homes]
basedir regex = /home

[SimilarWeb TimeMachine]
path = /data/backups/$u
root preexec = "/usr/local/scripts/mk_tm_home $u"
unix priv = yes ea = ad
valid users = "@Domain Users"
time machine = yes

when using path = /data/backups/$u - can't see the "SimilarWeb TimeMachine" disk in mac TimeMachine.
when using path = /data/backups/ - the "SimilarWeb TimeMachine" disk is avaiable.

ldap configuration is working properly but the issue is when i'm connecting to "SimilarWeb TimeMachine" disk and get /data/backups/, the TM backup created in /data/backups/ instead /data/backups/$u. (using /data/backups/)

log file:

Apr 08 00:59:29.047946 cnid_metad[141284] {cnid_metad.c:138} (note:AFPDaemon): shutting down on SIGTERM
Apr 08 00:59:29.047946 afpd[141283] {main.c:105} (note:AFPDaemon): AFP Server shutting down
Apr 08 00:59:29.047959 netatalk[141281] {netatalk.c:158} (info:AFPDaemon): Exiting on SIGTERM
Apr 08 00:59:29.071560 netatalk[141281] {netatalk.c:220} (info:Default): child[141283]: done
Apr 08 00:59:29.071610 netatalk[141281] {netatalk.c:220} (info:Default): child[141284]: done
Apr 08 00:59:29.071623 netatalk[141281] {netatalk.c:472} (note:AFPDaemon): Netatalk AFP server exiting
Apr 08 00:59:29.083117 netatalk[142386] {logger.c:300} (debug:Logger): Setup file logging: type: Default, level: maxdebug, file: /var/log/afpd.log
Apr 08 00:59:29.083240 netatalk[142386] {netatalk_conf.c:2015} (debug:AFPDaemon): CNID Server: localhost:4700
Apr 08 00:59:29.083261 netatalk[142386] {netatalk_conf.c:2058} (debug:AFPDaemon): Global unix charset is UTF8
Apr 08 00:59:29.083272 netatalk[142386] {netatalk_conf.c:2069} (debug:AFPDaemon): Global vol charset is UTF8
Apr 08 00:59:29.083281 netatalk[142386] {netatalk_conf.c:2083} (debug:AFPDaemon): Global mac charset is MAC_ROMAN
Apr 08 00:59:29.083290 netatalk[142386] {netatalk_conf.c:1361} (debug:AFPDaemon): readextmap: loading "/etc/netatalk//extmap.conf"
Apr 08 00:59:29.083382 netatalk[142386] {netatalk_conf.c:1382} (debug:AFPDaemon): readextmap: done
Apr 08 00:59:29.083396 netatalk[142386] {netatalk_conf.c:1486} (debug:AFPDaemon): load_volumes: BEGIN
Apr 08 00:59:29.083406 netatalk[142386] {netatalk_conf.c:1521} (debug:AFPDaemon): load_volumes: no volumes yet
Apr 08 00:59:29.083427 netatalk[142386] {netatalk_conf.c:1553} (debug:AFPDaemon): load_volumes: loading: /etc/netatalk//afp.conf
Apr 08 00:59:29.083535 netatalk[142386] {netatalk_conf.c:1137} (debug:AFPDaemon): readvolfile: BEGIN
Apr 08 00:59:29.083555 netatalk[142386] {netatalk_conf.c:1140} (debug:AFPDaemon): readvolfile: sections: 3
Apr 08 00:59:29.083581 netatalk[142386] {unix.c:444} (debug:AFPDaemon): realpath() cannot resolve path "/data/backups/$u"
Apr 08 00:59:29.083592 netatalk[142386] {netatalk_conf.c:1584} (debug:AFPDaemon): load_volumes: END
Apr 08 00:59:29.083603 netatalk[142386] {netatalk.c:386} (note:Default): Netatalk AFP server starting
Apr 08 00:59:29.084224 netatalk[142386] {afp_zeroconf.c:33} (debug:AFPDaemon): Attempting to register with mDNS using Avahi
Apr 08 00:59:29.088308 netatalk[142386] {afp_avahi.c:94} (info:AFPDaemon): hostname: freenas
Apr 08 00:59:29.088392 netatalk[142386] {afp_avahi.c:106} (info:AFPDaemon): Registering server 'freenas' with Bonjour
Apr 08 00:59:29.089338 cnid_metad[142388] {logger.c:300} (debug:Logger): Setup file logging: type: Default, level: maxdebug, file: /var/log/afpd.log
Apr 08 00:59:29.089443 cnid_metad[142388] {netatalk_conf.c:2015} (debug:AFPDaemon): CNID Server: localhost:4700
Apr 08 00:59:29.089464 cnid_metad[142388] {netatalk_conf.c:2058} (debug:AFPDaemon): Global unix charset is UTF8
Apr 08 00:59:29.089486 cnid_metad[142388] {netatalk_conf.c:2069} (debug:AFPDaemon): Global vol charset is UTF8
Apr 08 00:59:29.089499 cnid_metad[142388] {netatalk_conf.c:2083} (debug:AFPDaemon): Global mac charset is MAC_ROMAN
Apr 08 00:59:29.089506 cnid_metad[142388] {netatalk_conf.c:1361} (debug:AFPDaemon): readextmap: loading "/etc/netatalk//extmap.conf"
Apr 08 00:59:29.089593 cnid_metad[142388] {netatalk_conf.c:1382} (debug:AFPDaemon): readextmap: done
Apr 08 00:59:29.089795 netatalk[142386] {afp_avahi.c:302} (info:AFPDaemon): Successfully started avahi loop.
Apr 08 00:59:29.089823 netatalk[142386] {netatalk.c:456} (note:Default): Registered with Zeroconf
Apr 08 00:59:29.089915 cnid_metad[142388] {cnid_metad.c:509} (note:AFPDaemon): CNID Server listening on localhost:4700
Apr 08 00:59:29.094562 afpd[142387] {logger.c:300} (debug:Logger): Setup file logging: type: Default, level: maxdebug, file: /var/log/afpd.log
Apr 08 00:59:29.094696 afpd[142387] {netatalk_conf.c:2015} (debug:AFPDaemon): CNID Server: localhost:4700
Apr 08 00:59:29.094716 afpd[142387] {netatalk_conf.c:2058} (debug:AFPDaemon): Global unix charset is UTF8
Apr 08 00:59:29.094725 afpd[142387] {netatalk_conf.c:2069} (debug:AFPDaemon): Global vol charset is UTF8
Apr 08 00:59:29.094736 afpd[142387] {netatalk_conf.c:2083} (debug:AFPDaemon): Global mac charset is MAC_ROMAN
Apr 08 00:59:29.094760 afpd[142387] {netatalk_conf.c:1361} (debug:AFPDaemon): readextmap: loading "/etc/netatalk//extmap.conf"
Apr 08 00:59:29.094870 afpd[142387] {netatalk_conf.c:1382} (debug:AFPDaemon): readextmap: done
Apr 08 00:59:29.094894 afpd[142387] {auth.c:1042} (debug:AFPDaemon): auth_load: /usr/lib64/netatalk//, uams_dhx.so uams_dhx2.so
Apr 08 00:59:29.094905 afpd[142387] {auth.c:1056} (debug:AFPDaemon): uam: loading (/usr/lib64/netatalk//uams_dhx.so)
Apr 08 00:59:29.095459 afpd[142387] {auth.c:1063} (debug:AFPDaemon): uam: uams_dhx.so loaded
Apr 08 00:59:29.095482 afpd[142387] {auth.c:1056} (debug:AFPDaemon): uam: loading (/usr/lib64/netatalk//uams_dhx2.so)
Apr 08 00:59:29.095664 afpd[142387] {uams_dhx2_pam.c:934} (debug:UAMS): DHX2: generating mersenne primes
Apr 08 00:59:29.399565 afpd[142387] {auth.c:1063} (debug:AFPDaemon): uam: uams_dhx2.so loaded
Apr 08 00:59:29.399649 afpd[142387] {status.c:644} (info:AFPDaemon): signature is 07756FEF774F9D4E5D9EA7C49C6BC262
Apr 08 00:59:29.399664 afpd[142387] {afp_config.c:102} (debug:AFPDaemon): DSIConfigInit: hostname: freenas, listen: -, interfaces: -, port: 548
Apr 08 00:59:29.406792 afpd[142387] {auth.c:111} (info:AFPDaemon): uam: "DHX2" available
Apr 08 00:59:29.406813 afpd[142387] {auth.c:111} (info:AFPDaemon): uam: "DHCAST128" available
Apr 08 00:59:29.406829 afpd[142387] {status.c:363} (info:AFPDaemon): servername: freenas
Apr 08 00:59:29.406850 afpd[142387] {afp_config.c:198} (note:AFPDaemon): Netatalk AFP/TCP listening on fe80::46a8:42ff:fe3f:cb76:548
Apr 08 00:59:29.406874 afpd[142387] {ldap_config.c:95} (debug:AFPDaemon): LDAP: Using simple bind.
Apr 08 00:59:29.406881 afpd[142387] {afp_config.c:219} (debug:AFPDaemon): Fce version: 1
Apr 08 00:59:29.406892 afpd[142387] {cnid.c:55} (info:AFPDaemon): Registering CNID module [last]
Apr 08 00:59:29.406898 afpd[142387] {cnid.c:55} (info:AFPDaemon): Registering CNID module [dbd]
Apr 08 00:59:29.406902 afpd[142387] {cnid.c:55} (info:AFPDaemon): Registering CNID module [tdb]
Apr 08 00:59:29.406916 afpd[142387] {cnid.c:55} (info:AFPDaemon): Registering CNID module [mysql]
Apr 08 00:59:29.984421 netatalk[142386] {afp_avahi.c:182} (debug:AFPDaemon): publish_reply: AVAHI_ENTRY_GROUP_ESTABLISHED

please advise, Moshico.

Discussion

  • Mike

    Mike - 2017-04-25

    This is affecting us too. The problem (in netatalk 3.1.11) is the TimeMachine volume is not being added to the "volumes" linked list

    in util/netatalk_conf.c around line 1226, we're checking if the path exists by calling "realpath_safe". If it does exist, we add it to the volume list, and later that list is scanned for time machine volumes to determine whether to announce the _adisk._tcp service required for TimeMachine.

    However, "realpath_safe" is not processing the "$u" variable in the pathname, so it doesn't find the path and is failing to add it to the list of volumes.

    I'm not sure what the best solution for this is, but as a quick workaround you can create a folder that exactly matches the path specified in afp.conf: in my case the solution was "mkdir /home/timemachine/$u'

     
  • Daniel Markstedt

    • status: open --> closed
    • Group: -->
     
  • Daniel Markstedt

    I believe this is a duplicate with https://github.com/Netatalk/netatalk/issues/90

     

Log in to post a comment.