summarylogtreecommitdiffstats
path: root/rstudio-server-bin.install
blob: f172b83c847701f2ccb7203d0850673c1df104bd (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
post_install() {
    getent group "rstudio" &>/dev/null || groupadd -r rstudio 1>/dev/null
    getent passwd "rstudio" &>/dev/null || useradd -r -g rstudio -d "/usr/lib/rstudio-server/www/" -s "/bin/sh" rstudio 1>/dev/null
    chown rstudio:rstudio /usr/lib/rstudio-server/www/

    ln -s /usr/lib/rstudio-server/bin/rserver /usr/bin/rserver
    ln -s /usr/lib/rstudio-server/bin/rstudio-server /usr/sbin/rstudio-server

    mkdir -p /var/run/rstudio-server
    mkdir -p /var/lock/rstudio-server
    mkdir -p /var/log/rstudio-server
    mkdir -p /var/lib/rstudio-server
}

post_remove() {
    if getent passwd "rstudio" >/dev/null; then
        userdel rstudio >/dev/null
    fi
    if getent group "rstudio" >/dev/null; then
        groupdel rstudio >/dev/null
    fi

    rm -f /usr/sbin/rstudio-server
    rm -f /usr/bin/rserver

    rm -rf /var/run/rstudio-server
    rm -rf /var/lock/rstudio-server
    rm -rf /var/log/rstudio-server
    rm -rf /var/lib/rstudio-server
}