Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246362 - www-servers/tomcat-6.0.18-r1 - Does not start after a reboot if /var/tmp/tomcat-6 has been deleted
Summary: www-servers/tomcat-6.0.18-r1 - Does not start after a reboot if /var/tmp/tomc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2008-11-11 00:43 UTC by orlin
Modified: 2009-03-22 10:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
A Patch for the tomcat.init file. (tomcat.init.patch,614 bytes, patch)
2009-03-22 10:38 UTC, Patrick Beckmann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description orlin 2008-11-11 00:43:35 UTC
The problem is somewhat strange. After I restart my computer I am unable to start the tomcat, both when using the init script and the tomcat startup script. In order to get tomcat to work again I need to reemerge it. Then I can start/stop/restart the tomcat server until the next computer restart. 


Reproducible: Always

Steps to Reproduce:
1. Install tomcat
2. Restart computer
3. Start tomcat
Actual Results:  
The tomcat server is not reachable. The port seems to be closed, confirmed by nmap and ps.

Expected Results:  
Beeing able to use the tomcat server.

emerge --info 
Portage 2.2_rc13 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7 x86_64)
=================================================================
System uname: Linux-2.6.25-gentoo-r7-x86_64-AMD_Turion-tm-_64_Mobile_Technology_ML-30-with-glibc2.2.5
Timestamp of tree: Sat, 08 Nov 2008 05:15:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
dev-util/cmake:      2.6.1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -msse3  -pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -msse3  -pipe -O2"
DISTDIR="/home/orlin/portage//distfiles/"
FEATURES="distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo "
LDFLAGS="-Wl,-O1"
LINGUAS="en en_GB bg"
MAKEOPTS="-j2"
PKGDIR="/home/orlin/portage//packages/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/portage_tmp/"
PORTDIR="/home/orlin/portage/"
PORTDIR_OVERLAY="/usr/portage/local/layman/desktop-effects /usr/portage/local/layman/sunrise /usr/portage/local/layman/java-overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d Xshape a52 aac aalib acl acpi alsa amd64 arts bash-completion berkdb bl bluetooth branding bzip2 cairo cdio cdr cdwrite cgi cli cracklib crypt cups cxx dbus dga directfb dri dv dvd dvdr dvdread dvdwrite emboss enca encode esd fam ffmpeg fortran fpx gdbm geoip gif gpm graphviz gstreamer gtk h264 hal hddtemp hdri http iconv ieee1394 imagemagick irmc isdnlog jack java java6 jbig jpeg jpeg2k kde kdepim laptop lcms lesstif libnotify libwww lm_sensors loop-aes mad matroska midi mikmod mmx motif mp3 mp4 mpeg mplayer mudflap multilib musepack musicbrainz ncurses neXt njb nls nptl nptlonly nsplugin obex ogg openal opengl openmp osd pcmcia pcre pdf perl physfs png ppds pppd pvr python qt3 qt3support qt4 quicktime rar readline reflection rtc ruby samba sdl sdl-mixer sdl-sound session skey smartcard sms sndfile spell spl sqlite srt sse sse2 ssl startup-notification svg symlink sysfs tcpd tetex theora threads tiff tk truetype unicode usb v4l v4l2 vcd vorbis wifi wmf x264 xanim xattr xcomposite xine xinerama xml xorg xosd xv xvid yv12 zeroconf zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB bg" USERLAND="GNU" VIDEO_CARDS="radeon mesa vga vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2008-12-08 04:17:32 UTC
Reassigning this bug to the java team as wltjr was retired.
Comment 2 Alistair Bush (RETIRED) gentoo-dev 2008-12-10 08:34:31 UTC
Are there any logs within /var/log/tomcat-6/

If so please attach them. you may want to rm the old ones and then reproduce to get rid of any crud.
Comment 3 orlin 2008-12-10 12:40:11 UTC
Ok... I deleted every file from /var/log/tomcat-6/ without the directory:
ls -alsh /var/log/ | grep tomcat
4.0K drwxrwxr-x  2 tomcat  tomcat  4.0K Dec 10 13:12 tomcat-6

After starting with: /etc/init.d/tomcat 6 start the server is not up, there is a file in /var/log/tomcat-6: catalina.out with only this line:
/sbin/start-stop-daemon: Unable to chdir() to /var/tmp/tomcat-6/ (No such file or directory)
So... I create the directory:
mkdir /var/tmp/tomcat-6/
chowm tomcat:tomcat /var/tmp/tomcat-6/
And now when I restart the tomcat server it works.

Ahhh... I dont know why I didnt come with the idea to check the logs, but I was watching the memory, the opened ports, etc...

It is a common configuration to delete the /var/tmp during starting, so maybe the startup script should reconstruct the /var/tmp/tomcat-6 directory?

I am currently woundering if I should put the bug as fixed or wait for a new version of the startup script (maybe upstream) and then put it as fixed.
Comment 4 Alistair Bush (RETIRED) gentoo-dev 2008-12-10 18:44:19 UTC
> It is a common configuration to delete the /var/tmp during starting, so maybe
> the startup script should reconstruct the /var/tmp/tomcat-6 directory?
>

Yes I would say that should be the case.
 
> I am currently woundering if I should put the bug as fixed or wait for a new
> version of the startup script (maybe upstream) and then put it as fixed.
> 

Another work around would be to change to location of CATALINA_TMPDIR in conf.d/tomcat-6 to something outside of the /var/tmp directory.

Another thing for me to note.

/var/lib/tomcat-(\d)/temp -> /var/tmp/tomcat-(\d).  This will not be changed after updating CATALINA_TMPDIR.  Is this a bug?
Comment 5 orlin 2008-12-10 20:31:28 UTC
I just simply put 
mkdir /var/tmp/tomcat-6/
chowm tomcat:tomcat /var/tmp/tomcat-6/

in /etc/conf.d/local.start and it works. Yet the idea is to get the problem resolved for the default config, where CATALINA_TMPDIR=/var/tmp/tomcat-6. Pushing a tmp directory outside of /var/tmp might is not an option as someone might mount the non tmp directory read only, so maybe the best resolution would be to make the init script check if the tmp directory exists or not?
Comment 6 Alistair Bush (RETIRED) gentoo-dev 2008-12-19 20:51:10 UTC
Fixed.  Added test for tmp dir and errors with message if it doesn't exist.
Comment 7 Patrick Beckmann 2009-03-22 10:38:20 UTC
Created attachment 185843 [details, diff]
A Patch for the tomcat.init file.

Instead of only outputting an error message I suggest to create the directory, too. If it did not exist before, creating it should not hurt. In addition the user is informed by a message.

The work-around to create it in /etc/conf.d/local.start does not work at system startup, as "local" is executed "after *".