summarylogtreecommitdiffstats
path: root/.install
blob: 2ce5f059abcb83c0bdfcd026fc325e455eaf537e (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## arg 1:  the new package version
pre_install() {
    echo "Creating 'scylla' group..."
    getent group scylla || /usr/sbin/groupadd scylla 2> /dev/null || :
    echo "Creating 'scylla' user..."
    getent passwd scylla || /usr/sbin/useradd -g scylla -s /sbin/nologin -r -d /var/lib/scylla scylla 2> /dev/null || :
}

## arg 1:  the new package version
post_install() {
    # Set permissions to the data directories
    chown -R scylla:scylla /var/lib/scylla
    chown -R scylla:scylla /var/lib/scylla-housekeeping

    # Patch Scylla YAML config for Swagger UI and Doc directories
    grep -v api_ui_dir /etc/scylla/scylla.yaml | grep -v api_doc_dir > /tmp/scylla.yaml
    echo "api_ui_dir: /usr/lib/scylla/swagger-ui/dist/" >> /tmp/scylla.yaml
    echo "api_doc_dir: /usr/lib/scylla/api/api-doc/" >> /tmp/scylla.yaml
    mv /tmp/scylla.yaml /etc/scylla/scylla.yaml

    echo
    echo "ScyllaDB installation is complete. To configure ScyllaDB, please run:"
    echo "    >> sudo scylla_setup"
    echo "After configuration is done, start ScyllaDB using systemctl:"
    echo "    >> sudo systemctl start scylla-server.service"
    echo
}

## arg 1:  the new package version
## arg 2:  the old package version
pre_upgrade() {
	:
}

## arg 1:  the new package version
## arg 2:  the old package version
post_upgrade() {
	ln -sfT /etc/scylla /var/lib/scylla/conf
    systemctl restart collectd
}

## arg 1:  the old package version
pre_remove() {
	systemctl stop scylla-server.service
	systemctl disable scylla-server.service
}

## arg 1:  the old package version
post_remove() {
    :
}