-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A2SERVER has moved files to /srv from /media #25
Comments
Changed it to just use /srv. Potential for duplicate entries on upgrade exists I suspect if A2SERVER is upgraded after A2CLOUD? Maybe. Should we address that @IvanExpert? |
It has logic to move everything from /media to seven on an upgrade, or so I think. If you changed any code we should retest.
|
What I changed was in A2CLOUD. The relevant bit of code in A2SERVER is: The relevant bit of code in A2SERVER is:
```bash
# 1.3.0: move /media/A2SHARED (pre-1.3.0) to /srv/A2SERVER
if [[ -d /media/A2SHARED ]]; then
echo "A2SERVER: Moving /media/A2SHARED to /srv/A2SERVER..."
sudo /etc/init.d/netatalk stop &> /dev/null
sudo /etc/init.d/samba stop &> /dev/null
[[ ! -d /srv ]] && sudo mkdir -p /srv
sudo mv /media/A2SHARED /srv/A2SERVER
sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /usr/local/etc/netatalk/AppleVolumes.default
[[ -f /etc/samba/smbd.conf ]] && sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /etc/samba/smbd.conf
fi ...that should handle the upgrade case for A2CLOUD which installed I've updated A2CLOUD's setup.txt to install the line in question into ### A2CLOUD: Enable netatalk sharing for A2CLOUD if it's installed
### FIXME: This has changed in A2SERVER, fix it here
if hash afpd 2>/dev/null; then # A2SERVER/netatalk installed
if [[ ! -d /srv/A2SERVER/ADTDISKS || ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then
echo "A2CLOUD: Setting up /usr/local/adtpro/disks for Apple file sharing..."
if [[ ! -d /srv/A2SERVER/ADTDISKS ]]; then
ln -s /usr/local/adtpro/disks /srv/A2SERVER/ADTDISKS 2>/dev/null
fi
if [[ ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then
sudo sed -i 's@^# End of File@/srv/A2SERVER/ADTDISKS ADTDISKS ea:ad\n\n# End of File@' /usr/local/etc/netatalk/AppleVolumes.default
fi
sudo /etc/init.d/netatalk restart
else
echo "A2CLOUD: /usr/local/adtpro/disks is already set up for Apple file sharing."
fi
### A2CLOUD: Enable samba sharing for A2CLOUD, if A2SERVER installed it
if grep -q A2SHARED /etc/samba/smb.conf 2>/dev/null; then
# SMB already enabled by A2SERVER
if grep -q ADTDISKS /etc/samba/smb.conf 2>/dev/null; then
echo "A2CLOUD: /usr/local/adtpro/disks is already set up for Windows file sharing."
else
echo "A2CLOUD: Setting up /usr/local/adtpro/disks for Windows file sharing..."
echo "[ADTDISKS]" | sudo tee -a /etc/samba/smb.conf >/dev/null
echo " path = /srv/A2SERVER/ADTDISKS" | sudo tee -a /etc/samba/smb.conf >/dev/null
echo " browsable = yes" | sudo tee -a /etc/samba/smb.conf >/dev/null
echo " guest ok = yes" | sudo tee -a /etc/samba/smb.conf >/dev/null
echo " read only = no" | sudo tee -a /etc/samba/smb.conf >/dev/null
echo " create mask = 0666" | sudo tee -a /etc/samba/smb.conf >/dev/null
echo " force user = $(whoami)" | sudo tee -a /etc/samba/smb.conf >/dev/null
fi
else
echo "A2CLOUD: Windows file sharing not in use."
fi
fi I don't actually attempt to upgrade either in A2CLOUD, assuming that ...I do now see a problem with A2SERVER however. It appears that Joseph On Sun, Apr 10, 2016 at 05:48:09AM -0700, IvanExpert wrote:
|
Yeah, assuming that A2SERVER is upgraded first probably isn't a safe. Maybe correct behavior would be to test for existence of A2SERVER, and if present, refuse to update until A2SERVER is updated, or warn that it needs to be in order for ADTDISKS needs to be shared at the end of the install. Otherwise, doesn't matter, as ADTDISKS isn't shared if A2SERVER is absent.
Oops, then. I'll have a look at that. |
On Mon, Apr 11, 2016 at 01:31:11AM -0700, IvanExpert wrote:
We could just bail writing anything if ADTDISKS is in either If A2SERVER's upgrade can handle that, it's what I'll go with.
If you can make sure it handles the above case when moving files, Joseph |
@IvanExpert Did you address this issue (or find out that it didn't need addressing) in A2SERVER? I'd like to dispatch this issue if a reasonable thing is done with samba upgrades. If you don't recall fixing it though, I'll need to look into it for 1.5.1. |
A change in A2SERVER between 1.2.5 and 1.5.0 is that your AppleTalk shares no longer live in /media. Now they're in /srv which is more Linuxically Standardistically correct.
A2CLOUD tries to do stuff with A2SERVER in a block presently at lines 540-571 of setup.txt. This needs to be updated. It could either be made to work with either path, or just be changed to use /srv exclusively.
The text was updated successfully, but these errors were encountered: