diff options
Diffstat (limited to 'extra/tomcat/tomcat.install')
-rw-r--r-- | extra/tomcat/tomcat.install | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/extra/tomcat/tomcat.install b/extra/tomcat/tomcat.install new file mode 100644 index 000000000..4308274ce --- /dev/null +++ b/extra/tomcat/tomcat.install @@ -0,0 +1,27 @@ +post_install() { + getent group tomcat >/dev/null 2>&1 || groupadd -g 66 tomcat + getent passwd tomcat >/dev/null 2>&1 || useradd -u 66 -g tomcat -d /opt/tomcat -s /bin/false tomcat + + if [ -f lib/modules/`uname -r`/kernel/security/capability.ko ]; then + echo ">>> It appears that your current kernel has linux security" + echo ">>> capabilities built as a module. Tomcat requires this" + echo ">>> functionality to operate." + echo ">>>" + echo ">>> To activate the module, please load it now (modprobe capability)." + echo ">>> Also, you should add it to your MODULES array in rc.conf, so" + echo ">>> it will be activated automatically at boot-up." + fi +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + if getent passwd tomcat >/dev/null 2>&1; then + userdel tomcat + fi + if getent group tomcat >/dev/null 2>&1; then + groupdel tomcat + fi +} |