{"id":2280,"date":"2017-05-16T22:52:09","date_gmt":"2017-05-16T20:52:09","guid":{"rendered":"http:\/\/www.oradba.ch\/?p=2280"},"modified":"2017-05-16T22:52:33","modified_gmt":"2017-05-16T20:52:33","slug":"start-oud-servers-on-boot-using-systemd","status":"publish","type":"post","link":"https:\/\/www.oradba.ch\/wordpress\/2017\/05\/start-oud-servers-on-boot-using-systemd\/","title":{"rendered":"Start OUD Servers on Boot using systemd"},"content":{"rendered":"<p>Starting Oracle Unified Directory on system boot is essential for production environment. Unfortunately OUD just provides a script to create the init.d script. But newer system in general use <a href=\"https:\/\/en.wikipedia.org\/wiki\/Systemd\">systemd<\/a> initialise and startup. Nevertheless, creating a custom unit file for OUD is simple and straightforward. First, let&#8217;s create a regular init.d script with the <em>create-rc-script<\/em> from oud. The created custom script can be used as template for the systemd unit file.<\/p>\n<p><em>create-rc-script<\/em> does allow a couple of parameter to specify the script name, OS user for OUD and the JAVA_HOME. The following example of <em>create-rc-script<\/em> does show how to create a regular start script for OUD instance <em>oud_ad_proxy<\/em>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\nexport OUD_HOME=\/u00\/app\/oracle\/instances\/oud_ad_proxy\r\nexport JAVA_HOME=\/u00\/app\/oracle\/product\/jdk1.7.0_141\r\n\r\ncd $OUD_HOME\/OUD\/bin\r\ncreate-rc-script -f oud_ad_proxy.sh -u oracle -j $JAVA_HOME\r\n<\/pre>\n<p>This does create the following bornshell script for init.d.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\n#!\/bin\/sh\r\n#\r\n# Copyright (c) 2012, Oracle and\/or its affiliates. All rights reserved.\r\n# \r\n#\r\n# chkconfig: 345 90 30\r\n# description: Oracle Unified Directory startup script\r\n#\r\n\r\n\r\n# Set the path to the Oracle Unified Directory instance to manage\r\nINSTALL_ROOT=&quot;\/u00\/app\/oracle\/instances\/oud_ad_proxy\/OUD&quot;\r\nexport INSTALL_ROOT\r\n\r\n# Specify the path to the Java installation to use\r\nOPENDS_JAVA_HOME=&quot;\/u00\/app\/oracle\/product\/jdk1.7.0_141&quot;\r\nexport OPENDS_JAVA_HOME\r\n\r\n# Determine what action should be performed on the server\r\ncase &quot;${1}&quot; in\r\nstart)\r\n  \/bin\/su - oracle -- &quot;${INSTALL_ROOT}\/bin\/start-ds&quot; --quiet\r\n  exit ${?}\r\n  ;;\r\nstop)\r\n  \/bin\/su - oracle -- &quot;${INSTALL_ROOT}\/bin\/stop-ds&quot; --quiet\r\n  exit ${?}\r\n  ;;\r\nrestart)\r\n  \/bin\/su - oracle -- &quot;${INSTALL_ROOT}\/bin\/stop-ds&quot; --restart --quiet\r\n  exit ${?}\r\n  ;;\r\n*)\r\n  echo &quot;Usage:  $0 { start | stop | restart }&quot;\r\n  exit 1\r\n  ;;\r\nesac\r\n<\/pre>\n<p>The same start \/ stop commands can now be used in the unit file. So let&#8217;s create a new custom unit file in <em>\/etc\/systemd\/system<\/em>. The unit file is named according the old instance. <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\nsudo vi \/etc\/systemd\/system\/oud_ad_proxy.service\r\n<\/pre>\n<p>Add the following content to the new unit file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\n[Unit]\r\nDescription=OUD AD Proxy Instance oud_ad_proxy\r\nWants=network.target\r\nAfter=network.target\r\n\r\n[Service]\r\nType=forking\r\nUser=oracle\r\nGroup=osdba\r\nEnvironment=OPENDS_JAVA_HOME=&quot;\/u00\/app\/oracle\/product\/jdk1.7.0_141&quot;\r\nExecStart=\/u00\/app\/oracle\/instances\/oud_ad_proxy\/OUD\/bin\/start-ds --quiet\r\nExecStop=\/u00\/app\/oracle\/instances\/oud_ad_proxy\/OUD\/bin\/stop-ds --quiet\r\nExecReload=\/u00\/app\/oracle\/instances\/oud_ad_proxy\/OUD\/bin\/stop-ds --restart --quiet\r\nStandardOutput=syslog\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>As soon as we have the new unit file we have to enable the service.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\nsudo systemctl enable oud_ad_proxy.service\r\n<\/pre>\n<p>Start the OUD instance using <em>systemctl<\/em>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\nsudo systemctl start oud_ad_proxy.service\r\n<\/pre>\n<p>Stop the OUD instance using <em>systemctl<\/em>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\nsudo systemctl stop oud_ad_proxy.service\r\n<\/pre>\n<p>Display the status of the OUD service.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\nsudo systemctl status oud_ad_proxy.service\r\n\r\n oud_ad_proxy.service - OUD AD Proxy Instance oud_ad_proxy\r\n   Loaded: loaded (\/etc\/systemd\/system\/oud_ad_proxy.service; enabled; vendor preset: disabled)\r\n   Active: active (running) since Tue 2017-05-16 22:41:09 CEST; 28s ago\r\n  Process: 18300 ExecStop=\/u00\/app\/oracle\/instances\/oud_ad_proxy\/OUD\/bin\/stop-ds --quiet (code=exited, status=0\/SUCCESS)\r\n  Process: 18397 ExecStart=\/u00\/app\/oracle\/instances\/oud_ad_proxy\/OUD\/bin\/start-ds --quiet (code=exited, status=0\/SUCCESS)\r\n Main PID: 18477 (java)\r\n   CGroup: \/system.slice\/oud_ad_proxy.service\r\n           \u2514\u250018477 \/u00\/app\/oracle\/product\/jdk1.7.0_141\/jre\/bin\/java -server -Dorg.opends.server.scriptName=start-ds org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler -...\r\n\r\nMay 16 22:41:01 euterpe systemd[1]: Starting OUD AD Proxy Instance oud_ad_proxy...\r\nMay 16 22:41:09 euterpe systemd[1]: Started OUD AD Proxy Instance oud_ad_proxy.\r\n<\/pre>\n<p>Some references and links to MOS Notes:<\/p>\n<ul>\n<li>OUD11g: How to Start OUD Servers on Boot [<em><a href=\"https:\/\/support.oracle.com\/epmos\/faces\/DocumentDisplay?id=2019451.1\" target=\"_blank\">2019451.1<\/a><\/em>]<\/li>\n<li>Oracle\u00ae Fusion Middleware Administering Oracle Unified Directory 11g Release 2 (11.1.2.3) <a href=\"https:\/\/docs.oracle.com\/cd\/E52734_01\/oud\/OUDAG\/appendix_cli.htm#OUDAG01144\" target=\"_blank\">create-rc-script<\/a><\/li>\n<li>Red Hat Enterprise Linux 7 System Administrator&#8217;s Guide <a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/7\/html\/System_Administrators_Guide\/sect-Managing_Services_with_systemd-Unit_Files.html\" target=\"_blank\">Creating and Modifying systemd Unit Files<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/understanding-systemd-units-and-unit-files\" target=\"_blank\">Understanding Systemd Units and Unit Files<\/a><\/li>\n<li>Wikipedia <a href=\"https:\/\/en.wikipedia.org\/wiki\/Systemd\">systemd<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Starting Oracle Unified Directory on system boot is essential for production environment. Unfortunately OUD just provides a script to create the init.d script. But newer system in general use systemd initialise and startup. Nevertheless, creating a custom unit file for OUD is simple and straightforward. First, let&#8217;s create a regular init.d script with the create-rc-script [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Start #Oracle Unified Directory Servers on Boot using systemd","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[73,142,74],"tags":[130,18,111],"class_list":["post-2280","post","type-post","status-publish","format-standard","hentry","category-linux-2","category-oud","category-unix","tag-trivadis","tag-trivadiscontent","tag-tvdsecexpert"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1aErb-AM","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2609,"url":"https:\/\/www.oradba.ch\/wordpress\/2018\/05\/oracle-unified-directory-systemd-unit-file\/","url_meta":{"origin":2280,"position":0},"title":"Oracle Unified Directory systemd unit file","author":"Stefan","date":"16. May 2018","format":false,"excerpt":"About a year ago I explained in the blog post Start OUD Servers on Boot using systemd how to start Oracle Unified Directory automatically on system startup. In the meantime a lot has changed, so has my unit file. The simple unit file actually worked quite well. Until the time\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.oradba.ch\/wordpress\/category\/linux-2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2353,"url":"https:\/\/www.oradba.ch\/wordpress\/2017\/09\/start-odsm-on-boot-using-systemd\/","url_meta":{"origin":2280,"position":1},"title":"Start ODSM on boot using systemd","author":"Stefan","date":"7. September 2017","format":false,"excerpt":"A couple of month ago I wrote blog on how to start Oracle Unified Directory (OUD) on system boot (see Start OUD Servers on Boot using systemd) using a unit file and systemd. Quite a simple and straightforward way to start OUD. Why not using the same approach for ODSM?\u2026","rel":"","context":"In &quot;Oracle Unified Directory&quot;","block_context":{"text":"Oracle Unified Directory","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oud\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2693,"url":"https:\/\/www.oradba.ch\/wordpress\/2018\/07\/oudbase-environment-scripts-for-oracle-unified-directory-part-1\/","url_meta":{"origin":2280,"position":2},"title":"OUDbase environment scripts for Oracle Unified Directory Part 1","author":"Stefan","date":"16. July 2018","format":false,"excerpt":"Almost two years ago I started writing environment scripts for my Oracle Unified Directory installations. At the beginning there were only 2-3 scripts, from which at some point a small project on GitHub emerged. A lot has changed since my blog post Environment Scripts for OUD. The current version of\u2026","rel":"","context":"In &quot;Oracle Unified Directory&quot;","block_context":{"text":"Oracle Unified Directory","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oud\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screen-Shot-2018-07-16-at-23.43.18-300x95.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screen-Shot-2018-07-16-at-23.43.18-300x95.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screen-Shot-2018-07-16-at-23.43.18-300x95.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2205,"url":"https:\/\/www.oradba.ch\/wordpress\/2016\/11\/environment-scripts-for-oud\/","url_meta":{"origin":2280,"position":3},"title":"Environment Scripts for OUD","author":"Stefan","date":"18. November 2016","format":false,"excerpt":"At Trivadis we do have the TVD-BasEnv\u2122 to standardizes and simplifies the handling of environments for Oracle database and application server landscapes. This inspired me to create something similar for Oracle Unified Directory environments. Although current versions of TVD-BasEnv\u2122 already support OUD and OID environment. I've had the situation, where\u2026","rel":"","context":"In &quot;Oracle Unified Directory&quot;","block_context":{"text":"Oracle Unified Directory","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oud\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2431,"url":"https:\/\/www.oradba.ch\/wordpress\/2017\/11\/install-oracle-unified-directory-12c-the-smart-way\/","url_meta":{"origin":2280,"position":4},"title":"Install Oracle Unified Directory 12c the smart way","author":"Stefan","date":"23. November 2017","format":false,"excerpt":"Installing Oracle Unified Directory has always been easy. The installation guide for OUD 11c as well OUD 12 is simple and straight forward. Additionally Oracle does provide a couple of MOS notes for different deployment scenarios. Nevertheless there is always room for improvement :-) During my work on OUD to\u2026","rel":"","context":"In &quot;Howto&quot;","block_context":{"text":"Howto","link":"https:\/\/www.oradba.ch\/wordpress\/category\/howto\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2344,"url":"https:\/\/www.oradba.ch\/wordpress\/2017\/08\/oracle-unified-directory-12-released\/","url_meta":{"origin":2280,"position":5},"title":"Oracle Unified Directory 12 Released","author":"Stefan","date":"31. August 2017","format":false,"excerpt":"Finally end of working day. But while reading some newsletter and mails on my way home, I realised that there will be some work at home. After a long wait, Oracle has finally released Oracle Unified Directory 12c :-) A overview of the new features: Improved performance and scalability Support\u2026","rel":"","context":"In &quot;Oracle Unified Directory&quot;","block_context":{"text":"Oracle Unified Directory","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oud\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/comments?post=2280"}],"version-history":[{"count":2,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2280\/revisions"}],"predecessor-version":[{"id":2283,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2280\/revisions\/2283"}],"wp:attachment":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/media?parent=2280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/categories?post=2280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/tags?post=2280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}