Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have packaged a WAR file and its companion config file as RPM. My SPEC file checks whether JBoss is running. If it is, the installation exits with an error message, requesting that JBoss be stopped before installation. </p> <p>In general, it is not a good idea to kill processes or force restart through RPMs. The person in charge of installation should have a separate procedure for doing this.</p> <h2>Other considerations:</h2> <h3>1. Does your organization have other installations on the same server?</h3> <p>If so, you might want to standardize on a path under which all installations on the server will go. (For example, /usr/local/bin/myorg/) It might also help to have a custom *nix user and group, for which file attributes are set for all installations on the server.</p> <h3>2. Do you want a relocatable RPM?</h3> <p>Is there ever a chance that you might want to change the default path for your installation? If so, a relocatable RPM will help. There are conditions where a relocatable RPM may not work, so check out <a href="http://www.rpm.org/max-rpm/s1-rpm-reloc-wrinkles.html">these things to consider</a> at <a href="http://www.rpm.org/max-rpm/ch-rpm-reloc.html">www.rpm.org</a>.</p> <h3>3. Do you want to back up an existing deployment when your RPM runs?</h3> <p>If so, you would need to write that code in your SPEC file.</p> <h2>Here is my complete SPEC file:</h2> <pre class="lang-sh prettyprint-override"><code>Summary: Summary for my Java project Name: Name for my Java project Version: 2.1.2 Release: 5 Requires: jboss &gt;= 5.1 BuildArch: noarch Group: Internet / Applications Prefix: /usr/local/bin License: (C) Copyright my organization Vendor: my organization %description Description for my Java project %prep # Check if the WAR file has been created %install # Copy war file to buildroot's Jboss deployment directory # Copy config file to buildroot's Jboss config directory %files # Set file permissions and ownership %pre # Check if JBoss deployment path exists on the web server. # If not, exit with an error. # Check if JBoss config file path exists on the web server. # If not, exit with an error. # Check if custom user 'myuser' exists. If not, exit with an error. # Check if custom group 'mygroup' exists. If not, exit with an error # Check if JBOSS is running. If yes, exit with an error. # Take backup of existing deployment, if needed. %post # Perform post-installation steps, if needed. echo "Installation complete." </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload