-
Notifications
You must be signed in to change notification settings - Fork 3
/
daemontools_start
executable file
·45 lines (35 loc) · 1.04 KB
/
daemontools_start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
if [ $UID -ne 0 ]; then
echo "You must be root to run this!"
exit
fi
### Warning!!! Don't use leading spaces rather than leading tabs in "Here Documents" ###
# Find out where files are located
source config
echo "`basename $0` links GemStone/S templates for daemontools in $TEMPLATE_DIR to"
echo "the appropriate locations in $SERVICE_DIR. if daemontools is running"
echo "those services will start immediately."
echo "Shall I continue? (Y/N)"
read cont
case "$cont" in
y|Y|yes)
;;
*)
echo "Not continuing"
exit
;;
esac
# Create directories expected by daemontools (http://cr.yp.to/daemontools.html)
mkdir -p $SERVICE_DIR
# Link templates into service directory
# Convention: the underscore is important!
# Only services starting with "gs_" are linked
# Services starting with "gs" but no underscore are not
for i in `ls -d $TEMPLATE_DIR/gs_*` ; do
# echo "Creating service for $i"
ln -s $i $SERVICE_DIR/
done
echo "Currently registered daemontools services:"
update-service --list
# Success
exit 0