#!/sbin/runscript checkconfig() { if [ -z "$BEREMOTE_OPTS" ]; then eerror "You must set config options in /etc/conf.d/backupexec-ralus" return 1 fi } start() { local retstatus=1 local maxtry=15 # delete pidfile rm -f /var/VRTSralus/ralus.pid rm -f /var/VRTSralus/ralus.errpid # display to the user what you're doing ebegin "Starting Symantec Backup Exec Remote Agent" #run the checkconfig function checkconfig || return 1 # Start the process as a daemon, records it's own pid... start-stop-daemon --start --quiet --background --name beremote --exec /opt/VRTSralus/bin/beremote -- ${BEREMOTE_OPTS} >/dev/null 2>&1 while [ "$maxtry" != "0" ]; do if [ -f /var/VRTSralus/ralus.pid ]; then maxtry=0 else maxtry=$(($maxtry-1)) sleep 1; fi if [ -f /var/VRTSralus/ralus.errpid ]; then maxtry=0 fi done if [ -f /var/VRTSralus/ralus.pid ]; then retstatus=0 else retstatus=1 fi # output success or failure eend $retstatus } stop() { # display a message to the user ebegin "Stopping Symantec Backup Exec Remote Agent" # stop the daemon using exec path and name. There are multiple pids... start-stop-daemon --stop --quiet --signal 9 --name beremote --exec /opt/VRTSralus/bin/beremote # delete pidfile rm -f /var/VRTSralus/ralus.pid rm -f /var/VRTSralus/ralus.errpid # output success or failure eend $? }