summarylogtreecommitdiffstats
path: root/jetty.install
diff options
context:
space:
mode:
Diffstat (limited to 'jetty.install')
-rw-r--r--jetty.install25
1 files changed, 25 insertions, 0 deletions
diff --git a/jetty.install b/jetty.install
new file mode 100644
index 000000000000..19aac207d6cb
--- /dev/null
+++ b/jetty.install
@@ -0,0 +1,25 @@
+post_install() {
+ groupadd jetty &> /dev/null
+ useradd -g jetty -d /usr/share/jetty -s /bin/false jetty &> /dev/null
+ chown -R jetty:jetty /usr/share/jetty
+ chown -R jetty:jetty /var/log/jetty
+ chown -R jetty:jetty /var/lib/jetty/webapps
+}
+
+post_upgrade(){
+ getent group jetty > /dev/null 2>&1 || groupadd jetty &> /dev/null
+ getent passwd jetty > /dev/null 2>&1 || useradd -g jetty -d /usr/share/jetty -s /bin/false jetty &> /dev/null
+ chown -R jetty:jetty /usr/share/jetty
+ chown -R jetty:jetty /var/log/jetty
+ chown -R jetty:jetty /var/lib/jetty/webapps
+}
+
+post_remove() {
+ if getent passwd jetty > /dev/null 2>&1; then
+ userdel jetty
+ fi
+ if getent group jetty > /dev/null 2>&1; then
+ groupdel jetty
+ fi
+}
+