20141106 opendj init script for freebsd - plembo/onemoretech GitHub Wiki

title: OpenDJ init script for FreeBSD link: https://onemoretech.wordpress.com/2014/11/06/opendj-init-script-for-freebsd/ author: phil2nc description: post_id: 8773 created: 2014/11/06 02:35:39 created_gmt: 2014/11/06 07:35:39 comment_status: closed post_name: opendj-init-script-for-freebsd status: publish post_type: post

OpenDJ init script for FreeBSD

With help from the inimitable Chris Ridd of ForgeRock. The basic layout is Chris's, my contribution was to add back in ForgeRock's copyright notice and a "restart" routine that may or may not be a good idea. Tested with OpenDJ 2.6.0 and OpenJDK 8 on FreeBSD 10. [code lang="sh" gutter="false"] #!/bin/sh # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License, Version 1.0 only # (the "License"). You may not use this file except in compliance # with the License. # # You can obtain a copy of the license at # trunk/opends/resource/legal-notices/CDDLv1_0.txt # or http://forgerock.org/license/CDDLv1.0.html. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at # trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable, # add the following below this CDDL HEADER, with the fields enclosed # by brackets "[]" replaced with your own identifying information: # Portions

Copyright [yyyy] [name of copyright owner] # PROVIDE: opendj # REQUIRE: LOGIN # KEYWORD: shutdown . /etc/rc.subr name="opendj" rcvar=opendj_enable start_cmd="${name}_start" stop_cmd="${name}_stop" restart_cmd="${name}_restart" load_rc_config ${name} : ${opendj_enable:=no} : ${opendj_msg="OpenDJ not started."} INSTALL_ROOT=/usr/local/opendj export INSTALL_ROOT opendj_start() { /usr/bin/su opendj -c ${INSTALL_ROOT}/bin/start-ds } opendj_stop() { /usr/bin/su opendj -c ${INSTALL_ROOT}/bin/stop-ds } opendj_restart() { /usr/bin/su opendj -c ${INSTALL_ROOT}/bin/stop-ds sleep 30 /usr/bin/su opendj -c ${INSTALL_ROOT}/bin/start-ds } run_rc_command "$1" [/code]

Copyright 2004-2019 Phil Lembo