aboutsummaryrefslogtreecommitdiffstats
path: root/databases/percona55-server/pkg-install
diff options
context:
space:
mode:
authordirk <dirk@FreeBSD.org>1999-07-04 22:55:14 +0800
committerdirk <dirk@FreeBSD.org>1999-07-04 22:55:14 +0800
commit0e949fa5caa53593b35e01662a11860e8783b78d (patch)
tree7725b2905d9a7c363dd0cd794bab6186b44a06f7 /databases/percona55-server/pkg-install
parent839673c1221ee7ae0e367474f6ad61d2e85ed355 (diff)
downloadfreebsd-ports-gnome-0e949fa5caa53593b35e01662a11860e8783b78d.tar.gz
freebsd-ports-gnome-0e949fa5caa53593b35e01662a11860e8783b78d.tar.zst
freebsd-ports-gnome-0e949fa5caa53593b35e01662a11860e8783b78d.zip
- install gifs for HTML documentation
- put mysqld in a sandbox: - create user and group 'mysql' (uid and gid 88) - start mysqld with user 'mysql'
Diffstat (limited to 'databases/percona55-server/pkg-install')
-rw-r--r--databases/percona55-server/pkg-install38
1 files changed, 38 insertions, 0 deletions
diff --git a/databases/percona55-server/pkg-install b/databases/percona55-server/pkg-install
new file mode 100644
index 000000000000..1c5dd869d825
--- /dev/null
+++ b/databases/percona55-server/pkg-install
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+PATH=/usr/sbin
+
+case $2 in
+POST-INSTALL)
+ USER=mysql
+ GROUP=${USER}
+ UID=88
+ GID=${UID}
+
+ if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+ if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d /var/db/mysql -s /sbin/nologin -c "MySQL Daemon"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi
+
+ chown -R ${USER}.${GROUP} /var/db/mysql
+ ;;
+esac