summarylogtreecommitdiffstats
path: root/taskd.install
blob: 207a12dbda5c88cbae526bdae74031510be4a104 (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
33
34
35
36
37
pre_install() {
  # add taskd group if it doesn't exist
  getent group taskd &> /dev/null || groupadd --system taskd

  # add taskd user if it doesn't exist
  getent passwd taskd &> /dev/null || \
      useradd --system -d /var/lib/taskd -g taskd taskd
}

post_install() {
  systemctl preset taskd.service

  echo "Please follow the configuration instructions at
 /usr/lib/taskd/taskd.notes to finish setting up Taskserver."
}

pre_upgrade() {
  pre_install
}

post_upgrade() {
  post_install
}

pre_remove() {
  systemctl --no-reload disable taskd.service
  systemctl stop taskd.service
}

post_remove() {
  getent passwd taskd &> /dev/null && userdel  taskd &> /dev/null
  getent group  taskd &> /dev/null && groupdel taskd &> /dev/null

  systemctl daemon-reload

  echo "User 'taskd' and group 'taskd' have been removed."
}