11.7 Configuring the User Application for Automatic Startup

As first installed, the User Application (the JBoss application server and the MySQL database server) does not start automatically. TID 10100086 describes how to configure JBoss and MySQL as a service and have them start automatically. Most of the steps below follow the content of the TID, but some have been adapted to the latest version of MySQL and other Resource Kit specifics.

  1. From the Computer menu, select Gnome Terminal.

  2. Log in as the idmsa user by entering su idmsa, then enter the user’s password.

  3. Enter cd /opt/novell/idm/mysql to access the necessary scripts.

  4. Enter ./start-mysql.sh to start MySQL.

  5. Enter ./start-mysql-client.sh root n0v3ll to connect to MySQL.

  6. Enter use mysql; to use the MySQL database.

  7. Enter INSERT INTO `user` VALUES ('localhost','mysqlshutdown', PASSWORD('n0v3ll'),'N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0); to create a user that only has shutdown privileges.

    If you copy and paste this command, there is less chance of an error occurring.

  8. Enter flush privileges; to apply the changes.

  9. Enter quit to exit the MySQL client.

  10. Log in as root by entering su, then enter the root password.

  11. Enter gedit /home/admin/designer_workspace/RK12/Designer/Documents/Resources/bootscripts/userapp to edit an adapted version of a start script that ships with the Resource Kit.

  12. Review the script for the following variable definitions and change them according to your environment. If your environment is set up exactly like the Resource Kit, no changes are required.

    • export USERAPPBASE='/opt/novell/idm';

    • export APPLICATIONUSER='idmsa';

    • export MYSQLUSER='mysqlshutdown';

    • export MYSQLPASS='n0v3ll';

    Make sure the MYSQLPASS variable is set to the password you assigned to the mysqlshutdown user in Step 7.

  13. Select File > Save to save your changes, then select File > Quit to exit.

  14. Copy the startup script to /etc/init.d directory by entering cp /home/admin/designer_workspace/RK12/Designer/Documents/Resources/bootscripts/userapp /etc/init.d.

  15. Enter ls -l /etc/init.d/userapp to verify the file copied.

  16. Enter chown root:sys /etc/init.d/userapp to change the owner of the file.

  17. Enter chmod 700 /etc/init.d/userapp to change access to the file.

  18. Enter chkconfig -add userapp to add the script as a system service.

  19. Use the following two commands to verify whether userapp runs before or after ndsd in run-level 3 during the system start procedure.

    Ultimately, you must ensure that userapp starts after ndsd.

    NOTE:The first command uses a lowercase letter l twice. It is not the number 11.

    metaserver1:/home/admin # ll /etc/init.d/rc3.d/ |grep userapp
    lrwxrwxrwx 1 root root 10 2008-05-16 16:26 K12userapp -> ../userapp
    lrwxrwxrwx 1 root root 10 2008-05-16 16:26 S10userapp -> ../userapp
    
    metaserver1:/home/admin # ll /etc/init.d/rc3.d/ |grep ndsd
    lrwxrwxrwx 1 root root  7 2008-05-16 13:23 K11ndsd -> ../ndsd
    lrwxrwxrwx 1 root root  7 2008-05-16 13:23 S11ndsd -> ../ndsd
    

    Watch the SXX numbers (S10userapp and S11ndsd) that are prefixed to the script name. They indicate the start order. A higher number means the service is started after a lower number. If the numbers are the same, both services are started at the same time.

    In this case, userapp runs before ndsd, which is the opposite of what you want. Enter the following commands as a corrective action if the user app number is the same or lower than the ndsd number:

    metaserver1:/home/admin # mv /etc/init.d/rc3.d/S10userapp /etc/init.d/rc3.d/S12userapp
    
  20. Verify the startup order for run-level 5 (the same commands as Step 19, but instead of rc3.d, you now use rc5.d):

    metaserver1:/home/admin # ll /etc/init.d/rc5.d/ |grep userapp
    lrwxrwxrwx 1 root root 10 2008-05-16 16:26 K12userapp -> ../userapp
    lrwxrwxrwx 1 root root 10 2008-05-16 16:26 S10userapp -> ../userapp
    
    metaserver1:/home/admin # ll /etc/init.d/rc5.d/ |grep ndsd
    lrwxrwxrwx 1 root root  7 2008-05-16 13:23 K11ndsd -> ../ndsd
    lrwxrwxrwx 1 root root  7 2008-05-16 13:23 S11ndsd -> ../ndsd
    

    Enter the following commands as a corrective action if the userapp number is the same or lower than the ndsd number:

    metaserver1:/home/admin # mv /etc/init.d/rc5.d/S10userapp /etc/init.d/rc5.d/S12userapp
    
  21. Stop and start the User Application by entering /etc/init.d/userapp stop, then entering /etc/init.d/userapp start.

  22. Enter exit twice to log out as root and close the Gnome Terminal.

  23. Proceed to Section 11.8, Configuring the User Application for HTTPS.