summarylogtreecommitdiffstats
path: root/cyrus-imapd.install
blob: 96355c361d0a7e3188f6ef4e02c1640c379ea197 (plain)
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
post_install() {
  # For systems which previously used a cyrus-imapd package < 3.0: Create
  # consistency with systems where user and group were created by
  # systemd-sysusers (which doesn't touch existing users)
  if ! getent group cyrus 2>&1 >/dev/null; then
    groupadd -g 70 cyrus
  fi
  if getent passwd cyrus 2>&1 >/dev/null && [ $(id -u cyrus) -ne 70 ]; then
    usermod -u 70 -g cyrus -c "Cyrus IMAP server" -d /var/lib/cyrus -s /sbin/nologin cyrus
  fi
}

post_upgrade() {
  post_install

  if [ $(vercmp "$2" 3.0) -lt 0 ]; then
    echo "Cyrus 3.0 contains major changes from previous versions, and so does the Arch"
    echo "package. Please heed the following information to ensure a clean upgrade:"
    echo "* For general information about upgrading to Cyrus 3.0 from previous versions,"
    echo "  please read https://www.cyrusimap.org/imap/download/upgrade.html."
    echo "* The suggested default paths /var/imap and /var/spool/imap have been changed"
    echo "  to /var/lib/cyrus and /var/spool/cyrus. This change has been adopted in the"
    echo "  Arch package, however if you want your existing installation to use these new"
    echo "  paths, manual action is required."
    echo "* On Arch, the cyrus user has been updated to use a fixed uid of 70. Please"
    echo "  adjust any paths owned by that user accordingly, including the previously"
    echo "  mentioned /var/imap and /var/spool/imap."
    echo "* On Arch, the systemd unit has been renamed from cyrus-master.service to"
    echo "  cyrus-imapd.service for consistency. If the unit was enabled before, you will"
    echo "  have to re-enable it manually."
  fi
}