Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:octo47:hadoop
zookeeper
hadoop-zookeeper.sh.suse
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File hadoop-zookeeper.sh.suse of Package zookeeper
#!/bin/bash # # (c) Copyright 2009, 2010, 2011 Cloudera, Inc. # # Licensed 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. # # Starts Zookeeper # # chkconfig: 345 90 10 # description: Summary: ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or another by distributed applications. Each time they are implemented there is a lot of work that goes into fixing the bugs and race conditions that are inevitable. Because of the difficulty of implementing these kinds of services, applications initially usually skimp on them ,which make them brittle in the presence of change and difficult to manage. Even when done correctly, different implementations of these services lead to management complexity when the applications are deployed. # ### BEGIN INIT INFO # Provides: ZooKeeper # Required-Start: $network $local_fs # Should-Start: $named # Required-Stop: $syslog $remote_fs # Should-Stop: # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. ### END INIT INFO source /lib/lsb/init-functions STATUS_RUNNING=0 STATUS_DEAD=1 STATUS_DEAD_AND_LOCK=2 STATUS_NOT_RUNNING=3 ERROR_PROGRAM_NOT_INSTALLED=5 RETVAL=0 EXEC_PATH="/usr/bin/zookeeper-server" NAME=ZooKeeper DESC="ZooKeeper daemon" PID_FILE=/var/run/zookeeper/zookeeper-server.pid LOCKFILE="/var/lock/subsys/zookeeper" USER=zookeeper install -d -m 0755 -o zookeeper -g zookeeper /var/run/zookeeper/ start() { [ -x $exec ] || exit $ERROR_PROGRAM_NOT_INSTALLED log_success_msg "Starting $DESC: " start_daemon -u $USER $EXEC_PATH start RETVAL=$? echo [ $RETVAL -eq 0 ] && touch $LOCKFILE return $RETVAL } stop() { log_success_msg "Stopping $DESC: " start_daemon -u $USER $EXEC_PATH stop RETVAL=$? sleep 5 echo [ $RETVAL -eq 0 ] && rm -f $LOCKFILE $PIDFILE } restart() { stop start } checkstatus(){ pidofproc -p $PIDFILE java > /dev/null status=$? case "$status" in $STATUS_RUNNING) log_success_msg "$NAME is running" ;; $STATUS_DEAD) log_failure_msg "$NAME is dead and pid file exists" ;; $STATUS_DEAD_AND_LOCK) log_failure_msg "$NAME is dead and lock file exists" ;; $STATUS_NOT_RUNNING) log_failure_msg "$NAME is not running" ;; *) log_failure_msg "$NAME status is unknown" ;; esac return $status } condrestart(){ [ -e $LOCKFILE ] && restart || : } case "$1" in start) start ;; stop) stop ;; status) checkstatus ;; restart) restart ;; condrestart|try-restart) condrestart ;; *) echo $"Usage: $0 {start|stop|status|restart|try-restart}" exit 1 esac exit $RETVAL
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor