File tree Expand file tree Collapse file tree 4 files changed +36
-2
lines changed
Expand file tree Collapse file tree 4 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -395,7 +395,10 @@ def main():
395395 cmainit .CMAInjectables .default_cma_injection_configuration ()
396396 userinfo = pwd .getpwnam (opt .userid )
397397 os .chown (config .get ("SQLiteFile" ), userinfo .pw_uid , userinfo .pw_gid )
398- os .chown (config .get ("SQLiteFile" ) + '-journal' , userinfo .pw_uid , userinfo .pw_gid )
398+ try :
399+ os .chown (config .get ("SQLiteFile" ) + '-journal' , userinfo .pw_uid , userinfo .pw_gid )
400+ except FileNotFoundError :
401+ pass
399402 drop_privileges_permanently (opt .userid )
400403 try :
401404 cmainit .CMAinit (io , cleanoutdb = opt .erasedb , debug = (opt .debug > 0 ))
Original file line number Diff line number Diff line change @@ -72,5 +72,5 @@ RUN echo ${GENCMD}
7272RUN ${GENCMD} 2>&1 | egrep -v '/usr/include/|Undef "NULL"'
7373WORKDIR ${SRCDIR}/cma
7474ADD startup.sh /root/startup.sh
75- RUN mkdir -p /var/run
75+ RUN mkdir -p /var/run /usr/share/assimilation/notification.d
7676CMD ["/root/startup.sh" ]
Original file line number Diff line number Diff line change 1+ VOLS=" /var/lib/assimilation
2+ /var/run/assimilation
3+ /var/run/docker.sock
4+ /dev/log
5+ "
6+ VFLAGS=" "
7+ for vol in $VOLS
8+ do
9+ VFLAGS=" $VFLAGS -v $vol :$vol "
10+ done
11+ uid=$( grep ' ^assimilation:' /etc/passwd | cut -d: -f3)
12+ gid=$( grep ' ^assimilation:' /etc/passwd | cut -d: -f4)
13+ EFLAGS=" -e ASSIM_UID=${uid} -e ASSIM_GID=${gid} "
14+
15+
16+ docker run -t -i $VFLAGS $EFLAGS assimilationproject/cma:1.99.0 /bin/bash
Original file line number Diff line number Diff line change 11#! /bin/sh -eu
22: ${CMADEBUG=1}
33
4+ set -e
5+
46critical () {
57 echo " CRITICAL: $* " >&2
68 result=' BAD'
@@ -9,6 +11,18 @@ OWNERSHIP=assimilation:assimilation
911DEFAULT_MODE=0755
1012shares=" /dev/log /var/run/docker.sock /var/lib/assimilation /var/run/assimilation"
1113
14+ make_user () {
15+ if
16+ grep ' ^assimilation:' /etc/passwd > /dev/null
17+ then
18+ : COOL!
19+ else
20+ addgroup --gid $ASSIM_GID assimilation
21+ adduser --system --uid $ASSIM_UID --gid $ASSIM_GID --no-create-home assimilation
22+ fi
23+ }
24+
25+
1226fix_install () {
1327 result=OK
1428 for share in $shares
@@ -41,6 +55,7 @@ fix_install() {
4155 chown " ${OWNERSHIP} " " ${dir} "
4256 fi
4357 done
58+ make_user
4459 chown $OWNERSHIP /usr/share/assimilation
4560 for file in /usr/share/assimilation assim_json.sqlite assim_json.sqlite-journal
4661 do
You can’t perform that action at this time.
0 commit comments