Changes

Jump to navigation Jump to search
m
Line 605: Line 605:  
# First, create the traditional init script <tt class="FILENAME">/etc/rc.d/init.d/myserver</tt> which can be run with the command-line arguments "start" or "stop" to perform the appropriate action on the server. Look at other init scripts in the same directory for examples. This script should be included in your RPM.<div class="NOTE"><blockquote class="NOTE">'''Note: ''' If your service is managed by runit, all you need is a link to the '''daemontools''' script.</blockquote></div>
 
# First, create the traditional init script <tt class="FILENAME">/etc/rc.d/init.d/myserver</tt> which can be run with the command-line arguments "start" or "stop" to perform the appropriate action on the server. Look at other init scripts in the same directory for examples. This script should be included in your RPM.<div class="NOTE"><blockquote class="NOTE">'''Note: ''' If your service is managed by runit, all you need is a link to the '''daemontools''' script.</blockquote></div>
 
# Second, create a symbolic link as shown below, choosing the two-digit number after the letter S to control the startup order of the server programs. Include this symbolic link in your RPM. /etc/rc.d/rc7.d/S55myserver -> /etc/rc.d/init.d/e-smith-serviceThese two steps are typical for any Linux/Unix server application, except that the symbolic link traditionally points directly to the init script, rather than to <tt class="FILENAME">e-smith-service</tt>. Remember, we want to link to <tt class="FILENAME">e-smith-service</tt> to ensure that a <var class="LITERAL">disabled</var> service does <span class="emphasis">''not''</span> start at boot time.
 
# Second, create a symbolic link as shown below, choosing the two-digit number after the letter S to control the startup order of the server programs. Include this symbolic link in your RPM. /etc/rc.d/rc7.d/S55myserver -> /etc/rc.d/init.d/e-smith-serviceThese two steps are typical for any Linux/Unix server application, except that the symbolic link traditionally points directly to the init script, rather than to <tt class="FILENAME">e-smith-service</tt>. Remember, we want to link to <tt class="FILENAME">e-smith-service</tt> to ensure that a <var class="LITERAL">disabled</var> service does <span class="emphasis">''not''</span> start at boot time.
# Third, let's assume for now that <var class="LITERAL">myserver</var> should be enabled by default, and so start at boot time. You just need to create some properties in the configuration database to make that happen: cd /etc/e-smith/db/configuration/defaults
+
# Third, let's assume for now that <var class="LITERAL">myserver</var> should be enabled by default, and so start at boot time. You just need to create some properties in the configuration database to make that happen:
 +
cd /etc/e-smith/db/configuration/defaults
 
  mkdir myserver
 
  mkdir myserver
 
  cd myserver
 
  cd myserver
 
   
 
   
 
  echo service >type
 
  echo service >type
  echo enabled >statusFor testing, you will also need to run '''initialize-default-databases''' to load these new defaults.
+
  echo enabled >status
 +
 
 +
For testing, you will also need to run '''initialize-default-databases''' to load these new defaults.
 +
 
 
# Your RPM can also start the service in the <var class="LITERAL">%post</var> section, but you need to be very careful to only do this in run-level 7. The same <var class="LITERAL">%post</var> section is run during installation from CDROM, and we do not want services started during that installation. They will most likely fail and may cause the CD install to fail.
 
# Your RPM can also start the service in the <var class="LITERAL">%post</var> section, but you need to be very careful to only do this in run-level 7. The same <var class="LITERAL">%post</var> section is run during installation from CDROM, and we do not want services started during that installation. They will most likely fail and may cause the CD install to fail.
  

Navigation menu