Hi, this is the script I sent to Benjamin.
Hope helps.
Regards.
R
---
#!/bin/bash
RETVAL=$?
export JAVA_HOME=/opt/java
export JDK_HOME=/opt/jdk
export FEDORA_HOME=/var/fedora
export CATALINA_HOME=$FEDORA_HOME/tomcat
export JAVA_OPTS='-Xmx512M -Xms128M -XX:MaxPermSize=256M -Dfile.encoding=UTF-8
-Djavax.net.ssl.trustStore=/var/fedora/server/truststo
re -Djavax.net.ssl.trustStorePassword=tomcat'
export
PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$FEDORA_HOME/server/bin:$FEDORA_HOME/client/bin:$PATH
case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo "Starting Tomcat"
/bin/su fedora -c "$CATALINA_HOME/bin/startup.sh"
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo "Stopping Tomcat"
/bin/su fedora -c "$CATALINA_HOME/bin/shutdown.sh"
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
On 11/ago/2010, at 15.38, Benjamin Knoth wrote:
> Hi Chris, Riccardo and all,
> i tested this script.
> The script works but i think it starts too early.
> If i start fedora manually before postgresql will start i get an 500
> error.
> But if i start normally after the postgresql was started it runs fine.
>
> If i add fedora with chkconfig --add fedora, it will added as S01 and
> K22.
> Natually everything starts on boot but if i log in in fedora i get
> also a 500 error on the browser.
> To this point it's ok.
> But if i change manual K22 to K01 and S01 to S22 and reboot, i also
> get a 500 error.
> (postgresql starts with S11 and Shutdown with K12)
> In this point i don't understand the logic.
>
> Do my changes be ignored, if i add fedora with chkconfig and can i
> change the priority in the chkconfig-command?
>
> I add this line in the script.
> # chkconfig: 2345 5 95
> I changed the last two data. If i add fedora with chkconfig on every
> time i get S01fedora and K22fedora.
>
> best regards
> Benjamin
>
> Am 11.08.2010 14:41, schrieb Chris Wilper:
> > Hi Benjamin,
>
> >
>
>
> > On Wed, Aug 11, 2010 at 3:31 AM, Benjamin Knoth
>
> <[email protected]>
>
> > wrote:
>
>
> >> Hi all, i would like to start fedora as autostart on boot. I
>
>
> >> wrote a simple script which only includes the startcommand. I
>
>
> >> gave the script the execute rights and if i start this
> script
>
>
> >> manual as root or user fedora it starts. But if i save this
>
>
> >> script in /etc/init.d/rc3.d/S07fedora on SLES 10 SP2 and
> restart
>
>
> >> the system, fedora won't be started on boot up.
>
>
> >>
>
>
> >> Code of the script
>
>
> >>
>
>
> >> #!/bin/sh su - tomcat -c
> /usr/local/fedora/tomcat/bin/startup.sh
>
>
> >>
>
>
> >> What should i do?
>
>
> >
>
>
> > I don't know what's causing it to fail to start up, but chances
>
>
> > are, someone has already written an init script for Tomcat for
> your
>
>
> > OS that you can adapt for this purpose.
>
>
> >
>
>
> > If you can't find one that works with SLES on the web, I'd
>
>
> > recommend briefly installing tomcat (5 or 6) with your OS's
> package
>
>
> > manager (yast?), and copying the /etc/init.d/tomcat* file it
>
>
> > creates to /etc/init.d/fcrepo (or whatever you want to call the
>
>
> > service). Then uninstall tomcat, and adapt the script to your
>
>
> > purpose, changing the user it runs as, and the chkconfig and/or
>
>
> > INIT INFO blocks as desired.
>
>
> >
>
>
> > Once that's done, you can use the insserv utility that comes with
>
>
> > SLES and it will create the symlinks for as necessary.
>
>
> >
>
>
> > More info on the SLES init process here:
>
>
> >
>
> http://www.linuxtopia.org/online_books/suse_linux_guides/SLES10/suse_enterprise_linux_server_installation_admin/sec_boot_init.html
>
> >
>
>
> >
>
>
> >
>
> Good luck,
> > Chris
>
> --
> Benjamin Knoth
> Max Planck Digital Library (MPDL)
> Systemadministration
> Amalienstrasse 33
> 80799 München, Germany
> http://www.mpdl.mpg.de
>
> Mail: [email protected]
> Phone: +49 89 38602 202
> Fax: +49-89-38602-280
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Fedora-commons-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
---
Riccardo Valzorio
C.I.L.E.A.
Sezione Gestione Sistemi
Tel: 02 26995384
Mail: [email protected]
"A computer is like air conditioning: it becomes useless when you open
windows." L. Torvalds
GPG Key Fingeprint: BD93 74F3 42E6 B99C D9A1 7202 ABE6 8304 6F9C 18B0
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ Fedora-commons-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
