-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpm java_server archetype - systemV init scripts #149
Comments
I started with this, but got stuck. This is my #!/bin/sh
#
# mukis-test <mukis-test>
#
# chkconfig: - 20 80
# description: Mukis Test Daemon
#
### BEGIN INIT INFO
# Provides: mukis-test
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mukis Test Daemon
# Description: Mukis Test Daemon Long
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
prog="mukis-test"
config="/vagrant/mukis-test.conf"
PIDFILE=/var/run/mukis-test.pid
if [ -z "$DAEMON_USER" ]; then
#DAEMON_USER=${{daemon_user}}
DAEMON_USER=vagrant
fi
# smb could define some additional options in $RUN_OPTS
#RUN_CMD="${{chdir}}/bin/${{app_name}}"
RUN_CMD="/vagrant/mukis-test.sh"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
# if not running, start it up here, usually something like "daemon $exec"
daemon --user $DAEMON_USER --pidfile $PIDFILE $RUN_CMD
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
# stop it here, often "killproc $prog"
# TODO this is SO BRUTAL!
killproc -p $PIDFILE #$RUN_CMD
retval=$?
echo "Returning $retval"
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $? 95% are copied from the Fedora template. The script which should get started looks like this: #!/bin/bash
touch /tmp/mukis-test
ping localhost >> /tmp/mukis-test & System is CentOS 6.5 Problems
|
@jsuereth - when might we be able to get rpm packaging for server supported? I'd really love to have this so we dont have to use debian. Thanks for the awesome work, cheers |
Hi @timperrett |
I just found out that CentOS 6 uses Upstart |
Really? Damn. That would be convenient for this issue right!! |
Upstart might not be around for much longer as Debian are going to SystemD and Ubuntu will be following suite. Most RPM distro's have already gone SystemD for there latest versions @muuki88 I now have time to put towards this issue |
Yeah, I read about SystemD. This will be the next major version :D |
SystemD? Man. What am I going to do with all my ubuntu services now? |
At first glance the config files look rather similiar. So for a first draft it shouldn't be toooooo hard :P |
Oh cool, good stuff guys! Is there a snapshot or milestone build with this? I can give it a whirl :-) |
Currently no snapshot or milestone (we should think about a snapshot @jsuereth , @aparkinson ?) git clone [email protected]:sbt/sbt-native-packager.git
cd sbt-native-packager
sbt
set scalaVersion in Global := "2.10.3"
set sbtVersion in Global := "0.13.1"
publish-local Then copy the |
Hi, I would also be very interested to give it a try. By the way, really great work guys regarding the native-packager. |
We'll plan to ship a release candidate very soon (hopefully the next days). So hang tight :) #191 |
0.7.0-RC1 is out! |
The autostart feature is currently only tested on debian systems. Systems using rpm (fedora, centOS, RHEL) are not included yet.
Some links found on the research for this ticket
The text was updated successfully, but these errors were encountered: