Repository: incubator-ranger Updated Branches: refs/heads/master 5d074d56e -> b780714ec
RANGER-315 : Provide backward compatibility of ranger start/stop scripts Signed-off-by: Velmurugan Periasamy <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/b780714e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/b780714e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/b780714e Branch: refs/heads/master Commit: b780714ec2ce326a40b135748ac588078d2456c1 Parents: 5d074d5 Author: Gautam Borad <[email protected]> Authored: Sun Mar 22 12:13:26 2015 +0530 Committer: Velmurugan Periasamy <[email protected]> Committed: Mon Mar 23 09:57:59 2015 -0400 ---------------------------------------------------------------------- embeddedwebserver/scripts/ranger-admin | 50 -------------------- embeddedwebserver/scripts/ranger-admin-initd | 50 ++++++++++++++++++++ embeddedwebserver/scripts/start-ranger-admin.sh | 19 ++++++++ embeddedwebserver/scripts/stop-ranger-admin.sh | 19 ++++++++ security-admin/scripts/setup.sh | 6 ++- unixauthservice/scripts/start.sh | 20 ++++++++ unixauthservice/scripts/stop.sh | 20 ++++++++ 7 files changed, 132 insertions(+), 52 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b780714e/embeddedwebserver/scripts/ranger-admin ---------------------------------------------------------------------- diff --git a/embeddedwebserver/scripts/ranger-admin b/embeddedwebserver/scripts/ranger-admin deleted file mode 100755 index 80ecbf9..0000000 --- a/embeddedwebserver/scripts/ranger-admin +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -### BEGIN INIT INFO -# Provides: ranger-admin -# Required-Start: $local_fs $remote_fs $network $named $syslog $time -# Required-Stop: $local_fs $remote_fs $network $named $syslog $time -# Default-Start: 2 3 4 5 -# Default-Stop: -# Short-Description: Start/Stop Ranger Admin -### END INIT INFO - -LINUX_USER=ranger -BIN_PATH=/usr/bin -MOD_NAME=ranger-admin - -case $1 in -start) - echo "Starting Apache Ranger Admin." - /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} start" - ;; -stop) - echo "Stopping Apache Ranger Admin." - /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} stop" - ;; -restart) - echo "Stopping Apache Ranger Admin." - /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} stop" - sleep 10 - echo "Starting Apache Ranger Admin." - /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} start" - ;; -*) - echo "Invalid argument [$1]; Only start|stop|restart are supported." - exit 1 -esac http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b780714e/embeddedwebserver/scripts/ranger-admin-initd ---------------------------------------------------------------------- diff --git a/embeddedwebserver/scripts/ranger-admin-initd b/embeddedwebserver/scripts/ranger-admin-initd new file mode 100755 index 0000000..80ecbf9 --- /dev/null +++ b/embeddedwebserver/scripts/ranger-admin-initd @@ -0,0 +1,50 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +### BEGIN INIT INFO +# Provides: ranger-admin +# Required-Start: $local_fs $remote_fs $network $named $syslog $time +# Required-Stop: $local_fs $remote_fs $network $named $syslog $time +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Start/Stop Ranger Admin +### END INIT INFO + +LINUX_USER=ranger +BIN_PATH=/usr/bin +MOD_NAME=ranger-admin + +case $1 in +start) + echo "Starting Apache Ranger Admin." + /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} start" + ;; +stop) + echo "Stopping Apache Ranger Admin." + /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} stop" + ;; +restart) + echo "Stopping Apache Ranger Admin." + /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} stop" + sleep 10 + echo "Starting Apache Ranger Admin." + /bin/su --login $LINUX_USER -c "${BIN_PATH}/${MOD_NAME} start" + ;; +*) + echo "Invalid argument [$1]; Only start|stop|restart are supported." + exit 1 +esac http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b780714e/embeddedwebserver/scripts/start-ranger-admin.sh ---------------------------------------------------------------------- diff --git a/embeddedwebserver/scripts/start-ranger-admin.sh b/embeddedwebserver/scripts/start-ranger-admin.sh new file mode 100755 index 0000000..403bccf --- /dev/null +++ b/embeddedwebserver/scripts/start-ranger-admin.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "NOTE: This script is provided for backward compatibility only. All scripts calling this should now use '/usr/bin/ranger-admin start' instead" +/usr/bin/ranger-admin start http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b780714e/embeddedwebserver/scripts/stop-ranger-admin.sh ---------------------------------------------------------------------- diff --git a/embeddedwebserver/scripts/stop-ranger-admin.sh b/embeddedwebserver/scripts/stop-ranger-admin.sh new file mode 100755 index 0000000..dd21e02 --- /dev/null +++ b/embeddedwebserver/scripts/stop-ranger-admin.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "NOTE: This script is provided for backward compatibility only. All scripts calling this should now use '/usr/bin/ranger-admin stop' instead" +/usr/bin/ranger-admin stop http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b780714e/security-admin/scripts/setup.sh ---------------------------------------------------------------------- diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh index 3a5df4d..4b0acbc 100755 --- a/security-admin/scripts/setup.sh +++ b/security-admin/scripts/setup.sh @@ -129,6 +129,8 @@ init_variables(){ XAPOLICYMGR_DIR=$PWD + RANGER_ADMIN_INITD=ranger-admin-initd + RANGER_ADMIN=ranger-admin INSTALL_DIR=${XAPOLICYMGR_DIR} @@ -1273,9 +1275,9 @@ setup_install_files(){ chown -R ${unix_user} ${WEBAPP_ROOT}/WEB-INF/classes/lib fi - if [ ! -f /etc/init.d/${RANGER_ADMIN} ]; then + if [ -d /etc/init.d ]; then log "[I] Setting up init.d" - mv ${INSTALL_DIR}/ews/${RANGER_ADMIN} /etc/init.d/${RANGER_ADMIN} + cp ${INSTALL_DIR}/ews/${RANGER_ADMIN_INITD} /etc/init.d/${RANGER_ADMIN} chmod ug+rx /etc/init.d/${RANGER_ADMIN} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b780714e/unixauthservice/scripts/start.sh ---------------------------------------------------------------------- diff --git a/unixauthservice/scripts/start.sh b/unixauthservice/scripts/start.sh new file mode 100755 index 0000000..743cf9e --- /dev/null +++ b/unixauthservice/scripts/start.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +echo "NOTE: This script is provided for backward compatibility only. All scripts calling this should now use '/usr/bin/ranger-usersync start' instead" +/usr/bin/ranger-usersync start http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b780714e/unixauthservice/scripts/stop.sh ---------------------------------------------------------------------- diff --git a/unixauthservice/scripts/stop.sh b/unixauthservice/scripts/stop.sh new file mode 100755 index 0000000..7e3a8c6 --- /dev/null +++ b/unixauthservice/scripts/stop.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +echo "NOTE: This script is provided for backward compatibility only. All scripts calling this should now use '/usr/bin/ranger-usersync stop' instead" +/usr/bin/ranger-usersync stop
