I tried to search the forum for this issue but it seems there is no talink about it.
I have a glassfish server currently runing as a regular user, I am ussing chkconfig and glassfis is working just file.
I have reused my file for smartfox as well, this way:
Code: Select all
#! /bin/sh
# chkconfig: 2345 99 01
# description: Smartfox Server
SF_USER=givi
GF_HOME=/opt/servers/SFS2X/SFS2X
ASADMIN=$SF_HOME/sfs2x-service
SU="su --login $SF_USER --command "
case "$1" in
status)
$SU "$ASADMIN status"
;;
start)
echo "starting ..."
$SU "$ASADMIN start "
;;
stop)
$SU "$ASADMIN stop"
;;
restart)
$SU "$ASADMIN restart"
;;
\*)
echo "usage: $0 (start|stop|restart|status)"
esac
'
all works fine but when I check ps aux it still says that smartfox is running as root, so it must be something inside sfs2x-service that changes back to root?
is there a way to get smartfox running under non root user, this is kind of a security issue for us.
I had a type in SU command .
it works like a charm now