Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dm-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hammonds
dm-docs
Commits
4ae54c35
Commit
4ae54c35
authored
10 years ago
by
sveseli
Browse files
Options
Downloads
Patches
Plain Diff
glassfish control script
parent
2bf4ea61
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
etc/init.d/dm-glassfish
+103
-0
103 additions, 0 deletions
etc/init.d/dm-glassfish
with
103 additions
and
0 deletions
etc/init.d/dm-glassfish
0 → 100755
+
103
−
0
View file @
4ae54c35
#! /bin/sh
### BEGIN INIT INFO
# Provides: glassfish
# Required-Start: $remote_fs $network $syslog
# Required-Stop: $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts GlassFish
# Description: Starts GlassFish application server
### END INIT INFO
# Source function library.
.
/etc/rc.d/init.d/functions
# Source networking configuration.
.
/etc/sysconfig/network
# Set root to default if needed.
MY_DIR
=
`
dirname
$0
`
&&
cd
$MY_DIR
&&
MY_DIR
=
`
pwd
`
if
[
-z
"
${
DM_ROOT_DIR
}
"
]
;
then
DM_ROOT_DIR
=
$MY_DIR
/../..
fi
# Source environment file.
DM_USER
=
`
id
-nu
`
DM_HOST
=
`
hostname
-s
`
DM_ENV_FILE
=
${
DM_ROOT_DIR
}
/setup.sh
if
[
!
-f
${
DM_ENV_FILE
}
]
;
then
echo
"Environment file
${
DM_ENV_FILE
}
does not exist."
exit
2
fi
.
${
DM_ENV_FILE
}
>
/dev/null
export
AS_JAVA
=
$DM_SUPPORT_DIR
/java/
$DM_HOST_ARCH
DM_GLASSFISH_DIR
=
$DM_SUPPORT_DIR
/glassfish/
$DM_HOST_ARCH
DERBY_DIR
=
$DM_SUPPORT_DIR
/glassfish/
$DM_HOST_ARCH
/javadb/bin
DM_DAEMON_NAME
=
glassfish
DM_DAEMON_CONTROL_CMD
=
$DM_GLASSFISH_DIR
/bin/asadmin
DM_DAEMON_START_ARGS
=
"start-domain domain1"
DM_DAEMON_STOP_ARGS
=
"stop-domain domain1"
DM_DAEMON_STATUS_CMDS
=
"uptime list-domains list-applications list-jdbc-resources"
start
()
{
echo
-n
$"Starting
${
DM_DAEMON_NAME
}
: "
# Check if we're a privileged user
if
[
`
id
-u
`
=
0
-a
${
DM_USER
}
!=
"root"
]
;
then
su
-m
-c
"
${
DM_DAEMON_CONTROL_CMD
}
${
DM_DAEMON_START_ARGS
}
"
${
DM_USER
}
else
${
DM_DAEMON_CONTROL_CMD
}
${
DM_DAEMON_START_ARGS
}
fi
RETVAL
=
$?
[
$RETVAL
-eq
0
]
&&
success
$"
${
DM_DAEMON_NAME
}
startup"
||
failure
$"
${
DM_DAEMON_NAME
}
startup"
echo
}
stop
()
{
echo
-n
$"Stopping
${
DM_DAEMON_NAME
}
: "
# Check if we're a privileged user
if
[
`
id
-u
`
=
0
-a
${
DM_USER
}
!=
"root"
]
;
then
su
-m
-c
"
${
DM_DAEMON_CONTROL_CMD
}
${
DM_DAEMON_STOP_ARGS
}
"
${
DM_USER
}
else
${
DM_DAEMON_CONTROL_CMD
}
${
DM_DAEMON_STOP_ARGS
}
fi
RETVAL
=
$?
[
$RETVAL
-eq
0
]
&&
success
$"
${
DM_DAEMON_NAME
}
shutdown"
||
failure
$"
${
DM_DAEMON_NAME
}
shutdown"
echo
}
status
()
{
# Check if we're a privileged user
if
[
`
id
-u
`
=
0
-a
${
DM_USER
}
!=
"root"
]
;
then
for
cmd
in
${
DM_DAEMON_STATUS_CMDS
}
;
do
su
-m
-c
"
${
DM_DAEMON_CONTROL_CMD
}
${
cmd
}
"
${
DM_USER
}
done
else
for
cmd
in
${
DM_DAEMON_STATUS_CMDS
}
;
do
${
DM_DAEMON_CONTROL_CMD
}
${
cmd
}
done
fi
}
case
"
$1
"
in
start
)
start
;;
stop
)
stop
;;
restart
)
stop
start
;;
status
)
status
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment