Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 179974 - www-servers/tomcat-6.0.13-r1: init script doesn't report failure on missing temp directory
Summary: www-servers/tomcat-6.0.13-r1: init script doesn't report failure on missing t...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: William L. Thomson Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 180023
Blocks:
  Show dependency tree
 
Reported: 2007-05-27 08:10 UTC by Sandro Bonazzola (RETIRED)
Modified: 2007-07-19 19:03 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandro Bonazzola (RETIRED) gentoo-dev 2007-05-27 08:10:01 UTC
tomcat-6 temp directory is located in /var/lib/tomcat-6/temp but it's only a symlink to /var/tmp/tomcat-6.

Having /var/tmp mounted in tmpfs (mainly for /var/tmp/portage...) causes /var/tmp/tomcat-6 disappear on reboot, causing a dangling symlink.
Launching /etc/init.d/tomcat-6 start display OK on the console but the server fails to start.

The init script need some loving, if tomcat fail to start, it's not OK.
While working on the init script would be wonderful having /var/tmp/tomcat-6 created if it doesn't exists.



Reproducible: Always

Steps to Reproduce:
1. set /var/tmp mounted as tmpfs
2. emerge tomcat
3. start tomcat
4. everything works
5. reboot
6. start tomcat
7. init script says all OK
8. tomcat is not started.

Actual Results:  
init script fails to report missing directory

Expected Results:  
either init script report the error or really start tomcat (creating required missing directory)

Portage 2.1.2.7 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.5-r2, 2.6.21-gentoo-r2 x86_64)
=================================================================
System uname: 2.6.21-gentoo-r2 x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System release 1.12.10
Timestamp of tree: Sun, 27 May 2007 06:50:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.33
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
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
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -fno-strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/jetty/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /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"
CXXFLAGS="-march=athlon64 -O2 -pipe -fno-strict-aliasing"
DISTDIR="/home/ftp/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="ccache collision-protect cvs distlocks elog java-strict metadata-transfer multilib-strict sandbox sfperms sign strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/ "
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-O1"
LINGUAS="it"
PKGDIR="/home/ftp/packages"
PORTAGE_COMPRESS="bzip2"
PORTAGE_COMPRESS_FLAGS="-9"
PORTAGE_RSYNC_EXTRA_OPTS=" --timeout=400 --progress "
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 3ds 7zip X a52 aac acl acpi alsa amd64 amr aoss apache2 arts asf audiofile avahi bash-completion berkdb bitmap-fonts bl branding bzip2 cairo cal3d caps ccache cdb cddb cdparanoia cdr cg chroot cli cpudetection cracklib crypt css cups curl custom-cflags dbus devhelp dga directfb djvu dmi dovecot-sasl dri dts dv dvd dvdr dvdread emerald encode epydoc erandom esd exif expat extrafilters fame ffmpeg firefox flac fltk foomaticdb gd gdbm ggi gif gimp gimpprint glib glibc-omitfp glitz glut gmp gnokii gnome gnutls gphoto2 gpm graphviz gsm gtk gtkhtml guile hal howl-compat iconv idn ieee1394 imagemagick imlib ipv6 isc isdnlog ithreads java javacomm javascript jbig jikes jpeg jpeg2k justify kde kdeenablefinal kdehiddenvisibility kqemu lcms ldap libcaca libg++ libnotify linuxthreads-tls lm_sensors logitech-mouse logrotate lzo mad mailwrapper matroska mbox mdb mhash midi mikmod mjpeg mmap mmx mmxext mng motif mozdevelop mp3 mpeg mpm-worker msn mudflap musepack musicbrainz mysql ncurses nfs nls nptl nptlonly nsplugin numeric nvidia odbc ode offensive ogg ogre on-the-fly-crypt openexr opengl openmp oss pam pch pcre pdf perl php png povray ppds pppd pulseaudio python qa qt3 qt3support qt4 quicktime rdesktop readline reflection resolvconf restrict-javascript rtc samba scanner sdl session slang smime sndfile snmp speex spell spl sse sse2 ssl startup-notification subversion svg sysfs syslog tcltk tcpd test tetex tga theora threads tidy tiff timidity tk truetype truetype-fonts type1-fonts unicode usb userlocales utempter v4l v4l2 vcd vda vorbis vorbis-psy wma wmf wmp xattr xcomposite xforms xine xinerama xml xorg xpm xscreensaver xv xvid xvmc yv12 zeroconf zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" FOO2ZJS_DEVICES="hp1005" INPUT_DEVICES="mouse evdev keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
Unset:  CTARGET, INSTALL_MASK, LC_ALL, MAKEOPTS
Comment 1 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-27 15:36:58 UTC
(In reply to comment #0)
>
> Having /var/tmp mounted in tmpfs (mainly for /var/tmp/portage...) causes
> /var/tmp/tomcat-6 disappear on reboot, causing a dangling symlink.

Might want to consider just putting /var/tmp/portage on tmpfs, that way only the contents in that dir get blown away on reboot.

http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE

> Launching /etc/init.d/tomcat-6 start display OK on the console but the server
> fails to start.
> 
> The init script need some loving, if tomcat fail to start, it's not OK.

That seems like more of a problem with start-stop-daemon. I am passing 
--chdir "${CATALINA_TMPDIR}" to start-stop-daemon, and it's spitting out 
/sbin/start-stop-daemon: Unable to chdir() to /var/tmp/tomcat-6/ (No such file or directory) in catalina.out.

That might be due to how we are capturing stderr/stdout but s-s-d should fail either way and no spit out OK. So why start-stop-daemon continues on trying to start Tomcat instead of just failing and bailing. I am not sure of ATM.

> While working on the init script would be wonderful having /var/tmp/tomcat-6
> created if it doesn't exists.

I will take that under consideration. But not only will I have to create them, but will have to change ownership and make sure permissions are correct. FYI this is partly a result of another user requesting Tomcat's pwd be set during start, and not default. Thus the error is coming from that, since it's pwd is it's temp dir. That does not exist on your system.

> Actual Results:  
> init script fails to report missing directory
> 
> Expected Results:  
> either init script report the error or really start tomcat (creating required
> missing directory)

Well it's being logged in catalina.out about the failure. Granted s-s-d should fail to start and not spit out OK. I will see about opening a bug for s-s-d. The error would show up on terminal IF we weren't capturing stdout/stderr as we are.

Which at the present time is the only way to capture that information which many have requested and required. Upstream also captures and re-directions Tomcat's stdout/err.

Based on my gut feelings about not liking the idea of creating dirs in an init script and etc that were created by an ebuild. Not to mention that according to FHS /var/tmp is supposed to remain after boot.

Going to close this bug as invalid, primarily due to FHS compliance.
Comment 2 Sandro Bonazzola (RETIRED) gentoo-dev 2007-05-30 17:17:59 UTC
(In reply to comment #1)
> (In reply to comment #0)

> > Having /var/tmp mounted in tmpfs (mainly for /var/tmp/portage...) causes
> > /var/tmp/tomcat-6 disappear on reboot, causing a dangling symlink.
> 
> Might want to consider just putting /var/tmp/portage on tmpfs, that way only
> the contents in that dir get blown away on reboot.

[cut]

> Based on my gut feelings about not liking the idea of creating dirs in an init
> script and etc that were created by an ebuild. Not to mention that according to
> FHS /var/tmp is supposed to remain after boot.
> 
> Going to close this bug as invalid, primarily due to FHS compliance.


I will not reopen the bug because I accept your point of view. I'll move portage temp dir to /tmp since I don't need/want preserve it's content between reboots.
However note that FHS compliance saya also that "Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp." so /var/tmp can be cleaned anyway an /var/tmp/tomcat-6 can disappear. The service should be robust and recreate a temporary directory if it need one. I'll add a test in local.start but I hope you consider to add at least a test on the existence of the temp dir with a warning if it's missing.