Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Mar 2007 17:29:02 GMT
From:      Nemo Liu<nemoliu@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/110163: [NEW PORT]Jboss5b1
Message-ID:  <200703101729.l2AHT2g8043022@www.freebsd.org>
Resent-Message-ID: <200703101730.l2AHU4nD047311@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         110163
>Category:       ports
>Synopsis:       [NEW PORT]Jboss5b1
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 10 17:30:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Nemo Liu
>Release:        6.2
>Organization:
>Environment:
FreeBSD nfstest.sina.com.cn 6.2-STORM-r4 FreeBSD 6.2-STORM-r4 #1: Thu Feb  1 09:43:06 UTC 2007     root@mammoth.sina.com:/usr/obj/usr/src/sys/SMP  i386
>Description:
NEW PORT: jboss5

Boss AS 5 GA will be Java EE 5 certified and will include the following core technologies.

    * JBoss Microcontainer - POJO based microcontainer removing the dependency on JMX
    * EJB 3.0 - Fully certified as part of the Java EE 5 compliant JBoss AS 5
    * Hibernate 3.2 - JPA certified
    * JBoss Messaging 1.2 - the next generation messaging platform from JBoss with HA features.
    * JBoss WebServices 2.0 - new custom built JAX-WS compliant WebServices stack.
    * JBoss Seam 1.1 - a powerful new application framework to build next generation Web 2.0 applications by unifying and integrating popular service oriented architecture (SOA) technologies

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	/home/liutong/jboss5
#	/home/liutong/jboss5/files
#	/home/liutong/jboss5/files/daemonctl.1
#	/home/liutong/jboss5/files/daemonctl.c
#	/home/liutong/jboss5/files/patch-serial-autoinc
#	/home/liutong/jboss5/files/pkg-message
#	/home/liutong/jboss5/files/startup.sh.in
#	/home/liutong/jboss5/Makefile
#	/home/liutong/jboss5/distinfo
#	/home/liutong/jboss5/pkg-deinstall
#	/home/liutong/jboss5/pkg-descr
#	/home/liutong/jboss5/pkg-install
#
echo c - /home/liutong/jboss5
mkdir -p /home/liutong/jboss5 > /dev/null 2>&1
echo c - /home/liutong/jboss5/files
mkdir -p /home/liutong/jboss5/files > /dev/null 2>&1
echo x - /home/liutong/jboss5/files/daemonctl.1
sed 's/^X//' >/home/liutong/jboss5/files/daemonctl.1 << 'END-of-/home/liutong/jboss5/files/daemonctl.1'
X.Dd February 21, 2002
X.Dt %%CONTROL_SCRIPT_MANPAGE_TITLE%% 1
X.Os FreeBSD
X.Sh NAME
X.Nm %%CONTROL_SCRIPT_NAME%%
X.Nd %%APP_TITLE%% server control interface
X.Sh SYNOPSIS
X.Nm
X.Op Fl java-options
X.Ar {start|restart|stop}
X.Sh DESCRIPTION
XThe
X.Nm
Xprogram provides an restricted interface to the %%APP_TITLE%%
Xapplication server. The
X.Nm
Xprogram is only accessible to users in the 'www' group, and will
Xonly invoke the %%JAVA_PORT_OS_DESCRIPTION%% %%JAVA_PORT_VERSION%% JVM.
X.Pp
XAny Java options listed are handed off directly to the JVM. Any
Xclasspath options will be ignored.
X.Pp
XThe program expects exactly one of the following terminating commands:
X.Bl -tag -width indent
X.It Ar start
XStart %%APP_TITLE%%, if it is not already running.
X.It Ar restart
XRestart %%APP_TITLE%%. If it is already running, then it will be stopped and
Xthen started right after that. Otherwise it will just be started up.
X.It Ar stop
XStop %%APP_TITLE%%, if it is actually running.
X.El
X.Sh ERRORS
XThe following error conditions are detected. They will be checked in the
Xspecified order. In each case an error message is printed with the name of the
Xcontrol program prepended.
X.Pp
XIf no argument is passed, then a simple help message is printed and the
Xprogram exists with error code 0.
X.Pp
XIf at least one argument is passed, but it is different from
X.Ar start ,
X.Ar restart
Xor
X.Ar stop
Xthen the help message is printed as well, and the program exits with error
Xcode 1.
X.Pp
XThe following errors conditions are defined:
X.Bl -tag -width indent
X.It Em Illegal program argument (error code 1)
X.It Em PID file not found (error code 2)
X.It Em PID file too large (error code 3)
X.It Em PID file contains illegal character (error code 4)
X.It Em Kill of process failed (error code 5)
X.It Em %%APP_TITLE%% is already running (error code 6)
X.It Em %%APP_TITLE%% is not running (error code 7)
X.It Em Unable to chdir to the %%APP_TITLE%% home directory (error code 8)
X.It Em Unable to open the stdout log file (error code 9)
X.It Em Unable to open the stderr log file (error code 10)
X.It Em Unable to start %%APP_TITLE%% (error code 11)
X.El
X.Sh FILES
X.Bl -tag -width -indent
X.It Pa %%PID_FILE%%
XThe %%APP_TITLE%% PID file that is used to store the process ID of the
Xcurrently running process in. It is emptied as soon as the server is stopped
Xand filled with the process ID when it is started. It should never be writable
Xfor anyone but
X.Em www ,
X.It Pa %%STARTUP_SCRIPT%%
XA script that starts the
X.Nm
Xprogram. It is used to start %%APP_TITLE%% at startup time.
X.El
X.Sh AUTHORS
X.An Ernst de Haan Aq znerd@FreeBSD.org
X.An Jonathan Chen Aq jonc@chen.org.nz
END-of-/home/liutong/jboss5/files/daemonctl.1
echo x - /home/liutong/jboss5/files/daemonctl.c
sed 's/^X//' >/home/liutong/jboss5/files/daemonctl.c << 'END-of-/home/liutong/jboss5/files/daemonctl.c'
X/*
X * -*- mode: Fundamental; tab-width: 4; -*-
X * ex:ts=4
X *
X * Daemon control program, with Java Startup options.
X *
X *	Original by Ernst de Haan <znerd@freebsd.org>
X *	www/jakarta-tomcat4/files/daemonctl.c
X *
X * $FreeBSD$
X */
X
X#include <assert.h>
X#include <fcntl.h>
X#include <signal.h>
X#include <stdarg.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <syslog.h>
X#include <unistd.h>
X#include <sys/errno.h>
X#include <sys/stat.h>
X#include <sys/types.h>
X#include <sys/uio.h>
X
X#define	TRUE	1
X#define	FALSE	0
X
X/* The interval in seconds between the checks to make sure the process
X   died after a kill */
X#define STOP_TIME_INTERVAL		1
X
X#define ERR_ILLEGAL_ARGUMENT				1
X#define ERR_PID_FILE_NOT_FOUND				2
X#define ERR_KILL_FAILED						5
X#define ERR_ALREADY_RUNNING					6
X#define ERR_NOT_RUNNING						7
X#define ERR_CHDIR_TO_APP_HOME				8
X#define ERR_ACCESS_JAR_FILE					17
X#define ERR_STDOUT_LOGFILE_OPEN				9
X#define ERR_STDERR_LOGFILE_OPEN				10
X#define ERR_FORK_FAILED						11
X#define ERR_STAT_JAVA_HOME					12
X#define ERR_JAVA_HOME_NOT_DIR				13
X#define ERR_STAT_JAVA_CMD					14
X#define ERR_JAVA_CMD_NOT_FILE				15
X#define ERR_JAVA_CMD_NOT_EXECUTABLE			16
X
X/*
X	Function declarations.
X */
Xstatic void printUsage (void);
Xstatic int readPID (void);
Xstatic void writePID (int pid);
Xstatic void clearPID (void);
Xstatic void start (int javaOpt, char * javaArgs [], int jbossOpt, char * jbossArgs []);
Xstatic void stop (void);
Xstatic void restart (int javaOpt, char * javaArgs [], int jbossOpt, char * jbossArgs []);
Xstatic void logOutput (char *);
X
X/*
X	Globals
X */
Xstatic int isQuiet = FALSE;
Xstatic char * optQuiet = "-q",			/* quiet option */
X			* optConfig = "-config";	/* jboss configuration option */
X
X/**
X * Main function. This function is called when this program is executed.
X *
X * @param argc
X *    the number of arguments plus one, so always greater than 0.
X *
X * @param argv
X *    the arguments in an array of character pointers, where the last argument
X *    element is followed by a NULL element.
X */
Xint
Xmain (
X int argc,
X char *argv [])
X{
X	/* Declare variables, like all other good ANSI C programs do :) */
X	int i, javaOpt, jbossOpt;
X	char *argument, **javaArgs, **jbossArgs;
X
X	/* Parse the arguments */
X	if (argc < 2)
X	{
X		printUsage ();
X		return 0;
X	}
X
X	/* XXX: Fix for setting up the environment for the java wrapper script */
X	setuid (geteuid ());
X	setgid (getegid ());
X
X	/*
X		Build up java and jboss option blocks.
X	 */
X	javaOpt = jbossOpt = 0;
X	for (i = 1; i < argc; i++)
X	{
X		if (strcmp (argv [i], optQuiet) == 0)
X		{
X			isQuiet = TRUE;
X
X		} else if (strcmp (argv [i], optConfig) == 0)
X		{
X			jbossOpt += 2;
X			if (++i >= argc)
X			{
X				printUsage ();
X				return ERR_ILLEGAL_ARGUMENT;
X			}
X
X		} else if (*argv [i] == '-')
X		{
X			javaOpt++;
X		}
X	}
X	if (javaOpt == 0)
X		javaArgs = NULL;
X	else
X	{
X		int j = 0;
X		javaArgs = malloc (sizeof (char *) * javaOpt);
X		for (i = 0; i < argc; i++)
X		{
X			if (strcmp (argv [i], optQuiet) &&
X				strcmp (argv [i], optConfig) &&
X				*argv [i] == '-')
X			{
X				javaArgs [j++] = argv [i];
X			}
X		}
X	}
X	if (jbossOpt == 0)
X		jbossArgs = NULL;
X	else
X	{
X		int j = 0;
X		jbossArgs = malloc (sizeof (char *) * jbossOpt);
X		for (i = 0; i < argc; i++)
X		{
X			if (strcmp (argv [i], optConfig) == 0)
X			{
X				jbossArgs [j++] = "-c";
X				jbossArgs [j++] = argv [++i];
X			}
X		}
X	}
X
X	/*
X		Decide on just what to call.
X	 */
X	argument = argv [argc - 1];
X	if (strcmp ("start", argument) == 0)
X	{
X		start (javaOpt, javaArgs, jbossOpt, jbossArgs);
X
X	} else if (strcmp ("stop", argument) == 0)
X	{
X		stop ();
X
X	} else if (strcmp ("restart", argument) == 0)
X	{
X		restart (javaOpt, javaArgs, jbossOpt, jbossArgs);
X
X	} else {
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Illegal argument \"%s\".\n", argument);
X		printUsage ();
X		exit (ERR_ILLEGAL_ARGUMENT);
X	}
X
X	return EXIT_SUCCESS;
X}
X
X/**
X * Prints usage information to stdout.
X */
Xstatic void
XprintUsage (void)
X{
X	printf ("Usage: %%CONTROL_SCRIPT_NAME%% [java-options] [-config jbossconfig] {start|stop|restart}\n");
X}
X
X/**
X * Reads a PID from the PID file.
X *
X * @return
X *    the PID, or -1 if the file was empty.
X */
Xstatic int
XreadPID (void)
X{
X	FILE * file;
X	int pid;
X
X	logOutput (">> Reading PID file (%%PID_FILE%%)...");
X	file = fopen ("%%PID_FILE%%", "r");
X	if (!file)
X	{
X		logOutput (" [ FAILED ]\n");
X		perror ("%%CONTROL_SCRIPT_NAME%%: Unable to open %%PID_FILE%% for reading: ");
X		exit (ERR_PID_FILE_NOT_FOUND);
X	}
X	if (fscanf (file, "%d", &pid) < 1)
X		pid = -1;
X	fclose (file);
X
X	logOutput (" [ DONE ]\n");
X	return pid;
X}
X
X/**
X * Writes a process ID to the specified file. The file is identified by a file
X * handle.
X *
X * @param pid
X *    the PID to store, always greater than 0.
X */
Xstatic void
XwritePID (
X int pid)
X{
X	FILE * file;
X
X	logOutput (">> Writing PID file...");
X	file = fopen ("%%PID_FILE%%", "w");
X	if (!file)
X	{
X		logOutput (" [ FAILED ]\n");
X		perror ("%%CONTROL_SCRIPT_NAME%%: Unable to open %%PID_FILE%% for writing: ");
X		exit (ERR_PID_FILE_NOT_FOUND);
X	}
X	fprintf (file, "%d\n", pid);
X	fclose (file);
X
X	logOutput (" [ DONE ]\n");
X}
X
X/**
X	Truncate the PID file.
X */
Xstatic void
XclearPID (void)
X{
X	if (truncate ("%%PID_FILE%%", 0) != 0)
X	{
X		perror ("%%CONTROL_SCRIPT_NAME%%: Unable to clear %%PID_FILE%%: ");
X		exit (ERR_PID_FILE_NOT_FOUND);
X	}
X}
X
X/**
X * Checks if the specified process is running.
X *
X * @param pid
X *    the process id, greater than 0.
X *
X * @return
X *    0 if the specified process is not running, a different value otherwise.
X */
Xstatic int
XexistsProcess (
X int pid)
X{
X	int result;
X
X	/* Check preconditions */
X	assert (pid > 0);
X
X	/* See if the process exists */
X   	result = kill (pid, 0);
X
X	/* If the result is 0, then the process exists */
X	return result == 0;
X}
X
X/**
X * Kills the process identified by the specified ID.
X *
X * @param pid
X *    the process id, greater than 0.
X */
Xstatic void
XkillProcess (
X int pid)
X{
X	int result;
X	unsigned int waited;
X	unsigned int forced;
X	unsigned int interval = STOP_TIME_INTERVAL;
X	unsigned int timeout  = %%STOP_TIMEOUT%%;
X
X	/* Check preconditions */
X	assert (pid > 0);
X
X	if (!isQuiet)
X		printf (">> Terminating process %d...", pid);
X	result = kill (pid, SIGTERM);
X	if (result < 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to kill process %d: ", pid);
X		perror (NULL);
X		exit (ERR_KILL_FAILED);
X	}
X
X	/* Wait until the process is actually killed */
X    result = existsProcess (pid);
X	for (waited=0; result == 1 && waited < timeout; waited += interval)
X	{
X		logOutput (".");
X		fflush (stdout);
X		sleep (interval);
X    	result = existsProcess (pid);
X	}
X
X	/* If the process still exists, then have no mercy and kill it */
X	forced = 0;
X	if (result == 1)
X	{
X		/* Force the process to die */
X		result = kill (pid, SIGKILL);
X		if (result == 0) {
X			forced = 1;
X			logOutput (" [ KILLED ]\n");
X			fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Process %d did not terminate within %%STOP_TIMEOUT%% sec. Killed.\n", pid);
X		} else if (result != ESRCH) {
X			logOutput (" [ FAILED ]\n");
X			fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to kill process %d: ", pid);
X			perror (NULL);
X			exit (ERR_KILL_FAILED);
X		}
X	}
X
X	if (forced == 0) {
X		logOutput (" [ DONE ]\n");
X	}
X}
X
X/**
X * Starts the daemon.
X */
Xstatic void
Xstart (
X int javaOpt,
X char * javaArgs [],
X int jbossOpt,
X char * jbossArgs [])
X{
X	int i, argc;
X	char ** argv;
X	int pid;
X	int result;
X	int stdoutLogFile;
X	int stderrLogFile;
X	struct stat sb;
X
X	pid = readPID ();
X
X	logOutput (">> Starting %%APP_TITLE%% %%PORTVERSION%%...");
X	if (pid != -1)
X	{
X		/* Check if the process actually exists */
X		result = existsProcess (pid);
X		if (result == 1)
X		{
X			logOutput (" [ FAILED ]\n");
X			fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: %%APP_TITLE%% %%PORTVERSION%% is already running, PID is %d.\n", pid);
X			exit (ERR_ALREADY_RUNNING);
X		}
X	}
X
X	/* Check if the JDK home directory is actually a directory */
X	result = stat ("%%JAVA_HOME%%", &sb);
X	if (result != 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to stat %%JAVA_HOME%%: ");
X		perror (NULL);
X		exit (ERR_STAT_JAVA_HOME);
X	}
X	if (!S_ISDIR (sb.st_mode)) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java home directory %%JAVA_HOME%% is not a directory.\n");
X		exit (ERR_JAVA_HOME_NOT_DIR);
X	}
X
X	/* Check if the Java command is actually an executable regular file */
X	result = stat ("%%JAVA%%", &sb);
X	if (result != 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to stat %%JAVA%%: ");
X		perror (NULL);
X		exit (ERR_STAT_JAVA_CMD);
X	}
X	if (!S_ISREG (sb.st_mode)) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java command %%JAVA%% is not a regular file.\n");
X		exit (ERR_JAVA_CMD_NOT_FILE);
X	}
X	result = access ("%%JAVA%%", X_OK);
X	if (result != 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java command %%JAVA%% is not executable: ");
X		perror (NULL);
X		exit (ERR_JAVA_CMD_NOT_EXECUTABLE);
X	}
X
X	/* Change directory */
X	result = chdir ("%%APP_HOME%%");
X	if (result < 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to access directory %%APP_HOME%%: ");
X		perror (NULL);
X		exit (ERR_CHDIR_TO_APP_HOME);
X	}
X
X	/* See if the JAR file exists */
X	result = access ("%%APP_HOME%%/%%JAR_FILE%%", R_OK);
X	if (result < 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to access JAR file %%APP_HOME%%/%%JAR_FILE%%: ");
X		perror (NULL);
X		exit (ERR_ACCESS_JAR_FILE);
X	}
X
X	/* Open the stdout log file */
X	stdoutLogFile = open ("%%STDOUT_LOG%%", O_WRONLY);
X	if (stdoutLogFile < 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to open %%STDOUT_LOG%% for writing: ");
X		perror (NULL);
X		exit (ERR_STDOUT_LOGFILE_OPEN);
X	}
X	lseek (stdoutLogFile, (off_t) 0, SEEK_END);
X
X	/* Open the stderr log file */
X	stderrLogFile = open ("%%STDERR_LOG%%", O_WRONLY);
X	if (stderrLogFile < 0) {
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to open %%STDERR_LOG%% for writing: ");
X		perror (NULL);
X		exit (ERR_STDERR_LOGFILE_OPEN);
X	}
X	lseek (stderrLogFile, (off_t) 0, SEEK_END);
X
X	/* Split this process in two */
X	switch (pid = fork ())
X	{
X	case -1:
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to fork: ");
X		perror (NULL);
X		exit (ERR_FORK_FAILED);
X		break;
X
X	case 0:
X		/* Redirect stdout to log file */
X		dup2 (stdoutLogFile, STDOUT_FILENO);
X
X		/* Redirect stderr to log file */
X		dup2 (stderrLogFile, STDERR_FILENO);
X
X		/* TODO: Support redirection of both stdout and stderr to the same
X				 file using pipe (2) */
X
X		/*
X			Build the argument vector, with the java/jboss options if any.
X		 */
X		argv = malloc (sizeof (char *) * (javaOpt + jbossOpt + 5));
X		argc = 0;
X		argv [argc++] = "%%JAVA%%";
X		for (i = 0; i < javaOpt; i++)
X			argv [argc++] = javaArgs [i];
X		argv [argc++] = "-cp";
X		argv [argc++] = "%%JAVA_CP%%";
X		argv [argc++] = "%%JAVA_MAIN%%";
X		for (i = 0; i < jbossOpt; i++)
X			argv [argc++] = jbossArgs [i];
X		argv [argc++] = NULL;
X
X		/* Execute the command */
X		execv (argv [0], argv);
X		perror (NULL);
X		break;
X
X	default:
X		logOutput (" [ DONE ]\n");
X		writePID (pid);
X	}
X}
X
X/**
X * Stops the daemon.
X */
Xstatic void
Xstop (void)
X{
X	int pid;
X
X	pid = readPID ();
X
X	logOutput (">> Checking if %%APP_TITLE%% %%PORTVERSION%% is running...");
X
X	/* If there is a PID, see if the process still exists */
X	if (pid != -1)
X	{
X		int result = kill (pid, 0);
X		if (result != 0 && errno == ESRCH)
X		{
X			clearPID ();
X			pid = -1;
X		}
X	}
X
X	/* If there is no running process, produce an error */
X	if (pid == -1)
X	{
X		logOutput (" [ FAILED ]\n");
X		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: %%APP_TITLE%% %%PORTVERSION%% is currently not running.\n");
X		exit (ERR_NOT_RUNNING);
X	}
X	logOutput (" [ DONE ]\n");
X
X	/* Terminate the process */
X	killProcess (pid);
X	clearPID ();
X}
X
X
X/**
X * Restarts the process. If it not currently running, then it will fail.
X */
Xstatic void
Xrestart (
X int javaOpt,
X char * javaArgs [],
X int jbossOpt,
X char * jbossArgs [])
X{
X	stop ();
X	start (javaOpt, javaArgs, jbossOpt, jbossArgs);
X}
X
X/**
X	Output log to stdout.
X */
Xstatic void
XlogOutput (
X char * string)
X{
X	if (!isQuiet)
X		printf (string);
X}
END-of-/home/liutong/jboss5/files/daemonctl.c
echo x - /home/liutong/jboss5/files/patch-serial-autoinc
sed 's/^X//' >/home/liutong/jboss5/files/patch-serial-autoinc << 'END-of-/home/liutong/jboss5/files/patch-serial-autoinc'
X$FreeBSD$
X
XThis patch allows JBoss to correctly create tables when
Xusing the auto-increment feature with Postgresql.
X
Xdiff -ruN ./server/src/etc/conf/default/standardjbosscmp-jdbc.xml /home/jonc/ports/jboss4/work/jboss-4.0.2-src/server/src/etc/conf/default/standardjbosscmp-jdbc.xml
X--- ./server/src/etc/conf/default/standardjbosscmp-jdbc.xml	Thu Jan 27 07:51:35 2005
X+++ /home/jonc/ports/jboss4/work/jboss-4.0.2-src/server/src/etc/conf/default/standardjbosscmp-jdbc.xml	Tue May 17 16:13:34 2005
X@@ -1293,7 +1293,7 @@
X          <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE</row-locking-template>
X          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
X          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
X-         <auto-increment-template>?1</auto-increment-template>
X+         <auto-increment-template>?1 serial</auto-increment-template>
X          <alias-header-prefix>t</alias-header-prefix>
X          <alias-header-suffix>_</alias-header-suffix>
X          <alias-max-length>32</alias-max-length>
X@@ -1420,7 +1420,7 @@
X          <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE</row-locking-template>
X          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
X          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
X-         <auto-increment-template>?1</auto-increment-template>
X+         <auto-increment-template>?1 serial</auto-increment-template>
X          <alias-header-prefix>t</alias-header-prefix>
X          <alias-header-suffix>_</alias-header-suffix>
X          <alias-max-length>32</alias-max-length>
X@@ -1674,7 +1674,7 @@
X          <row-locking-template/>
X          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
X          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
X-         <auto-increment-template>?1 IDENTITY</auto-increment-template>
X+         <auto-increment-template>?1 ?2 ?3 IDENTITY</auto-increment-template>
X          <add-column-template>ALTER TABLE ?1 ADD COLUMN ?2 ?3</add-column-template>
X          <drop-column-template>ALTER TABLE ?1 DROP COLUMN ?2</drop-column-template>
X          <alias-header-prefix>t</alias-header-prefix>
X@@ -1973,7 +1973,7 @@
X               <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
X          -->
X          <fk-constraint-template>ALTER TABLE ?1 ADD INDEX (?3), ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
X-         <auto-increment-template>?1 auto_increment</auto-increment-template>
X+         <auto-increment-template>?1 ?2 ?3 auto_increment</auto-increment-template>
X          <alter-column-template>ALTER TABLE ?1 MODIFY ?2 ?3</alter-column-template>
X          <alias-header-prefix>t</alias-header-prefix>
X          <alias-header-suffix>_</alias-header-suffix>
X@@ -2113,7 +2113,7 @@
X          <row-locking-template>SELECT ?1 FROM ?2 with (updlock) WHERE ?3 ORDER BY ?4</row-locking-template>
X          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
X          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
X-         <auto-increment-template>?1 IDENTITY</auto-increment-template>
X+         <auto-increment-template>?1 ?2 ?3 IDENTITY</auto-increment-template>
X          <alter-column-template>ALTER TABLE ?1 ALTER COLUMN ?2 ?3</alter-column-template>
X          <alias-header-prefix>t</alias-header-prefix>
X          <alias-header-suffix>_</alias-header-suffix>
X@@ -2245,7 +2245,7 @@
X          <row-locking-template>SELECT ?1 FROM ?2 with (xlock) WHERE ?3 ORDER BY ?4</row-locking-template>
X          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
X          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
X-         <auto-increment-template>?1 IDENTITY</auto-increment-template>
X+         <auto-increment-template>?1 ?2 ?3 IDENTITY</auto-increment-template>
X          <alias-header-prefix>t</alias-header-prefix>
X          <alias-header-suffix>_</alias-header-suffix>
X          <alias-max-length>32</alias-max-length>
Xdiff -ruN ./server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java /home/jonc/ports/jboss4/work/jboss-4.0.2-src/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java
X--- ./server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java	Tue Oct 26 22:28:23 2004
X+++ /home/jonc/ports/jboss4/work/jboss-4.0.2-src/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java	Tue May 17 16:13:34 2005
X@@ -916,14 +916,18 @@
X       // apply auto-increment template
X       if(type.getAutoIncrement()[0])
X       {
X-         String columnClause = SQLUtil.getCreateTableColumnsClause(type);
X          JDBCFunctionMappingMetaData autoIncrement =
X             manager.getMetaData().getTypeMapping().getAutoIncrementTemplate();
X          if(autoIncrement == null)
X          {
X             throw new IllegalStateException("auto-increment template not found");
X          }
X-         String[] args = new String[]{columnClause};
X+         String[] args = new String[]
X+							{
X+								type.getColumnNames () [0],
X+								type.getSQLTypes () [0],
X+								type.getNotNull () [0] ? " not null " : ""
X+							};
X          autoIncrement.getFunctionSql(args, sqlBuffer);
X       }
X       else
END-of-/home/liutong/jboss5/files/patch-serial-autoinc
echo x - /home/liutong/jboss5/files/pkg-message
sed 's/^X//' >/home/liutong/jboss5/files/pkg-message << 'END-of-/home/liutong/jboss5/files/pkg-message'
X%%PKGNAME%% has been installed in %%APP_HOME%%.
X
XIf a user should be able to use %%CONTROL_SCRIPT_NAME%%, put it in the group '%%GROUP%%'.
X
XUse 'man %%CONTROL_SCRIPT_NAME%%' for information about starting and stopping %%APP_TITLE%%.
X
XTo run the %%APP_TITLE%% server from startup, add %%APP_SHORTNAME%%_enable="YES" in your /etc/rc.conf. Extra options can be found in the startup script.
END-of-/home/liutong/jboss5/files/pkg-message
echo x - /home/liutong/jboss5/files/startup.sh.in
sed 's/^X//' >/home/liutong/jboss5/files/startup.sh.in << 'END-of-/home/liutong/jboss5/files/startup.sh.in'
X#!/bin/sh
X#
X# %%APP_TITLE%% startup script.
X#
X# $FreeBSD$
X#
X
X# PROVIDE: %%APP_SHORTNAME%%
X# REQUIRE: NETWORKING SERVERS
X
X# Add the following lines to /etc/rc.conf to enable %%APP_SHORTNAME%%:
X# %%APP_SHORTNAME%%_enable (bool):		Set to "NO" by default.
X#				Set it to "YES" to enable %%APP_SHORTNAME%%
X# %%APP_SHORTNAME%%_flags (str):		Set to "-server" by default.
X#				Extra JVM flags.
X# %%APP_SHORTNAME%%_config (str):		Set to "" by default
X#				JBoss server config, eg {all|default|minimal|standard}
X#
X. %%RC_SUBR%%
X
Xname="%%APP_SHORTNAME%%"
Xrcvar=`set_rcvar`
X
Xstart_cmd="%%APP_SHORTNAME%%_start"
Xrestart_cmd="%%APP_SHORTNAME%%_restart"
Xpidfile="%%PID_FILE%%"
Xprocname="%%JAVA%%"
X
X[ -z "$%%APP_SHORTNAME%%_enable" ]	&& %%APP_SHORTNAME%%_enable="NO"
X[ -z "$%%APP_SHORTNAME%%_flags" ]	&& %%APP_SHORTNAME%%_flags="-server"
X[ -z "$%%APP_SHORTNAME%%_config" ]	&& %%APP_SHORTNAME%%_config=""
X
X%%APP_SHORTNAME%%_start ()
X{
X	checkyesno %%APP_SHORTNAME%%_enable &&
X	{
X		if [ ! -f ${pidfile} ]
X		then
X			touch ${pidfile}
X			chown %%USER%%:%%GROUP%% ${pidfile}
X		fi
X
X		echo "Starting %%APP_SHORTNAME%%."
X		%%CONTROL_SCRIPT%% -q ${%%APP_SHORTNAME%%_flags} ${%%APP_SHORTNAME%%_configflag} ${%%APP_SHORTNAME%%_config} start
X	}
X}
X
X%%APP_SHORTNAME%%_restart ()
X{
X	checkyesno %%APP_SHORTNAME%%_enable &&
X	{
X		echo "Restarting %%APP_SHORTNAME%%."
X		%%CONTROL_SCRIPT%% -q ${%%APP_SHORTNAME%%_flags} ${%%APP_SHORTNAME%%_configflag} ${%%APP_SHORTNAME%%_config} restart
X	}
X}
X
Xload_rc_config $name
X
X[ -n "${%%APP_SHORTNAME%%_config}" ] && %%APP_SHORTNAME%%_configflag="-config"
X
Xrun_rc_command "$1"
END-of-/home/liutong/jboss5/files/startup.sh.in
echo x - /home/liutong/jboss5/Makefile
sed 's/^X//' >/home/liutong/jboss5/Makefile << 'END-of-/home/liutong/jboss5/Makefile'
X# ports collection makefile for: jboss5
X# Date created:                  7 May 2007
X# Whom:                          nemoliu@gmail.com <nemoliu@gmail.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	${APP_TITLE:L}
XPORTVERSION=	5.0.0.b1
XPORTEPOCH=	1
XCATEGORIES=	java devel
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	${PORTNAME}
XDISTNAME=	${PORTNAME}-${PORTVERSION:R}.Beta1-src
X
XMAINTAINER=	nemoliu@gmail.com
XCOMMENT=	Open-source J2EE application server (5.x family)
X
XBUILD_DEPENDS=	ant:${PORTSDIR}/devel/apache-ant
X
XLATEST_LINK=	jboss5
XUSE_JAVA=	yes
XJAVA_VERSION=	1.5+
X
XUSE_RC_SUBR=	startup.sh
X
X.if !defined(NOPORTDOCS)
XPORTDOCS=	*
X.endif
X
XAPP_HOME?=	${PREFIX}/${APP_SHORTNAME}
XDOCSDIR=	${PREFIX}/share/doc/${PKGBASE}${PORTVERSION:R}
XLOG_DIR=	${APP_HOME}/log
XAPP_TITLE=	JBoss
XAPP_SHORTNAME=	${UNIQUENAME}
XCONTROL_SCRIPT_NAME=	${APP_SHORTNAME}ctl
XCONTROL_SCRIPT=	${PREFIX}/bin/${CONTROL_SCRIPT_NAME}
XCONTROL_SCRIPT_MANPAGE_TITLE=	${CONTROL_SCRIPT_NAME:U}
XSTARTUP_SCRIPT_NAME=	${APP_SHORTNAME}.sh
XSTARTUP_SCRIPT=	${PREFIX}/etc/rc.d/${STARTUP_SCRIPT_NAME}
XUSER=		www
XGROUP=		www
XSTDOUT_LOG=	${LOG_DIR}/stdout.log
XSTDERR_LOG=	${LOG_DIR}/stderr.log
XAUTO_START?=	NO
XSTOP_TIMEOUT?=	5
XPID_FILE=	/var/run/${APP_SHORTNAME}.pid
XJAVA_OPTS=
XJAVA_CP=	bin/run.jar:${JAVA_HOME}/lib/tools.jar
XJAVA_MAIN=	org.jboss.Main
XDAEMONCTL_DIR=	${FILESDIR}
XDAEMONCTL_FILES=daemonctl.c daemonctl.1 startup.sh.in pkg-message
XMAN1=		${CONTROL_SCRIPT_NAME}.1
X
XJBOSSOUTPUT=	${WRKSRC}/build/output/${PORTNAME}-${PORTVERSION:R}.Beta1
XAPP_HOME_FILES=	bin client lib server
X
XPLIST_FILES=	${CONTROL_SCRIPT:S,^${PREFIX}/,,} \
X		${STARTUP_SCRIPT:S,^${PREFIX}/,,} \
X		${STDOUT_LOG:S,^${PREFIX}/,,} \
X		${STDERR_LOG:S,^${PREFIX}/,,}
X
XPKGMESSAGE=	${WRKDIR}/pkg-message.fmt
X
X.include <bsd.port.pre.mk>
X
Xdo-configure:
X	@(cd ${DAEMONCTL_DIR} && ${CP} ${DAEMONCTL_FILES} ${WRKDIR})
X	@(cd ${WRKDIR} && ${REINPLACE_CMD} \
X		-e "s|%%RC_SUBR%%|${RC_SUBR}|g;" \
X		-e "s|%%APP_HOME%%|${APP_HOME}|g;" \
X		-e "s|%%APP_SHORTNAME%%|${APP_SHORTNAME}|g;" \
X		-e "s|%%APP_TITLE%%|${APP_TITLE}|g;" \
X		-e "s|%%CONTROL_SCRIPT%%|${CONTROL_SCRIPT}|g;" \
X		-e "s|%%CONTROL_SCRIPT_MANPAGE_TITLE%%|${CONTROL_SCRIPT_MANPAGE_TITLE}|g;" \
X		-e "s|%%CONTROL_SCRIPT_NAME%%|${CONTROL_SCRIPT_NAME}|g;" \
X		-e "s|%%GROUP%%|${GROUP}|g;" \
X		-e "s|%%JAVA%%|${JAVA}|g;" \
X		-e "s|%%JAVA_CP%%|${JAVA_CP}|g;" \
X		-e "s|%%JAVA_HOME%%|${JAVA_HOME}|g;" \
X		-e "s|%%JAVA_MAIN%%|${JAVA_MAIN}|g;" \
X		-e "s|%%JAVA_OPTS%%|${JAVA_OPTS}|g;" \
X		-e "s|%%JAVA_PORT_VERSION%%|${JAVA_PORT_VERSION}|g;" \
X		-e "s|%%JAVA_PORT_OS_DESCRIPTION%%|${JAVA_PORT_OS_DESCRIPTION}|g;" \
X		-e "s|%%JAR_FILE%%|${JAR_FILE}|g;" \
X		-e "s|%%LOG_DIR%%|${LOG_DIR}|g;" \
X		-e "s|%%PID_FILE%%|${PID_FILE}|g;" \
X		-e "s|%%PKGNAME%%|${PKGNAME}|g;" \
X		-e "s|%%PORTNAME%%|${PORTNAME}|g;" \
X		-e "s|%%PORTVERSION%%|${PORTVERSION}|g;" \
X		-e "s|%%PREFIX%%|${PREFIX}|g;" \
X		-e "s|%%STARTUP_SCRIPT%%|${STARTUP_SCRIPT}|g;" \
X		-e "s|%%STDERR_LOG%%|${STDERR_LOG}|g;" \
X		-e "s|%%STDOUT_LOG%%|${STDOUT_LOG}|g;" \
X		-e "s|%%STOP_TIMEOUT%%|${STOP_TIMEOUT}|g;" \
X		-e "s|%%USER%%|${USER}|g;" ${DAEMONCTL_FILES})
X	@${FMT} -s 80 ${WRKDIR}/pkg-message >${PKGMESSAGE}
X
Xpost-configure:
X	@${ECHO_MSG} "Installation settings:"
X	@${ECHO_MSG} "   Destination directory:    ${APP_HOME}"
X	@${ECHO_MSG} "   Control program location: ${CONTROL_SCRIPT}"
X	@${ECHO_MSG} "   Startup script location:  ${STARTUP_SCRIPT}"
X	@${ECHO_MSG} "   Location of JDK:          ${JAVA_HOME}"
X	@${ECHO_MSG} "   Location of Java port:    ${JAVA_PORT}"
X	@${ECHO_MSG} "   Startup Java Options:     ${JAVA_OPTS}"
X	@${ECHO_MSG} "   Running as (user/group):  ${USER}/${GROUP}"
X	@${ECHO_MSG} "   Logfile stdout:           ${STDOUT_LOG}"
X	@${ECHO_MSG} "   Logfile stderr:           ${STDERR_LOG}"
X	@${ECHO_MSG} "   Starting after install:   ${AUTO_START}"
X	@${ECHO_MSG} "   Stop time-out:            ${STOP_TIMEOUT} sec."
X
Xdo-build:
X	(cd ${WRKDIR} && ${CC} ${CFLAGS} -o ${CONTROL_SCRIPT_NAME} daemonctl.c)
X	(cd ${WRKSRC}/build && ${SETENV} JAVA_HOME="${JAVA_HOME}" PATH="${JAVA_HOME}/bin:${PATH}" ${SH} build.sh)
X
Xpre-install:
X	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
X
Xdo-install:
X	${MKDIR} ${APP_HOME} && ${CHOWN} ${USER}:${GROUP} ${APP_HOME}
X	${MKDIR} ${LOG_DIR} && ${CHOWN} ${USER}:${GROUP} ${LOG_DIR}
X	(cd ${JBOSSOUTPUT} && ${FIND} ${APP_HOME_FILES} |\
X		${CPIO} -pdmu -R ${USER}:${GROUP} ${APP_HOME})
X	${INSTALL} -o ${USER} -g ${GROUP} -m 06754\
X		${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT}
X	${INSTALL_SCRIPT} ${WRKDIR}/startup.sh ${STARTUP_SCRIPT}
X	${INSTALL} -o ${USER} -g ${GROUP} -m 0640 /dev/null ${STDOUT_LOG}
X	${INSTALL} -o ${USER} -g ${GROUP} -m 0640 /dev/null ${STDERR_LOG}
X	${INSTALL} -o ${USER} -g ${GROUP} -m 0640 /dev/null ${PID_FILE}
X	${INSTALL_MAN} ${WRKDIR}/daemonctl.1 ${MANPREFIX}/man/man1/${CONTROL_SCRIPT_NAME}.1
X.if !defined(NOPORTDOCS)
X	cd ${JBOSSOUTPUT}/docs \
X		&& ${FIND} . -type d -exec ${MKDIR} ${DOCSDIR}/{} \; \
X		&& ${FIND} . -type f -exec ${INSTALL_DATA} {} ${DOCSDIR}/{} \;
X.endif
X
Xpost-install:
X	@${FIND} -s ${APP_HOME_FILES:S,^,${JBOSSOUTPUT}/,} -not -type d | \
X		${SED} -ne 's,^${JBOSSOUTPUT},${APP_HOME:S,${PREFIX}/,,},p' >> ${TMPPLIST}
X	@${FIND} -s -d ${APP_HOME_FILES:S,^,${JBOSSOUTPUT}/,} -type d | \
X		${SED} -ne 's,^${JBOSSOUTPUT},@dirrm ${APP_HOME:S,${PREFIX}/,,},p' >> ${TMPPLIST}
X	@${ECHO_CMD} "@dirrm ${APP_HOME:S,^${PREFIX}/,,}/log" >> ${TMPPLIST}
X	@${ECHO_CMD} "@dirrm ${APP_HOME:S,^${PREFIX}/,,}" >> ${TMPPLIST}
X.if ${AUTO_START} == "YES"
X	@${CONTROL_SCRIPT} start || true
X.endif
X.if !defined(BATCH)
X	@${CAT} ${PKGMESSAGE}
X.endif
X
X.include <bsd.port.post.mk>
END-of-/home/liutong/jboss5/Makefile
echo x - /home/liutong/jboss5/distinfo
sed 's/^X//' >/home/liutong/jboss5/distinfo << 'END-of-/home/liutong/jboss5/distinfo'
XMD5 (jboss-5.0.0.Beta1-src.tar.gz) = 92365ed9bafae925c071e23e723216be
XSHA256 (jboss-5.0.0.Beta1-src.tar.gz) = f0916edce3053a3cc5e689559822b559e0d4b08582eeb606f0208ca7634ef1e5
XSIZE (jboss-5.0.0.Beta1-src.tar.gz) = 114347235
END-of-/home/liutong/jboss5/distinfo
echo x - /home/liutong/jboss5/pkg-deinstall
sed 's/^X//' >/home/liutong/jboss5/pkg-deinstall << 'END-of-/home/liutong/jboss5/pkg-deinstall'
X#!/bin/sh
X#
X# This script does the following.
X#
X# * Checks if the JBoss PID file exists. If it does, it kills the
X#   JBoss process and removes the PID file.
X#
X# $FreeBSD$
X#
X
X# Make sure we're in the right stage of the process
Xif [ "$2" = "DEINSTALL" ]; then
X
X	# Kill JBoss if it is still running
X	PID_FILE=/var/run/jboss.pid
X	if [ -s ${PID_FILE} ]; then
X		PID=`cat ${PID_FILE}`
X		echo -n ">> Killing JBoss Server process (${PID})..."
X		/bin/kill ${PID} > /dev/null 2> /dev/null
X		if [ $? -eq 0 ]; then
X			echo " [ DONE ]"
X		else
X			echo " [ FAILED ]"
X		fi
X		echo -n ">> Removing PID file (${PID_FILE})..."
X		rm ${PID_FILE} > /dev/null 2> /dev/null
X		if [ $? -eq 0 ]; then
X			echo " [ DONE ]"
X		else
X			echo " [ FAILED ]"
X		fi
X	fi
Xfi
X
Xexit 0
END-of-/home/liutong/jboss5/pkg-deinstall
echo x - /home/liutong/jboss5/pkg-descr
sed 's/^X//' >/home/liutong/jboss5/pkg-descr << 'END-of-/home/liutong/jboss5/pkg-descr'
XJBoss AS 5 GA will be Java EE 5 certified and will include the following core
Xtechnologies.
X
X    * JBoss Microcontainer - POJO based microcontainer removing the dependency
X      on JMX
X    * EJB 3.0 - Fully certified as part of the Java EE 5 compliant JBoss AS 5
X    * Hibernate 3.2 - JPA certified
X    * JBoss Messaging 1.2 - the next generation messaging platform from JBoss
X      with HA features.
X    * JBoss WebServices 2.0 - new custom built JAX-WS compliant WebServices
X      stack.
X    * JBoss Seam 1.1 - a powerful new application framework to build next
X      generation Web 2.0 applications by unifying and integrating popular
X      service oriented architecture (SOA) technologies
X
XWWW: http://www.jboss.org/
END-of-/home/liutong/jboss5/pkg-descr
echo x - /home/liutong/jboss5/pkg-install
sed 's/^X//' >/home/liutong/jboss5/pkg-install << 'END-of-/home/liutong/jboss5/pkg-install'
X#!/bin/sh
X#
X# Checks if the 'www' user and group exist. If they don't, then
X# an attempt is made to create both.
X#
X# $FreeBSD$
X#
X
X# Make sure we're called during the 'make install' process
Xif [ "$2" != "PRE-INSTALL" ]; then
X    exit 0
Xfi
X
X# Set some constants
XUSER=www
XGROUP=${USER}
XUID=80
XGID=${UID}
X
X# See if the group already exists
Xif ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
X
X	# If not, try to create it
X	if pw groupadd ${GROUP} -g ${GID}; then
X		echo "Added group \"${GROUP}\"."
X	else
X		echo "Adding group \"${GROUP}\" failed..."
X		exit 1
X	fi
Xfi
X
X# See if the user already exists
Xif ! pw usershow "${USER}" 2>/dev/null 1>&2; then
X
X	# If not, try to create it
X	if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
X		-s "/sbin/nologin" -d "/nonexistent" \
X		-c "World Wide Web Owner"; \
X	then
X		echo "Added user \"${USER}\"."
X	else
X		echo "Adding user \"${USER}\" failed..."
X		exit 1
X	fi
Xfi
Xexit 0
END-of-/home/liutong/jboss5/pkg-install
exit


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703101729.l2AHT2g8043022>