summaryrefslogtreecommitdiff
path: root/network/lizardfs/rc.lizardfs.new
blob: fa5b338c78f21af3a54ac23dafdd9058dffe399b (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh

# Init script file for LizardFS (or MooseFS) system.
# Written for Slackware Linux by Marcin Szychowski <szycha@gmail.com>
# This script starts enabled LizardFS services.
#
# LizardFS is a distributed, self-healing, self-replicating filesystem,
# available under GNU GPLv3 License for any FUSE-capable operating system.
# 
# Typical LizardFS installation consists of one master server, one or
# more meta-loggers and any number of chunk servers (the more the better).
# lizardfs Slackware Package contains software to run any of them.
#
# Although it is possible to run entire LizardFS system within one host
# you should not mix their roles across machines in a production
# environment.  Especially you should not run anything along with master
# server process on the same machine.
# For more details refer to lizardfs(7) manual page or LizardFS website
# http://lizardfs.org/
#
# Enable this script to start/stop/restart all enabled services in a convenient
# way rather than run services directly.  For your convenience,
# rc.lizardfs-chunkserver is enabled (executable) by default, since
# chunkservers are dominant group in average LizardFS installation.

services="master cgiserv metalogger chunkserver"

function everyone() {
  action="$1"

  if [ "$action" = "stop" ]; then
    local services="$(echo $services|tr ' ' "\n"|tac)"
  fi

  for svc in $services; do
    if [ -x /etc/rc.d/rc.lizardfs-$svc ]; then
      /etc/rc.d/rc.lizardfs-$svc $action
    fi
  done
}


case "$1" in
  'start')
    everyone start
    ;;
  'stop')
    everyone stop
    ;;
  'restart')
    everyone stop
    everyone start
    ;;
  'condrestart')
    everyone condrestart
    ;;
  'status')
    everyone status
    ;;
  'setup')
    /var/log/setup/setup.lizardfs-services
    ;;
  *)
    echo "Usage: $0 {setup|start|stop|restart|reload|condrestart|status}"
    ;;
esac