3
# Copyright 2008-2015 Canonical
5
# This program is free software: you can redistribute it and/or modify
6
# it under the terms of the GNU Affero General Public License as
7
# published by the Free Software Foundation, either version 3 of the
8
# License, or (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU Affero General Public License for more details.
15
# You should have received a copy of the GNU Affero General Public License
16
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
# For further info, check http://launchpad.net/filesync-server
20
# Argument = -d data_seg_size, -m max_memory_size, -v virtual_memory, -n open_files
26
usage: $0 [options] <command>
28
This script will change the ulimit and execute the given command.
46
while getopts “hd:m:v:n:” OPTION
54
DATA_SEG_SIZE="-d $OPTARG"
57
MAX_MEM_SIZE="-m $OPTARG"
60
VIRT_MEM_SIZE="-v $OPTARG"
68
shift "$((OPTIND-1))" # shift all the already parsed args
78
ulimit $OPEN_FD $VIRT_MEM_SIZE $MAX_MEM_SIZE $DATA_SEG_SIZE;