Start Tomcat at boot time in Red Hat

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2009 07:02 PM
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2009 03:24 AM
Hello,
As root :
Create : /etc/rc.d/init.d/alfresco
chmod +x /etc/rc.d/init.d/alfresco
ln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc5.d/S98alfresco
ln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc3.d/S98alfresco
These are symbolic links accessing the alfresco script, rc5 for UI start and rc3 without UI. The number S98 just controls the order in which the scripts are run, have a look inside the directory to see which number you have to write
Good luck
As root :
Create : /etc/rc.d/init.d/alfresco
#!/bin/bash## Startup script for the …## Source function library.. /etc/init.d/functionsPATH=/usr/local/bin:/sbin:/usr/sbin:$PATHexport PATH# See how we were called.case "$1" in start) echo -n "Starting Alfresco: " su - alfresco -c '/opt/Alfresco3/alf_start.sh > /dev/null 2>&1 &' ;; stop) ;; restart) $0 stop $0 start ;; reload) ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1esacexit 0
Start your DB before… perhaps set iptables rules… The redirection "> /dev/null 2>&1 &'" is used to not wait on the start of Alfresco to show the login page.chmod +x /etc/rc.d/init.d/alfresco
ln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc5.d/S98alfresco
ln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc3.d/S98alfresco
These are symbolic links accessing the alfresco script, rc5 for UI start and rc3 without UI. The number S98 just controls the order in which the scripts are run, have a look inside the directory to see which number you have to write
Good luck

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2009 09:51 AM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2009 08:03 PM
thanks for you collaboration…I'll try these options…regards
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2010 05:38 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2010 08:58 AM
Hello,
I would like to stop Alfresco properly but Mysql go off before and there is problems with the access with the db…
I have put the K…alfresco before K…mysql
/etc/rc.d/init.d/alfresco
In the rc6.d, mysql is K36mysqld
Why Alfresco is shutdown after mysql ?
Thanks
I would like to stop Alfresco properly but Mysql go off before and there is problems with the access with the db…
I have put the K…alfresco before K…mysql
/etc/rc.d/init.d/alfresco
#!/bin/bash## Startup script for Alfresco## Source function library.. /etc/init.d/functionsPATH=/usr/local/bin:/sbin:/usr/sbin:$PATHexport PATH# See how we were called.case "$1" in start) echo -n "Starting Alfresco: " su - alfresco -c '/opt/Alfresco/alf_start.sh > /dev/null 2>&1 &' ;; stop) echo -n "Stopping Alfresco…. " su - alfresco -c '/opt/Alfresco/alf_stop.sh' ;; restart) $0 stop $0 start ;; reload) ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1esacexit 0
chmod +x /etc/rc.d/init.d/alfrescoln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc5.d/S98alfrescoln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc3.d/S98alfrescoln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc0.d/K02alfrescoln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc6.d/K02alfrescoln -s /etc/rc.d/init.d/alfresco /etc/rc.d/rc1.d/K02alfresco
In the rc6.d, mysql is K36mysqld
Why Alfresco is shutdown after mysql ?
Thanks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2010 02:53 AM
The stop is never done when a do a reboot.
In the stop, I have put an echo to a log file ("echo … >> /var/log/log.log"). If a do "service alfresco stop", the message is written. But if I do a reboot, there no message…
(I have also written a message in the stop of mysql and the message is written with a reboot., it's ok)
My script has bugs… what is wrong :?: (reboot doesn't execute the stop)
This command doesn't wait until Alfresco shutdown…
In the stop, I have put an echo to a log file ("echo … >> /var/log/log.log"). If a do "service alfresco stop", the message is written. But if I do a reboot, there no message…
(I have also written a message in the stop of mysql and the message is written with a reboot., it's ok)
My script has bugs… what is wrong :?: (reboot doesn't execute the stop)
This command doesn't wait until Alfresco shutdown…
su - alfresco -c '/opt/Alfresco/alf_stop.sh'
Need to add a sleep or like this :sudo -H -u alfresco sh $CATALINA_HOME/bin/shutdown.shkillall -w -u alfresco
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2010 05:45 AM
it's ok… need to add command in the start script…
http://www.linuxquestions.org/questions/linux-newbie-8/scripts-under-rc0-d-and-rc6-d-do-not-seem-to-...
…case "$1" in start) touch /var/lock/subsys/alfresco echo -n "Starting Alfresco: "…
http://www.linuxquestions.org/questions/linux-newbie-8/scripts-under-rc0-d-and-rc6-d-do-not-seem-to-...
