Subject: [alpine-aports] [PATCH 1/2] main/mariadb: create user in .pre-install script

From: Sören Tempel <[email-masked]>
Date: Mon, 16 Nov 2015 20:23:56 +0100

---
 main/mariadb/APKBUILD            | 7 ++++---
 main/mariadb/mariadb.pre-install | 6 ++++++
 2 files changed, 10 insertions(+), 3 deletions(-)
 create mode 100644 main/mariadb/mariadb.pre-install

diff --git a/main/mariadb/APKBUILD b/main/mariadb/APKBUILD
index d55889d..3cbd619 100644
--- a/main/mariadb/APKBUILD
+++ b/main/mariadb/APKBUILD
@@ -1,20 +1,21 @@
+# Contributor: Sören Tempel <[email-masked]>
 # Contributor: Łukasz Jendrysik <[email-masked]>
 # Contributor: Carlo Landmeter <[email-masked]>
 # Maintainer: Natanael Copa <[email-masked]>
-
 pkgname=mariadb
 pkgver=10.1.8
-pkgrel=0
+pkgrel=1
 pkgdesc="A fast SQL database server"
 url="http://www.mariadb.org"
 pkgusers="mysql"
 pkggroups="mysql"
 arch="all"
-license='GPL'
+license="GPL"
 depends="$pkgname-common"
 depends_dev="openssl-dev zlib-dev"
 makedepends="cmake openssl-dev zlib-dev readline-dev libaio-dev ncurses-dev
 	linux-headers"
+install="$pkgname.pre-install"
 source="https://downloads.mariadb.org/interstitial/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz
 	$pkgname.initd
 	fix-mysql-install-db-path.patch
diff --git a/main/mariadb/mariadb.pre-install b/main/mariadb/mariadb.pre-install
new file mode 100644
index 0000000..2e6e668
--- /dev/null
+++ b/main/mariadb/mariadb.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S mysql 2>/dev/null
+adduser -h /var/lib/mysql -s /sbin/nologin -G mysql -D mysql 2>/dev/null
+exit 0
+
-- 
2.6.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Sören Tempel <[email-masked]>
Date: Mon, 16 Nov 2015 20:23:57 +0100

---
 main/alpine-baselayout/APKBUILD | 14 +++++++-------
 main/alpine-baselayout/group    |  1 -
 main/alpine-baselayout/passwd   |  1 -
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/main/alpine-baselayout/APKBUILD b/main/alpine-baselayout/APKBUILD
index cbacf29..2abf3f4 100644
--- a/main/alpine-baselayout/APKBUILD
+++ b/main/alpine-baselayout/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=alpine-baselayout
 pkgver=2.3.2
-pkgrel=5
+pkgrel=6
 pkgdesc="Alpine base dir structure and init scripts"
 url="http://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout"
 arch="all"
@@ -175,9 +175,9 @@ d7da26e76752b2e31c66b63f40a73397  color_prompt
 0ea6be55b18804f166e6939e9d5f4099  blacklist.conf
 f9e3eac60200d41dd5569eeabb4eddff  i386.conf
 17ba4f49c51dd2ba49ccceb0ecadaca4  kms.conf
-8e395728b732854677a23cdb9a2d0054  group
+23a30006a60f38d4a1c54e1ff35242ac  group
 d93ca19f6867a1a3918fa782d9b7c512  inittab
-8ca3c3a5746daf501e002729fd7d60b4  passwd
+46addf3e93b09822766ddb8bf9cfc3f6  passwd
 2939a40b911cac04c85263072c663973  profile
 394f8cd9fbf549f1d1b9a5bba680fc92  protocols
 5278bea4f45f4e289f72897b84dcb909  services"
@@ -188,9 +188,9 @@ a00b56dbd437d3f2c32ced50974daa3cfc84a8dd1cbaf75cf307be20b398fc75  color_prompt
 70becab743ff2071247bd144499eadbb1b42a5436dcc63991d69aa63ee2fe755  blacklist.conf
 6c46c4cbfb8b7594f19eb94801a350fa2221ae9ac5239a8819d15555caa76ae8  i386.conf
 079f74b93a4df310f55f60fea5e05996d3267c50076ae16402fa9e497ea5fdb2  kms.conf
-4be40f993ae9371fb4eef5a073f59c065124b13d1beb0748544f2d8cf3e0d2dd  group
+d428d7645fccc4c5e1f05c07798fa7f6669459f74e7fb137c79c6ee90178dda2  group
 8a54b20451ba9469b5260f76faa90fbde96915bf33e7f03f88bdbaf813400485  inittab
-58e0643a763f2e9c982d7d34fa4d2b74c38011de693ec30dc41602b879ae5aef  passwd
+6e7f56c0d9f5512cd7c43f4804feb1e082bc9d576d5528ea5aafc21f8d557966  passwd
 8ef550a4efc4bed1630b47c48aefbf1c63ae6e8d9c1246be92135465965712d2  profile
 a6695dbd53b87c7b41dfdafd40b1c8ba34fed2f0fa8eaaa296ad17c0b154603e  protocols
 e96af627f7774e8c87b0de843556a355fea6150c4d64fa4e2ff2c5fd610e7a79  services"
@@ -201,9 +201,9 @@ sha512sums="94a75cbd309e7b7d3b1bbbddb6f361335336d804c2a331b9963de7cee38633217bcd
 2b8e55339955c9670b5b9832bf57e711aca70cd2ebf815a9623fbb7fcd440cca4dd6a4862750885f779080d5c5416de197ff9a250cf116b1c8cf130fafbdaae8  blacklist.conf
 49109d434b577563849c43dd8141961ca798dada74d4d3f49003dac1911f522c43438b8241fa254e4faacdd90058f4d39a7d69b1f493f6d57422c1f706547c95  i386.conf
 b407351a5a64b00100753a13a91f4b1cb51017ae918a91fd37f3a6e76e3b6f562be643e74f969a888bdd54b0ad2d09e3b283d44ae4b5efccca7d7e9f735c5afb  kms.conf
-41a72ae4d814cc9ea8f6d007ad43f4aa8793e1fa76f713d4aad596eb65edd88fbe1a81fa39c89d7dadef9e7a75dda715fd509751a226ee78411df47e4245b46f  group
+1909284f36926033e8122ad333f0c80a20ef8670f027f7f686afd876eb5e7980570f72791adc52c3ca5ef2da115bac3fb9bd725cedde1b789c912e9f250292c5  group
 bdb6fe1f3e07466d9badf9a18b1f3fc9585f0a4cb69c00f1fa6d8b1e9903a3c497edefbfd345e324961013999e5692d2ed68ae7defaf1c6e57cc7916f206fd75  inittab
-9156521a0b044c2ff5d479cd6fcc73ab22906fc66cb2719a82fa0dfa0d03915254f6035cf7ade2ff47d16aa0c35b6c5d9e765ff7428da0194bedf95ba66c9c5e  passwd
+33f93710b0469f4babec520b75cb4661039b28aee5a97591102c0bcaf6e26819c06383d9ef510a897a8257f9e660f4be6a0590e898284717ae8686f6d1d34967  passwd
 c4088a7148c0f161809852d248d2c2272d9c72be3f968c2e2ba40806f508238496eda0f8f2a42aa092773a56800b1dae9f843a42d93f1bb16ba5f58c111d531b  profile
 f1548a2b5a107479446f15905f0f2fbf8762815b2215188d49d905c803786d35de6d98005dc0828fb2486b04aaa356f1216a964befddf1e72cb169656e23b6ac  protocols
 cecfc06b1f455d65b0c54a5651e601298b455771333e39d0109eeffd7ebd8d81b7738738eb647e6d3076230b6f3707782b83662ea3764ec33dc5e0b3453d3965  services"
diff --git a/main/alpine-baselayout/group b/main/alpine-baselayout/group
index a5bdbe7..606241a 100644
--- a/main/alpine-baselayout/group
+++ b/main/alpine-baselayout/group
@@ -32,7 +32,6 @@ xfs:x:33:xfs
 kvm:x:34:kvm
 games:x:35:
 shadow:x:42:
-mysql:x:60:
 postgres:x:70:
 cdrw:x:80:
 nut:x:84:
diff --git a/main/alpine-baselayout/passwd b/main/alpine-baselayout/passwd
index eb6abfc..2a33bff 100644
--- a/main/alpine-baselayout/passwd
+++ b/main/alpine-baselayout/passwd
@@ -20,7 +20,6 @@ squid:x:31:31:Squid:/var/cache/squid:/sbin/nologin
 gdm:x:32:32:GDM:/var/lib/gdm:/sbin/nologin
 xfs:x:33:33:X Font Server:/etc/X11/fs:/sbin/nologin
 games:x:35:35:games:/usr/games:/sbin/nologin
-mysql:x:60:60:mysql:/var/lib/mysql:/sbin/nologin
 postgres:x:70:70::/var/lib/postgresql:/bin/sh
 nut:x:84:84:nut:/var/state/nut:/sbin/nologin
 cyrus:x:85:12::/usr/cyrus:/sbin/nologin
-- 
2.6.3

---