null+****@clear*****
null+****@clear*****
2012年 7月 26日 (木) 19:24:38 JST
HAYASHI Kentaro 2012-07-26 19:24:38 +0900 (Thu, 26 Jul 2012) New Revision: 203c8b14d89edbff6e64db549b26a90c07703424 https://github.com/groonga/groonga/commit/203c8b14d89edbff6e64db549b26a90c07703424 Log: deb: use --chuid for setting user and group Modified files: packages/debian/groonga-httpd.init Modified: packages/debian/groonga-httpd.init (+11 -2) =================================================================== --- packages/debian/groonga-httpd.init 2012-07-26 18:15:44 +0900 (848a3b4) +++ packages/debian/groonga-httpd.init 2012-07-26 19:24:38 +0900 (f10e6bd) @@ -39,19 +39,28 @@ DEFAULT_FILE=/etc/default/groonga-httpd [ "$ENABLE" = "yes" ] || exit 0 +USER_EXIST=0 if [ -n "${USER}" ]; then if ! getent passwd | grep -q "^${USER}:"; then echo "$0: user for running groonga-httpd doesn't exist: ${USER}" >&2 exit 1 + else + USER_EXIST=1 fi - START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --user ${USER}" fi +GROUP_EXIST=0 if [ -n "${GROUP}" ]; then if ! getent group | grep -q "^${GROUP}:"; then echo "$0: group for running groonga-httpd doesn't exist: ${GROUP}" >&2 exit 1 + else + GROUP_EXIST=1 + fi +fi +if [ $USER_EXIST = 1 ]; then + if [ $GROUP_EXIST = 1 ]; then + START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --chuid ${USER}:${GROUP}" fi - START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --group ${GROUP}" fi DAEMON_ARGS="${DAEMON_ARGS} ${OPTION_ARGS}" -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... 下載