summarylogtreecommitdiffstats
path: root/milvus.install
blob: 4776173265d91693174b89f80c0dcdfa9e012673 (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
post_install() {

	TOKEN=/usr/share/milvus/config/configMilvus.txt

	mkdir -p /usr/share/milvus/config
	chmod -R 777 /usr/share/milvus/config
	chmod -R 777 /usr/share/milvus/resources/scripts
	chmod 755 /usr/share/milvus/resources/scripts/service.sh
	rm -rf /usr/share/milvus/resources/scripts/milvus.deb

	if [ -f "$TOKEN" ]; then
	    {
	        cp /usr/share/milvus/resources/scripts/milvus.service /etc/systemd/system/
	        systemctl daemon-reload
		systemctl enable milvus
		systemctl start milvus
	    } || {
	        echo "Erro ao iniciar servico"
	    }
	fi

}

post_upgrade() {
	post_install
}

pre_remove() {
	systemctl stop milvus
	systemctl disable milvus
	rm /etc/systemd/system/milvus.service
	killall -15 milvus
}