{"id":2353,"date":"2017-09-07T07:34:46","date_gmt":"2017-09-07T05:34:46","guid":{"rendered":"http:\/\/www.oradba.ch\/?p=2353"},"modified":"2018-05-02T08:10:21","modified_gmt":"2018-05-02T06:10:21","slug":"start-odsm-on-boot-using-systemd","status":"publish","type":"post","link":"https:\/\/www.oradba.ch\/wordpress\/2017\/09\/start-odsm-on-boot-using-systemd\/","title":{"rendered":"Start ODSM on boot using systemd"},"content":{"rendered":"<p>A couple of month ago I wrote blog on how to start Oracle Unified Directory (OUD) on system boot (see <a href=\"https:\/\/www.oradba.ch\/wordpress\/2017\/05\/start-oud-servers-on-boot-using-systemd\/\">Start OUD Servers on Boot using systemd<\/a>) using a unit file and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Systemd\">systemd<\/a>. Quite a simple and straightforward way to start OUD. Why not using the same approach for ODSM? This can be easily implemented, because my weblog infrastructure is only used for the ODSM domain.<\/p>\n<h3>Boot Properties File for ODSM<\/h3>\n<p>Normally the credentials must be specified when the weblogic server is started. To avoid this, a <em>boot.properties<\/em> file is defined. This file does contain the <em>username<\/em> and <em>password<\/em> of the weblogic admin. Excerpt from my weblogic startup log including the prompt for username and password.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-highlight=\"6,7\">\n...\n&lt;sep 7, 2017 6:01:09 AM CEST&gt; &lt;info&gt; &lt;weblogicserver&gt; &lt;bea -000377&gt; &lt;starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 24.141-b31 from Oracle Corporation&gt; \n&lt;sep 7, 2017 6:01:10 AM CEST&gt; &lt;info&gt; &lt;management&gt; &lt;bea -141107&gt; &lt;version: WebLogic Server 10.3.6.0.170418 PSU Patch for BUG25388747 WED MAR 21 18:34:42 IST 2017\nWebLogic Server 10.3.6.0  Tue Nov 15 08:52:36 PST 2011 1441050 &gt; \n&lt;sep 7, 2017 6:01:11 AM CEST&gt; &lt;info&gt; &lt;security&gt; &lt;bea -090065&gt; &lt;getting boot identity from user.&gt; \nEnter username to boot WebLogic server:weblogic\nEnter password to boot WebLogic server:\n&lt;sep 7, 2017 6:01:39 AM CEST&gt; &lt;notice&gt; &lt;weblogicserver&gt; &lt;bea -000365&gt; &lt;server state changed to STARTING&gt; \n&lt;sep 7, 2017 6:01:39 AM CEST&gt; &lt;info&gt; &lt;workmanager&gt; &lt;bea -002900&gt; &lt;initializing self-tuning thread pool&gt;\n...\n<\/pre>\n<p>ODSM just has an admin server. So let&#8217;s create the <em>boot.properties<\/em> file in the security folder of the admin server. Since this security directory may not already exist, we must create it beforehand. On my environment I&#8217;ve put the user projects outside of my middleware folder in <em>\/u00\/app\/oracle\/user_projects<\/em>. The working directory for the next couple of commands will be <em>\/u00\/app\/oracle\/user_projects\/domains\/ODSM_domain<\/em>.  <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\ncd \/u00\/app\/oracle\/user_projects\/domains\/ODSM_domain\n\nls servers\/AdminServer\nadr  cache  data  logs  sysman  tmp\n\nmkdir -p servers\/AdminServer\/security\ntouch servers\/AdminServer\/security\/boot.properties\n<\/pre>\n<p>Add values for <em>username<\/em> and <em>password<\/em> to the <em>boot.properties<\/em> file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\nvi servers\/AdminServer\/security\/boot.properties\n\nusername=weblogic\npassword=manager\n<\/pre>\n<p>The boot.properties file fortunately does not stay like this. so. During the first start of the weblogic server, the username and password is encrypted with AES.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\ncat servers\/AdminServer\/security\/boot.properties\n#Thu Sep 07 06:34:11 CEST 2017\npassword={AES}lCtDx2TYm8rHZt\/n9CiwmCgbiPjE+noBdyI+1MmJ21o\\=\nusername={AES}4ROGb6gIkFWhqQA6uoV2mTN7cZy\/jdM\/pUO4aDbB74k\\=\n<\/pre>\n<h3>Unit File for ODSM<\/h3>\n<p>After the weblogic server can now be started without password input, one only need the corresponding unit file to automatically start the ODSM domain during system boot. The unit file will be created as root in the folder <em>\/usr\/lib\/systemd\/system<\/em>. For my environment I do create the following unity file. Working directory, domain name, user name etc has to be adjusted accordingly for other environments. Add the following content to the new unit file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\nsudo vi \/usr\/lib\/systemd\/system\/wls_odsm.service\n\n# -----------------------------------------------------------------------\n#  Trivadis AG, Infrastructure Managed Services\n#  Saegereistrasse 29, 8152 Glattbrugg, Switzerland\n# -----------------------------------------------------------------------\n#  File-Name........: wls_odsm.service\n#  Author...........: Stefan Oehrli, stefan.oehrli at trivadis.com\n#  Date.............: 07. Sept 2017\n#  Revision.........: 1.0\n#  Purpose..........: Unit file for ODSM domain\n#  Usage............: systemctl enable wls_odsm.service\n#  Notes............: --\n# -----------------------------------------------------------------------\n#  Revision history.:  \n#  07.09.2017  soe     initial release\n# -----------------------------------------------------------------------\n\n[Unit]\nDescription=WLS ODSM Instance\nWants=network.target\nAfter=network.target\n \n[Service]\nType=simple\nUser=oracle\nGroup=osdba\nWorkingDirectory=\/u00\/app\/oracle\/user_projects\/domains\/ODSM_domain\nExecStart=\/u00\/app\/oracle\/user_projects\/domains\/ODSM_domain\/startWebLogic.sh\nExecStop=\/u00\/app\/oracle\/user_projects\/domains\/ODSM_domain\/bin\/stopWebLogic.sh\nStandardOutput=syslog\n \n[Install]\nWantedBy=multi-user.target\n<\/pre>\n<p>As soon as we have the new unit file we have to enable the service. This also creates a softlink in <em>\/etc\/systemd\/system\/multi-user.target.wants<\/em> to the new unit file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\nsudo systemctl enable wls_odsm.service\nCreated symlink from \/etc\/systemd\/system\/multi-user.target.wants\/wls_odsm.service to \/usr\/lib\/systemd\/system\/wls_odsm.service.\n<\/pre>\n<p>Start the admin server for the ODSM domain using <em>systemctl<\/em>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\nsudo systemctl start wls_odsm.service\n<\/pre>\n<p>Stop the admin server for the ODSM domain using <em>systemctl<\/em>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\nsudo systemctl stop wls_odsm.service\n<\/pre>\n<p>Display the status of the admin server for the ODSM domain.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\nsudo systemctl status wls_odsm.service\n wls_odsm.service - WLS ODSM Instance\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/wls_odsm.service; enabled; vendor preset: disabled)\n   Active: active (running) since Thu 2017-09-07 06:55:25 CEST; 1min 32s ago\n Main PID: 10645 (startWebLogic.s)\n   CGroup: \/system.slice\/wls_odsm.service\n           \u251c\u250010645 \/bin\/sh \/u00\/app\/oracle\/user_projects\/domains\/ODSM_domain\/startWebLogic.sh\n           \u251c\u250010648 \/bin\/sh \/u00\/app\/oracle\/user_projects\/domains\/ODSM_domain\/bin\/startWebLogic.sh\n           \u2514\u250010695 \/u00\/app\/oracle\/product\/jdk1.7.0_141\/bin\/java -server -Xms256m -Xmx512m -XX:MaxPermSize=512m -Dweblogic.Name=AdminServer -Djava.security.polic...\n\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;server&gt; &lt;bea -002613&gt; &lt;channel &quot;Default[4]&quot; is now listening on ...p, http.&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;server&gt; &lt;bea -002613&gt; &lt;channel &quot;Default&quot; is now listening on fd1...p, http.&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;server&gt; &lt;bea -002613&gt; &lt;channel &quot;Default[1]&quot; is now listening on ...p, http.&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;server&gt; &lt;bea -002613&gt; &lt;channel &quot;Default[5]&quot; is now listening on ...p, http.&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;server&gt; &lt;bea -002613&gt; &lt;channel &quot;Default[6]&quot; is now listening on ...p, http.&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;server&gt; &lt;bea -002613&gt; &lt;channel &quot;Default[7]&quot; is now listening on ...p, http.&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;weblogicserver&gt; &lt;bea -000329&gt; &lt;started WebLogic Admin Server &quot;Ad...ion Mode&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;warning&gt; &lt;server&gt; &lt;bea -002611&gt; &lt;hostname &quot;localhost&quot;, maps to multiple I...:0:0:0:1&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;weblogicserver&gt; &lt;bea -000365&gt; &lt;server state changed to RUNNING&gt;\nSep 07 06:56:19 euterpe startWebLogic.sh[10645]: &lt;sep 7, 2017 6:56:19 AM CEST&gt; &lt;notice&gt; &lt;weblogicserver&gt; &lt;bea -000360&gt; &lt;server started in RUNNING mode&gt;\nHint: Some lines were ellipsized, use -l to show in full.\n<\/pre>\n<p>All in all, a simple and easy way to start the ODSM automatically at system boot.<\/p>\n<h3>Reference<\/h3>\n<p>Some references and links to MOS Notes:<\/p>\n<ul>\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>ORACLE BASE article on <a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-services-systemd\">Linux Services (systemd, systemctl)<\/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<li>A really well aged Oracle By Example (OBE) article about enable auto login on Oracle WebLogic Server 10g. <a href=\"http:\/\/www.oracle.com\/webfolder\/technetwork\/tutorials\/obe\/fmw\/wls\/10g\/r3\/installconfig\/enable_auto_login\/boot_identity_file.htm\">Enabling Auto Login by Using the Boot Identity File<\/a><\/li>\n<li>Newer version of the article for Oracle WebLogic Server 12c. <a href=\"http:\/\/www.oracle.com\/webfolder\/technetwork\/tutorials\/obe\/fmw\/wls\/10g\/r3\/installconfig\/enable_auto_login\/boot_identity_file.htm\">Creating a Boot Identity File for Easier Server Start Up<\/a><\/li>\n<\/ul>\n<p><\/server><\/bea><\/weblogicserver><\/notice><\/sep><\/server><\/bea><\/weblogicserver><\/notice><\/sep><\/hostname><\/bea><\/server><\/warning><\/sep><\/started><\/bea><\/weblogicserver><\/notice><\/sep><\/channel><\/bea><\/server><\/notice><\/sep><\/channel><\/bea><\/server><\/notice><\/sep><\/channel><\/bea><\/server><\/notice><\/sep><\/channel><\/bea><\/server><\/notice><\/sep><\/channel><\/bea><\/server><\/notice><\/sep><\/channel><\/bea><\/server><\/notice><\/sep><\/initializing><\/bea><\/workmanager><\/info><\/sep><\/server><\/bea><\/weblogicserver><\/notice><\/sep><\/getting><\/bea><\/security><\/info><\/sep><\/version:><\/bea><\/management><\/info><\/sep><\/starting><\/bea><\/weblogicserver><\/info><\/sep><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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? This can be easily implemented, [&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 ODSM 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":[142,169,170],"tags":[172,171,130],"class_list":["post-2353","post","type-post","status-publish","format-standard","hentry","category-oud","category-system-administration","category-weblogic","tag-odsm","tag-systemd","tag-trivadis"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1aErb-BX","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":2353,"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":2280,"url":"https:\/\/www.oradba.ch\/wordpress\/2017\/05\/start-oud-servers-on-boot-using-systemd\/","url_meta":{"origin":2353,"position":1},"title":"Start OUD Servers on Boot using systemd","author":"Stefan","date":"16. May 2017","format":false,"excerpt":"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's create a regular\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":2431,"url":"https:\/\/www.oradba.ch\/wordpress\/2017\/11\/install-oracle-unified-directory-12c-the-smart-way\/","url_meta":{"origin":2353,"position":2},"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":2353,"position":3},"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":[]},{"id":2403,"url":"https:\/\/www.oradba.ch\/wordpress\/2017\/11\/oracle-unified-directory-to-go-on-raspberry-pi-zero\/","url_meta":{"origin":2353,"position":4},"title":"Oracle Unified Directory to go on Raspberry Pi Zero","author":"Stefan","date":"13. November 2017","format":false,"excerpt":"Recently I ran out of movies on one of my longer train rides. Coincidentally, I had my Raspberry Pi Zero with me and thought, \"There's Java running on it, right?\". Doesn't Oracle Unified Directory also require a JVM? OK, I guess Raspberry Pi or ARM wasn't in focus when Oracle\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.oradba.ch\/wordpress\/category\/linux-2\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/raspberry_pi_oracle-300x240.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":11271,"url":"https:\/\/www.oradba.ch\/wordpress\/2022\/08\/easily-mitigate-log4j-vulnerability-in-oracle-unified-directory\/","url_meta":{"origin":2353,"position":5},"title":"Easily mitigate log4j vulnerability in Oracle Unified Directory","author":"Stefan","date":"26. August 2022","format":false,"excerpt":"In December 2021, the critical vulnerability in Apache Log4j (CVE-2021-44228) was disclosed. With a CVSS rating of 10 out of 10, this vulnerability was or is extremely critical. Especially since Log4j is used relatively widely. Despite a great effort, many applications could only be corrected with a delay. Thus, it\u2026","rel":"","context":"In &quot;Bundle Patch&quot;","block_context":{"text":"Bundle Patch","link":"https:\/\/www.oradba.ch\/wordpress\/category\/patches\/bp\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screenshot-2022-08-25-at-09.00.17.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screenshot-2022-08-25-at-09.00.17.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screenshot-2022-08-25-at-09.00.17.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screenshot-2022-08-25-at-09.00.17.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screenshot-2022-08-25-at-09.00.17.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/Screenshot-2022-08-25-at-09.00.17.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2353","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=2353"}],"version-history":[{"count":20,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2353\/revisions"}],"predecessor-version":[{"id":2565,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2353\/revisions\/2565"}],"wp:attachment":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/media?parent=2353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/categories?post=2353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/tags?post=2353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}