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
a3544dd8
Commit
a3544dd8
authored
9 years ago
by
sveseli
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
32d42a05
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
etc/init.d/dm-fs-service
+0
-139
0 additions, 139 deletions
etc/init.d/dm-fs-service
with
0 additions
and
139 deletions
etc/init.d/dm-fs-service
deleted
100755 → 0
+
0
−
139
View file @
32d42a05
#!/bin/sh
#
# dm-fs-service
#
# Starts the DM FileSystem Service
#
# chkconfig: 345 98 98
# description: controls DM FileSystem Service
### BEGIN INIT INFO
# Provides: dm-fs-service
# Required-Start: $local_fs dm-postgresql
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: controls DM FileSystem Service
### END INIT INFO
# Source function library.
.
/etc/rc.d/init.d/functions
# For SELinux we need to use 'runuser' not 'su'
SU
=
su
if
[
-x
/sbin/runuser
]
;
then
SU
=
runuser
fi
# Check if we are root before running command
runCommand
()
{
_cmd
=
"
$@
"
echo
"COMMAND:
$_cmd
"
if
[
`
id
-u
`
=
0
]
;
then
$SU
-l
$DM_USER
-c
"_
$cmd
"
else
eval
"
$_cmd
"
fi
}
# Set defaults for configuration variables
if
[
-z
$DM_ROOT_DIR
]
;
then
myDir
=
`
dirname
$0
`
currentDir
=
`
pwd
`
&&
cd
$myDir
/../..
export
DM_ROOT_DIR
=
`
pwd
`
cd
$currentDir
fi
DM_SETUP_FILE
=
$DM_ROOT_DIR
/setup.sh
if
[
!
-f
$DM_SETUP_FILE
]
;
then
echo
"Setup file
$DM_SETUP_FILE
does not exist."
exit
2
fi
.
$DM_SETUP_FILE
>
/dev/null
mkdir
-p
${
DM_ROOT_DIR
}
/var/run
mkdir
-p
${
DM_ROOT_DIR
}
/var/log
#DM_USER=dm
DM_USER
=
`
whoami
`
DM_PORT
=
22236
# 222-DM
DM_HOST
=
0.0.0.0
DAEMON_CMD
=
${
DM_ROOT_DIR
}
/lib/python/dm/fs_service/service/fsService.py
DAEMON_NAME
=
"DmFsService"
PIDFILE
=
${
DM_ROOT_DIR
}
/var/run/dm_fs_service.pid
DAEMON_ARGS
=
"-d -p
$PIDFILE
--port
$DM_PORT
--host
$DM_HOST
--n-server-threads 12"
export
DM_LOG_CONFIG_FILE
=
${
DM_ROOT_DIR
}
/etc/dm.fsService.log.conf
# Determine SSL flags:
# DM_SERVICE_PROTOCOL=https
# DM_SERVICE_SSL_CERT_FILE=<cert path>
# DM_SERVICE_SSL_KEY_FILE=<key path>
# DM_SSL_CA_CERT_FILE=<ca cert path> (enables checking client certificates)
if
[
"
$DM_SERVICE_PROTOCOL
"
=
"https"
]
;
then
if
[
-z
"
$DM_SERVICE_SSL_CERT_FILE
"
]
;
then
echo
"Cannot start service using SSL: DM_SERVICE_SSL_CERT_FILE is not defined."
&&
exit
2
fi
if
[
-z
"
$DM_SERVICE_SSL_KEY_FILE
"
]
;
then
echo
"Cannot start service using SSL: DM_SERVICE_SSL_KEY_FILE is not defined."
&&
exit
2
fi
DAEMON_ARGS
=
"
$DAEMON_ARGS
-c
$DM_SERVICE_SSL_CERT_FILE
-k
$DM_SERVICE_SSL_KEY_FILE
"
# Client certificate will be checked if DM_SSL_CA_CERT_FILE is provided.
if
[
!
-z
"
$DM_SSL_CA_CERT_FILE
"
]
;
then
DAEMON_ARGS
=
"
$DAEMON_ARGS
-C
$DM_SSL_CA_CERT_FILE
"
fi
fi
RETVAL
=
0
start
()
{
# Check if service is already running
status
-p
$PIDFILE
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
-n
$"Starting
$DAEMON_NAME
daemon: "
runCommand
${
DAEMON_CMD
}
${
DAEMON_ARGS
}
RETVAL
=
$?
[
$RETVAL
-eq
0
]
&&
success
$"
$DAEMON_NAME
startup"
||
failure
$"
$DAEMON_NAME
startup"
echo
fi
return
$RETVAL
}
stop
()
{
status
-p
$PIDFILE
>
/dev/null 2>&1
if
[
$?
-eq
0
]
;
then
echo
-n
$"Stopping
$DAEMON_NAME
daemon: "
PID
=
`
cat
$PIDFILE
`
kill
$PID
RETVAL
=
$?
[
$RETVAL
-eq
0
]
&&
rm
-f
$PIDFILE
&&
success
$"
$DAEMON_NAME
shutdown"
||
failure
$"
$DAEMON_NAME
shutdown"
echo
fi
return
$RETVAL
}
restart
()
{
stop
start
}
case
"
$1
"
in
start
)
start
;;
stop
)
stop
;;
restart
)
restart
;;
status
)
status
-p
$PIDFILE
"
$DAEMON_NAME
"
RETVAL
=
$?
;;
*
)
echo
$"Usage:
$0
{start|stop|status|restart}"
RETVAL
=
2
esac
exit
$RETVAL
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