Skip to content

Commit 65f881c

Browse files
committed
#11 gid and uid as a variable as well
1 parent 7412d7b commit 65f881c

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ You can either start the image directly with Docker, or use the [Nomad-Docker-Wr
1414
docker run -p 8080:8080 \
1515
-e ZEPPELIN_SPARK_MASTER="local[*]" \
1616
-e ZEPPELIN_PASSWORD="secret" \
17-
-e ZEPPELIN_PROCESS_USER="zeppelinu" \
18-
-e ZEPPELIN_PROCESS_GROUP="zeppeling" \
17+
-e ZEPPELIN_PROCESS_USER_NAME="zeppelinu" \
18+
-e ZEPPELIN_PROCESS_USER_ID=12345 \
19+
-e ZEPPELIN_PROCESS_GROUP_NAME="zeppeling" \
20+
-e ZEPPELIN_PROCESS_GROUP_ID=12340 \
1921
-v $(pwd)/notebooks:/usr/local/zeppelin/notebooks \
2022
frosner/zeppelin
2123
```
@@ -28,5 +30,7 @@ The docker image requires some environment variables to be set. They are used to
2830
| -------- | ----------- |
2931
| `ZEPPELIN_SPARK_MASTER` | URL of the Spark master that Zeppelin should use. |
3032
| `ZEPPELIN_PASSWORD` | Password to use for authenticating as `zeppelin` user on the UI. |
31-
| `ZEPPELIN_PROCESS_USER` | User to execute the Zeppelin process as. |
32-
| `ZEPPELIN_PROCESS_GROUP` | Group to assign to the Zeppelin user. |
33+
| `ZEPPELIN_PROCESS_USER_NAME` | User name to execute the Zeppelin process as. |
34+
| `ZEPPELIN_PROCESS_USER_ID` | User ID to execute the Zeppelin process as. |
35+
| `ZEPPELIN_PROCESS_GROUP_NAME` | Group name to assign to the Zeppelin user. |
36+
| `ZEPPELIN_PROCESS_GROUP_ID` | Group ID to assign to the Zeppelin user. |

start-zeppelin.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
#!/bin/bash
22
cd /usr/local/zeppelin
33

4-
# fill configuration templates
4+
echo "Filling Zeppelin configuration templates"
55
cat conf/interpreter.json.template | envsubst > conf/interpreter.json
66
cat conf/zeppelin-env.sh.template | envsubst > conf/zeppelin-env.sh
77
cat conf/zeppelin-site.xml.template | envsubst > conf/zeppelin-site.xml
88
cat conf/shiro.ini.template | envsubst > conf/shiro.ini
99

1010
# add zeppelin group if not exists
11-
if getent group $ZEPPELIN_PROCESS_GROUP; then
12-
echo "Group $ZEPPELIN_PROCESS_GROUP already exists"
11+
if getent group $ZEPPELIN_PROCESS_GROUP_NAME; then
12+
echo "Group $ZEPPELIN_PROCESS_GROUP_NAME already exists"
1313
else
14-
echo "Group $ZEPPELIN_PROCESS_GROUP does not exist, creating it"
15-
addgroup $ZEPPELIN_PROCESS_GROUP
14+
echo "Group $ZEPPELIN_PROCESS_GROUP_NAME does not exist, creating it with gid=$ZEPPELIN_PROCESS_GROUP_ID"
15+
addgroup -gid $ZEPPELIN_PROCESS_GROUP_ID $ZEPPELIN_PROCESS_GROUP_NAME
1616
fi
1717

1818
# add zeppelin user if not exists
19-
if id -u $ZEPPELIN_PROCESS_USER 2>/dev/null; then
20-
echo "User $ZEPPELIN_PROCESS_USER already exists"
19+
if id -u $ZEPPELIN_PROCESS_USER_NAME 2>/dev/null; then
20+
echo "User $ZEPPELIN_PROCESS_USER_NAME already exists"
2121
else
22-
echo "User $ZEPPELIN_PROCESS_USER does not exist, creating it"
23-
adduser $ZEPPELIN_PROCESS_USER --gecos "" --ingroup $ZEPPELIN_PROCESS_GROUP --disabled-login --disabled-password
22+
echo "User $ZEPPELIN_PROCESS_USER_NAME does not exist, creating it with uid=$ZEPPELIN_PROCESS_USER_ID"
23+
adduser $ZEPPELIN_PROCESS_USER_NAME --uid $ZEPPELIN_PROCESS_USER_ID --gecos "" --ingroup $ZEPPELIN_PROCESS_GROUP_NAME --disabled-login --disabled-password
2424
fi
2525

2626
# adjust ownership of the zeppelin folder
27-
chown -R $ZEPPELIN_PROCESS_USER *
28-
chgrp -R $ZEPPELIN_PROCESS_GROUP *
27+
chown -R $ZEPPELIN_PROCESS_USER_NAME *
28+
chgrp -R $ZEPPELIN_PROCESS_GROUP_NAME *
2929

30-
exec sudo -u $ZEPPELIN_PROCESS_USER bin/zeppelin.sh
30+
exec sudo -u $ZEPPELIN_PROCESS_USER_NAME bin/zeppelin.sh

0 commit comments

Comments
 (0)