init
This commit is contained in:
5
wcmtools/mogilefs/api/perl/MANIFEST
Executable file
5
wcmtools/mogilefs/api/perl/MANIFEST
Executable file
@@ -0,0 +1,5 @@
|
||||
Makefile.PL
|
||||
MANIFEST
|
||||
MogileFS.pm
|
||||
META.yml Module meta-data (added by MakeMaker)
|
||||
t/00use.t
|
||||
14
wcmtools/mogilefs/api/perl/MANIFEST.SKIP
Executable file
14
wcmtools/mogilefs/api/perl/MANIFEST.SKIP
Executable file
@@ -0,0 +1,14 @@
|
||||
^#
|
||||
\bCVS\b
|
||||
^MANIFEST\.
|
||||
^Makefile$
|
||||
~$
|
||||
\.html$
|
||||
\.old$
|
||||
^blib/
|
||||
_blib$
|
||||
^MakeMaker-\d
|
||||
^\.exists
|
||||
\bdebian\b
|
||||
\btest\b
|
||||
|
||||
13
wcmtools/mogilefs/api/perl/META.yml
Executable file
13
wcmtools/mogilefs/api/perl/META.yml
Executable file
@@ -0,0 +1,13 @@
|
||||
# http://module-build.sourceforge.net/META-spec.html
|
||||
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
|
||||
name: MogileFS
|
||||
version: 1.00
|
||||
version_from:
|
||||
installdirs: site
|
||||
requires:
|
||||
fields: 0
|
||||
IO::WrapTie: 2.102
|
||||
LWP::Simple: 0
|
||||
|
||||
distribution_type: module
|
||||
generated_by: ExtUtils::MakeMaker version 6.17
|
||||
34
wcmtools/mogilefs/api/perl/Makefile.PL
Executable file
34
wcmtools/mogilefs/api/perl/Makefile.PL
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Perl Makefile for Danga-Socket
|
||||
# $Id: Makefile.PL,v 1.2 2005/02/01 01:15:26 bradfitz Exp $
|
||||
#
|
||||
# Invoke with 'perl Makefile.PL'
|
||||
#
|
||||
# See ExtUtils::MakeMaker (3) for more information on how to influence
|
||||
# the contents of the Makefile that is written
|
||||
#
|
||||
|
||||
use ExtUtils::MakeMaker;
|
||||
|
||||
WriteMakefile(
|
||||
NAME => 'MogileFS',
|
||||
VERSION => '1.00',
|
||||
AUTHOR => 'Brad Whitaker <whitaker@danga.com>',
|
||||
ABSTRACT => 'MogileFS client library',
|
||||
PREREQ_PM => {
|
||||
'IO::WrapTie' => '2.102',
|
||||
'LWP::Simple' => 0,
|
||||
fields => 0,
|
||||
'Test::More' => 0,
|
||||
},
|
||||
dist => {
|
||||
CI => "cvs commit",
|
||||
RCS_LABEL => 'cvs tag RELEASE_$(VERSION_SYM)',
|
||||
SUFFIX => ".gz",
|
||||
DIST_DEFAULT => 'all tardist',
|
||||
COMPRESS => "gzip",
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
1317
wcmtools/mogilefs/api/perl/MogileFS.pm
Executable file
1317
wcmtools/mogilefs/api/perl/MogileFS.pm
Executable file
File diff suppressed because it is too large
Load Diff
5
wcmtools/mogilefs/api/perl/debian/changelog
Executable file
5
wcmtools/mogilefs/api/perl/debian/changelog
Executable file
@@ -0,0 +1,5 @@
|
||||
libmogilefs-perl (1.00-1) unstable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- Jay Bonci <jaybonci@debian.org> Fri, 14 Jan 2005 15:05:21 -0500
|
||||
1
wcmtools/mogilefs/api/perl/debian/compat
Executable file
1
wcmtools/mogilefs/api/perl/debian/compat
Executable file
@@ -0,0 +1 @@
|
||||
4
|
||||
13
wcmtools/mogilefs/api/perl/debian/control
Executable file
13
wcmtools/mogilefs/api/perl/debian/control
Executable file
@@ -0,0 +1,13 @@
|
||||
Source: libmogilefs-perl
|
||||
Section: perl
|
||||
Priority: optional
|
||||
Maintainer: Jay Bonci <jaybonci@debian.org>
|
||||
Build-Depends-Indep: debhelper (>= 4.1.40), perl (>= 5.6.0-16), libio-stringy-perl, libwww-perl
|
||||
Standards-Version: 3.6.1.0
|
||||
|
||||
Package: libmogilefs-perl
|
||||
Architecture: all
|
||||
Depends: ${perl:Depends}, libio-stringy-perl, libwww-perl
|
||||
Description: perl client for MogileFS
|
||||
MogileFS.pm provides a the perl client for the MogileFS application-level
|
||||
distributed filesystem.
|
||||
27
wcmtools/mogilefs/api/perl/debian/copyright
Executable file
27
wcmtools/mogilefs/api/perl/debian/copyright
Executable file
@@ -0,0 +1,27 @@
|
||||
This package was debianized by Jay Bonci <jay@bonci.com> on
|
||||
Fri Jan 14 15:08:23 EST 2005
|
||||
|
||||
It was downloaded from: http://www.danga.com/dist/MogileFS/client-perl/
|
||||
|
||||
Upstream Authors:
|
||||
|
||||
Brad Whitaker <whitaker@danga.com>
|
||||
Brad Fitzpatrick <brad@danga.com>
|
||||
|
||||
|
||||
Copyright:
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of either:
|
||||
|
||||
a) the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 1, or (at your option) any
|
||||
later version, or
|
||||
|
||||
b) the "Artistic License"
|
||||
|
||||
See:
|
||||
|
||||
/usr/share/common-licenses/Artistic
|
||||
/usr/share/common-licenses/GPL
|
||||
|
||||
For more information regarding these licensing options
|
||||
53
wcmtools/mogilefs/api/perl/debian/rules
Executable file
53
wcmtools/mogilefs/api/perl/debian/rules
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This is the debhelper compatibility version to use.
|
||||
# export DH_COMPAT=4
|
||||
|
||||
PACKAGE=`pwd | sed -e "s/.*\/\\(.*\\)-.*/\\1/"`
|
||||
|
||||
|
||||
build:
|
||||
dh_testdir
|
||||
# Add here commands to compile the package.
|
||||
perl Makefile.PL verbose INSTALLDIRS=vendor
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
|
||||
-$(MAKE) clean
|
||||
rm -f Makefile.old
|
||||
dh_clean
|
||||
|
||||
install:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
$(MAKE) PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
|
||||
-find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
|
||||
|
||||
binary-arch:;
|
||||
binary-indep: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installman
|
||||
dh_installchangelogs
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_perl
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
2
wcmtools/mogilefs/api/perl/debian/watch
Executable file
2
wcmtools/mogilefs/api/perl/debian/watch
Executable file
@@ -0,0 +1,2 @@
|
||||
version=2
|
||||
http://www.danga.com/dist/MogileFS/client-perl/MogileFS-([0-9].*)\.tar.gz
|
||||
8
wcmtools/mogilefs/api/perl/t/00use.t
Executable file
8
wcmtools/mogilefs/api/perl/t/00use.t
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use Test::More tests => 1;
|
||||
|
||||
my $mod = "MogileFS";
|
||||
|
||||
use_ok($mod);
|
||||
2
wcmtools/mogilefs/devnotes/FIXME
Executable file
2
wcmtools/mogilefs/devnotes/FIXME
Executable file
@@ -0,0 +1,2 @@
|
||||
BINARY attributes to mysql columns
|
||||
|
||||
14
wcmtools/mogilefs/devnotes/mounter.pl
Executable file
14
wcmtools/mogilefs/devnotes/mounter.pl
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
__END__
|
||||
|
||||
mkdir /mnt/mogilefs
|
||||
mkdir /mnt/mogilefs/brad
|
||||
mkdir /mnt/mogilefs/kenny
|
||||
mkdir /mnt/mogilefs/cartman
|
||||
mount -t nfs -o defaults,noatime,timeo=2,retrans=1,soft 10.1.0.10:/var/mogdata /mnt/mogilefs/brad
|
||||
mount -t nfs -o defaults,noatime,timeo=2,retrans=1,soft 10.1.0.2:/var/mogdata /mnt/mogilefs/kenny
|
||||
mount -t nfs -o defaults,noatime,timeo=2,retrans=1,soft 10.1.0.1:/var/mogdata /mnt/mogilefs/cartman
|
||||
|
||||
|
||||
46
wcmtools/mogilefs/devnotes/notes.txt
Executable file
46
wcmtools/mogilefs/devnotes/notes.txt
Executable file
@@ -0,0 +1,46 @@
|
||||
DATABASE
|
||||
|
||||
mysql -umogile mogilefs
|
||||
|
||||
CLIENT
|
||||
|
||||
10.0.0.80:/usr/share/commons /mnt/tally/commons nfs defaults,noatime,timeo=1,retrans=1,soft 0 0
|
||||
0.3 seconds for open to fail w/ above.
|
||||
|
||||
find /mnt/mogilefs/ -type f -exec rm {} \;
|
||||
|
||||
|
||||
SERVER
|
||||
|
||||
apfel:/var# cat /etc/exports
|
||||
# /etc/exports: the access control list for filesystems which may be exported
|
||||
# to NFS clients. See exports(5).
|
||||
/var/mogilefs 10.0.0.81(rw,sync,anonuid=1000,anongid=1000)
|
||||
|
||||
|
||||
|
||||
|
||||
MogileA
|
||||
/mnt/foo/disk1
|
||||
/mnt/foo/disk2
|
||||
|
||||
MogileB
|
||||
/mnt/bar/disk1
|
||||
/mnt/bar/disk2
|
||||
|
||||
ClientA
|
||||
|
||||
/mnt/mogilefs/MA/disk1
|
||||
/mnt/mogilefs/MA/disk2
|
||||
/mnt/mogilefs/MB/disk1
|
||||
/mnt/mogilefs/MB/disk2
|
||||
|
||||
ClientA's fstab:
|
||||
|
||||
10.0.0.A:/mnt/foo /mnt/mogilefs/MA
|
||||
10.0.0.B:/mnt/bar /mnt/mogilefs/MB
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
102
wcmtools/mogilefs/devnotes/perl-interface.txt
Executable file
102
wcmtools/mogilefs/devnotes/perl-interface.txt
Executable file
@@ -0,0 +1,102 @@
|
||||
FB will want:
|
||||
|
||||
Give me new $fh for a given key. (which is for a domain)
|
||||
Give me a path to a file to sendfile. (from a key)
|
||||
|
||||
Perl <-> mogilefs interface:
|
||||
|
||||
1) request new fid/path for a given key
|
||||
|
||||
< CREATE_OPEN domain=test&key=foo%27+sdf&class=<class_ident>
|
||||
> ERR <errcode> <errstring>
|
||||
nodb
|
||||
foo
|
||||
> OK <arg_length> fid=234&devid=342&path=/blah/foo/sdff
|
||||
> ERR invalid_domain "Provided domain is not registered"
|
||||
|
||||
'key' may be optional, in which an anonymous file (not in
|
||||
namespace is returned). essentially a temp/spool file.
|
||||
|
||||
optional request key: 'multi_dest=1' signals that server should
|
||||
reply not with keys "devid" and "path" but instead with:
|
||||
|
||||
dev_count=3
|
||||
devid_1=10
|
||||
devid_2=17
|
||||
devid_3=26
|
||||
path_1=http://host1:7500/dev10/...
|
||||
path_2=http://host2:7500/dev17/...
|
||||
path_3=http://host3:7500/dev26/...
|
||||
|
||||
.. that way if the server unknowingly gave the client a down storage node,
|
||||
the client can immediately try somewhere else.
|
||||
|
||||
2) close fid (and the devid, path that was written to)
|
||||
|
||||
< CREATE_CLOSE domain=test&key=foo&fid=343&devid=34&path=/sdf/sf/sdf
|
||||
|
||||
-- fid and devid are totally opaque strings. server just uses
|
||||
them to verify the path and key.
|
||||
|
||||
-- it's possible two clients did a CREATE_OPEN on same key, got
|
||||
diff fids (123 and 124), then 123 closes first and loses, since
|
||||
key is now owned by 124, not 123.
|
||||
|
||||
> ERR expiredfid URL_encode("Expired file: another connection created the same file between your open and close")
|
||||
> ERR bogus_devid "Devid doesn't correspond to path"
|
||||
> ERR invalid_domain "Provided domain is not registered"
|
||||
|
||||
|
||||
3) give string path to a given domainid+key
|
||||
|
||||
< GET_PATHS domain=test&key=FOOBAR
|
||||
|
||||
> OK <arg_length> paths=<n>&path1=.....&path2=.....
|
||||
|
||||
(client should prefer them in order given)
|
||||
|
||||
4) delete a key
|
||||
|
||||
< DELETE domain=test&key=sdfsdfsdfsdf
|
||||
> OK 0
|
||||
|
||||
|
||||
5) get a list of domains and classes for them
|
||||
|
||||
< GET_DOMAINS
|
||||
> OK domains=1&domain1=test&domain1classes=1&domain1class1name=alt&domain1class1mindevcount=2
|
||||
|
||||
-- this is a two level hash; there are N domains (taken from the
|
||||
key 'domains') and their names are stored in 'domainX' where X is
|
||||
in the range 1..N.
|
||||
|
||||
-- each domain has N classes (taken from 'domainXclasses');
|
||||
each class has two keys in the form of 'domainXclassYname' and
|
||||
'domainXclassYmindevcount' where Y is in the range of 1..N.
|
||||
|
||||
|
||||
6) create a new domain on the fly
|
||||
|
||||
< CREATE_DOMAIN domain=mynewdomain
|
||||
> OK domain=mynewdomain
|
||||
|
||||
-- returns the domain you just created as the only response value
|
||||
|
||||
|
||||
7) create a new class
|
||||
|
||||
< CREATE_CLASS domain=mynewdomain&class=theclass&mindevcount=2
|
||||
> OK domain=mynewdomain&class=theclass&mindevcount=2
|
||||
|
||||
-- creates a new class under the domain you specify named 'class' with
|
||||
the minimum device replication count of 'mindevcount'
|
||||
|
||||
|
||||
8) updates a class's minimum device replica count
|
||||
|
||||
< UPDATE_CLASS domain=mynewdomain&class=theclass&mindevcount=3
|
||||
> OK domain=mynewdomain&class=theclass&mindevcount=3
|
||||
|
||||
-- same as create_class except it overwrites the mindevcount of the class
|
||||
you are specifying. useful if you want to change the replica count
|
||||
for a class.
|
||||
13
wcmtools/mogilefs/devnotes/sql-data-bradhome.txt
Executable file
13
wcmtools/mogilefs/devnotes/sql-data-bradhome.txt
Executable file
@@ -0,0 +1,13 @@
|
||||
|
||||
INSERT INTO host SET hostid=1, status='alive', hostname='sammy', hostip='10.0.0.81', remoteroot='/var/mogilefs';
|
||||
INSERT INTO host SET hostid=2, status='alive', hostname='tally', hostip='10.0.0.80', remoteroot='/var/mogilefs';
|
||||
INSERT INTO host SET hostid=3, status='alive', hostname='tibook', hostip='10.0.0.13', remoteroot='/var/mogilefs';
|
||||
|
||||
INSERT INTO device SET devid=1, hostid=1, status='alive';
|
||||
INSERT INTO device SET devid=2, hostid=1, status='alive';
|
||||
INSERT INTO device SET devid=3, hostid=2, status='alive';
|
||||
INSERT INTO device SET devid=4, hostid=2, status='alive';
|
||||
INSERT INTO device SET devid=5, hostid=3, status='alive';
|
||||
|
||||
INSERT INTO domain SET dmid=1, namespace='test';
|
||||
INSERT INTO class SET dmid=1, classid=1, classname='normal', mindevcount=2;
|
||||
12
wcmtools/mogilefs/devnotes/sql-data-office.txt
Executable file
12
wcmtools/mogilefs/devnotes/sql-data-office.txt
Executable file
@@ -0,0 +1,12 @@
|
||||
|
||||
INSERT INTO host SET hostid=1, status='alive', hostname='kenny', hostip='10.1.0.2', remoteroot='/var/mogdata';
|
||||
INSERT INTO host SET hostid=2, status='alive', hostname='cartman', hostip='10.1.0.1', remoteroot='/var/mogdata';
|
||||
INSERT INTO host SET hostid=3, status='alive', hostname='brad', hostip='10.1.0.10', remoteroot='/var/mogdata';
|
||||
|
||||
INSERT INTO device SET devid=1, hostid=1, status='alive';
|
||||
INSERT INTO device SET devid=2, hostid=1, status='alive';
|
||||
INSERT INTO device SET devid=3, hostid=2, status='alive';
|
||||
INSERT INTO device SET devid=4, hostid=3, status='alive';
|
||||
|
||||
INSERT INTO domain SET dmid=1, namespace='test';
|
||||
INSERT INTO class SET dmid=1, classid=1, classname='normal', mindevcount=2;
|
||||
8
wcmtools/mogilefs/devnotes/sql-data-simple.txt
Executable file
8
wcmtools/mogilefs/devnotes/sql-data-simple.txt
Executable file
@@ -0,0 +1,8 @@
|
||||
INSERT INTO host SET hostid=1, status='alive', hostname='localhost', hostip='127.0.0.1', remoteroot='/var/mogilefs';
|
||||
|
||||
INSERT INTO device SET devid=1, hostid=1, status='alive';
|
||||
INSERT INTO device SET devid=2, hostid=1, status='alive';
|
||||
INSERT INTO device SET devid=3, hostid=1, status='alive';
|
||||
|
||||
INSERT INTO domain SET dmid=1, namespace='test';
|
||||
INSERT INTO class SET dmid=1, classid=1, classname='normal', mindevcount=2;
|
||||
154
wcmtools/mogilefs/devnotes/sql.txt
Executable file
154
wcmtools/mogilefs/devnotes/sql.txt
Executable file
@@ -0,0 +1,154 @@
|
||||
# <www.danga.com>LiveJournal
|
||||
|
||||
DROP TABLE IF EXISTS domain;
|
||||
CREATE TABLE domain (
|
||||
dmid SMALLINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (dmid),
|
||||
|
||||
namespace VARCHAR(255),
|
||||
UNIQUE (namespace) # LiveJournal:<www.livejournal.com>, FotoBilder:<www.picpix.com>
|
||||
|
||||
);
|
||||
|
||||
# classes are tied to domains. domains can have classes of items
|
||||
# with different mindevcounts.
|
||||
#
|
||||
# a minimum devcount is the number of copies the system tries to
|
||||
# maintain for files in that class
|
||||
#
|
||||
# unspecified classname means classid=0 (implicit class), and that
|
||||
# implies mindevcount=2
|
||||
#
|
||||
DROP TABLE IF EXISTS class;
|
||||
CREATE TABLE class (
|
||||
dmid SMALLINT UNSIGNED NOT NULL,
|
||||
classid TINYINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (dmid,classid),
|
||||
classname VARCHAR(50),
|
||||
UNIQUE (dmid,classname),
|
||||
mindevcount TINYINT UNSIGNED NOT NULL
|
||||
);
|
||||
|
||||
# the length field is only here for easy verifications of content
|
||||
# integrity when copying around. no sums or content types or other
|
||||
# metadata here. application can handle that.
|
||||
#
|
||||
# classid is what class of file this belongs to. for instance, on fotobilder
|
||||
# there will be a class for original pictures (the ones the user uploaded)
|
||||
# and a class for derived images (scaled down versions, thumbnails, greyscale, etc)
|
||||
# each domain can setup classes and assign the minimum redundancy level for
|
||||
# each class. fotobilder will use a 2 or 3 minimum copy redundancy for original
|
||||
# photos and and a 1 minimum for derived images (which means the sole device
|
||||
# for a derived image can die, bringing devcount to 0 for that file, but
|
||||
# the application can recreate it from its original)
|
||||
DROP TABLE IF EXISTS file;
|
||||
CREATE TABLE file (
|
||||
fid INT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (fid),
|
||||
|
||||
dmid SMALLINT UNSIGNED NOT NULL,
|
||||
dkey VARCHAR(255), # domain-defined. LJ: "<userid>-<blobtype>-<blobid>"
|
||||
UNIQUE dkey (dmid, dkey),
|
||||
|
||||
length INT UNSIGNED, # 4GB limit
|
||||
|
||||
classid TINYINT UNSIGNED NOT NULL,
|
||||
devcount TINYINT UNSIGNED NOT NULL,
|
||||
INDEX devcount (dmid,classid,devcount)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS tempfile;
|
||||
CREATE TABLE tempfile (
|
||||
fid INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (fid),
|
||||
|
||||
createtime INT UNSIGNED NOT NULL,
|
||||
classid TINYINT UNSIGNED NOT NULL,
|
||||
dmid SMALLINT UNSIGNED NOT NULL,
|
||||
dkey VARCHAR(255),
|
||||
devids VARCHAR(60)
|
||||
);
|
||||
|
||||
# files marked for death when their key is overwritten. then they get a new
|
||||
# fid, but since the old row (with the old fid) had to be deleted immediately,
|
||||
# we need a place to store the fid so an async job can delete the file from
|
||||
# all devices.
|
||||
DROP TABLE IF EXISTS file_to_delete;
|
||||
CREATE TABLE file_to_delete (
|
||||
fid INT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (fid)
|
||||
);
|
||||
|
||||
# if the replicator notices that a fid has no sources, that file gets inserted
|
||||
# into the unreachable_fids table. it is up to the application to actually
|
||||
# handle fids stored in this table.
|
||||
DROP TABLE IF EXISTS unreachable_fids;
|
||||
CREATE TABLE unreachable_fids (
|
||||
fid INT UNSIGNED NOT NULL,
|
||||
lastupdate INT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (fid),
|
||||
INDEX (lastupdate)
|
||||
);
|
||||
|
||||
# what files are on what devices? (most likely physical devices,
|
||||
# as logical devices of RAID arrays would be costly, and mogilefs
|
||||
# already handles redundancy)
|
||||
#
|
||||
# the devid index lets us answer "What files were on this now-dead disk?"
|
||||
#
|
||||
DROP TABLE IF EXISTS file_on;
|
||||
CREATE TABLE file_on (
|
||||
fid INT UNSIGNED NOT NULL,
|
||||
devid MEDIUMINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (fid, devid),
|
||||
INDEX (devid)
|
||||
);
|
||||
|
||||
# if application or framework detects an error in one of the duplicate files
|
||||
# for whatever reason, it can register its complaint and the framework
|
||||
# will do some verifications and fix things up w/ an async job
|
||||
# MAYBE: let application tell us the SHA1/MD5 of the file for us to check
|
||||
# on the other devices?
|
||||
DROP TABLE IF EXISTS file_on_corrupt;
|
||||
CREATE TABLE file_on_corrupt (
|
||||
fid INT UNSIGNED NOT NULL,
|
||||
devid MEDIUMINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (fid, devid)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS device;
|
||||
CREATE TABLE device (
|
||||
devid MEDIUMINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (devid),
|
||||
|
||||
hostid MEDIUMINT UNSIGNED NOT NULL,
|
||||
|
||||
status ENUM('alive','dead','down'),
|
||||
INDEX (status),
|
||||
|
||||
mb_total MEDIUMINT UNSIGNED,
|
||||
mb_used MEDIUMINT UNSIGNED,
|
||||
mb_asof INT UNSIGNED
|
||||
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS host;
|
||||
CREATE TABLE host (
|
||||
hostid MEDIUMINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (hostid),
|
||||
|
||||
status ENUM('alive','dead','down'),
|
||||
http_port MEDIUMINT UNSIGNED DEFAULT 7500,
|
||||
http_get_port MEDIUMINT UNSIGNED,
|
||||
|
||||
hostname VARCHAR(40),
|
||||
UNIQUE (hostname),
|
||||
hostip VARCHAR(15),
|
||||
UNIQUE (hostip),
|
||||
altip VARCHAR(15),
|
||||
UNIQUE (altip),
|
||||
altmask VARCHAR(18),
|
||||
|
||||
remoteroot VARCHAR(60)
|
||||
);
|
||||
|
||||
59
wcmtools/mogilefs/devnotes/todo.txt
Executable file
59
wcmtools/mogilefs/devnotes/todo.txt
Executable file
@@ -0,0 +1,59 @@
|
||||
mogile database:
|
||||
|
||||
* add UUID to device table
|
||||
|
||||
mogilefsd:
|
||||
|
||||
* when storing files, also store 00003443.meta with info about file
|
||||
- this is so we can restore the database if it totally crashes
|
||||
- can also store checksumming info in the .meta file?
|
||||
* other jobs (replicator & delete, etc) can connect to frontend and do spud-like variable setting
|
||||
* fix request pipelining problem (make it an option, though?)
|
||||
* host dead cache:
|
||||
- when any jobs notices a mogstored state change, send to parent
|
||||
- parent rebroadcasts to kids, so they share info
|
||||
* UDP between peers for jobs to cross-communicate
|
||||
- in conf file, "peers: 10.x.y.z:6001, 10.a.b.c:6001"
|
||||
* running fs verifier that makes sure UUIDs from mogstored matches database
|
||||
- if a host fails verification, mark it as down
|
||||
- configurable "verify time" (default 300 seconds)
|
||||
- over 300 seconds, verify another device every N seconds (300/X = N, X = number of devices)
|
||||
* rebalancer job (future)
|
||||
- moves files around to devices with less files
|
||||
* free space weighting
|
||||
- every N seconds, using usage file, update database free space columns
|
||||
- jobs update their in memory space cache every 60 seconds or so
|
||||
- new files go to devices depending on free space (weighted algorithm)
|
||||
- new job to update mb_* columns
|
||||
- new column, mb_asof for date last updated
|
||||
- email alerts when mb_asof is old
|
||||
* checksum files (future)
|
||||
* FUSE interface (future)
|
||||
* require InnoDB backend
|
||||
|
||||
mogstored:
|
||||
|
||||
* support configuration files
|
||||
* allow OPTIONS request
|
||||
- include "Date: <gmt date>" header
|
||||
* run usage file creator in different thread
|
||||
* smartd dump just like usage file
|
||||
* fsinfo dump
|
||||
- include UUID of fs
|
||||
- run in new thread (with usage?)
|
||||
- mount -P to get fs types
|
||||
|
||||
mogadm:
|
||||
|
||||
* example commands:
|
||||
- check
|
||||
- <host> add disk <disk>
|
||||
- <host> down disk <disk>
|
||||
- <host> kill disk <disk>
|
||||
- <host> down
|
||||
- <host> up
|
||||
|
||||
moginit
|
||||
|
||||
* create new mogilefs database
|
||||
* perform database upgrades
|
||||
5
wcmtools/mogilefs/server/MANIFEST
Executable file
5
wcmtools/mogilefs/server/MANIFEST
Executable file
@@ -0,0 +1,5 @@
|
||||
Makefile.PL
|
||||
MANIFEST
|
||||
mogstored
|
||||
mogilefsd
|
||||
META.yml Module meta-data (added by MakeMaker)
|
||||
13
wcmtools/mogilefs/server/MANIFEST.SKIP
Executable file
13
wcmtools/mogilefs/server/MANIFEST.SKIP
Executable file
@@ -0,0 +1,13 @@
|
||||
^#
|
||||
\bCVS\b
|
||||
^MANIFEST\.
|
||||
^Makefile$
|
||||
~$
|
||||
\.html$
|
||||
\.old$
|
||||
^blib/
|
||||
_blib$
|
||||
^MakeMaker-\d
|
||||
^\.exists
|
||||
\bdebian\b
|
||||
\bconf\b
|
||||
17
wcmtools/mogilefs/server/META.yml
Executable file
17
wcmtools/mogilefs/server/META.yml
Executable file
@@ -0,0 +1,17 @@
|
||||
# http://module-build.sourceforge.net/META-spec.html
|
||||
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
|
||||
name: mogilefs-server
|
||||
version: 1.00
|
||||
version_from:
|
||||
installdirs: site
|
||||
requires:
|
||||
Danga::Socket: 1.22
|
||||
fields: 0
|
||||
Getopt::Long: 0
|
||||
Linux::AIO: 1.3
|
||||
Perlbal: 0
|
||||
Symbol: 0
|
||||
Sys::Syslog: 0
|
||||
|
||||
distribution_type: module
|
||||
generated_by: ExtUtils::MakeMaker version 6.17
|
||||
42
wcmtools/mogilefs/server/Makefile.PL
Executable file
42
wcmtools/mogilefs/server/Makefile.PL
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Perl Makefile for Danga-Socket
|
||||
# $Id: Makefile.PL,v 1.1 2005/02/01 01:17:53 bradfitz Exp $
|
||||
#
|
||||
# Invoke with 'perl Makefile.PL'
|
||||
#
|
||||
# See ExtUtils::MakeMaker (3) for more information on how to influence
|
||||
# the contents of the Makefile that is written
|
||||
#
|
||||
|
||||
use ExtUtils::MakeMaker;
|
||||
|
||||
my $exefiles = ["mogstored", "mogilefsd"];
|
||||
$exefiles = ["mogstored"] if exists $ENV{DANGABUILD_MOGSTOREDONLY};
|
||||
$exefiles = ["mogilefsd"] if exists $ENV{DANGABUILD_MOGILEFSDONLY};
|
||||
|
||||
WriteMakefile(
|
||||
NAME => 'mogilefs-server',
|
||||
VERSION => '1.00',
|
||||
AUTHOR => 'Brad Fitzpatrick <brad@danga.com>',
|
||||
ABSTRACT => 'MogileFS server components',
|
||||
EXE_FILES => $exefiles,
|
||||
PREREQ_PM => {
|
||||
'Danga::Socket' => '1.22',
|
||||
'Perlbal' => 0, # FIXME: add version to Perlbal
|
||||
'Linux::AIO' => '1.3',
|
||||
'Sys::Syslog' => 0,
|
||||
'Getopt::Long' => 0,
|
||||
'Symbol' => 0,
|
||||
fields => 0,
|
||||
},
|
||||
dist => {
|
||||
CI => "cvs commit",
|
||||
RCS_LABEL => 'cvs tag RELEASE_$(VERSION_SYM)',
|
||||
SUFFIX => ".gz",
|
||||
DIST_DEFAULT => 'all tardist',
|
||||
COMPRESS => "gzip",
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
10
wcmtools/mogilefs/server/conf/mogilefsd.conf
Executable file
10
wcmtools/mogilefs/server/conf/mogilefsd.conf
Executable file
@@ -0,0 +1,10 @@
|
||||
#daemonize = 1
|
||||
db_dsn = DBI:mysql:mogilefs:host=127.0.0.1
|
||||
db_user = username
|
||||
db_pass = password
|
||||
conf_port = 7001
|
||||
listener_jobs = 10
|
||||
delete_jobs = 1
|
||||
replicate_jobs = 5
|
||||
mog_root = /mnt/mogilefs
|
||||
reaper_jobs = 1
|
||||
11
wcmtools/mogilefs/server/conf/mogstored.conf
Executable file
11
wcmtools/mogilefs/server/conf/mogstored.conf
Executable file
@@ -0,0 +1,11 @@
|
||||
SERVER max_connections = 10000
|
||||
CREATE SERVICE mogstored
|
||||
SET mogstored.role = web_server
|
||||
SET mogstored.listen = 0.0.0.0:7500
|
||||
SET mogstored.docroot = #MOGSTORED_DOCROOT
|
||||
SET mogstored.dirindexing = 0
|
||||
SET mogstored.enable_put = 1
|
||||
SET mogstored.enable_delete = 1
|
||||
SET mogstored.min_put_directory = 1
|
||||
ENABLE mogstored
|
||||
|
||||
5
wcmtools/mogilefs/server/debian/changelog
Executable file
5
wcmtools/mogilefs/server/debian/changelog
Executable file
@@ -0,0 +1,5 @@
|
||||
mogilefs-server (1.00-1) unstable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- Jay Bonci <jaybonci@debian.org> Fri, 14 Jan 2005 15:41:28 -0500
|
||||
1
wcmtools/mogilefs/server/debian/compat
Executable file
1
wcmtools/mogilefs/server/debian/compat
Executable file
@@ -0,0 +1 @@
|
||||
4
|
||||
25
wcmtools/mogilefs/server/debian/control
Executable file
25
wcmtools/mogilefs/server/debian/control
Executable file
@@ -0,0 +1,25 @@
|
||||
Source: mogilefs-server
|
||||
Section: perl
|
||||
Priority: optional
|
||||
Maintainer: Jay Bonci <jaybonci@debian.org>
|
||||
Build-Depends-Indep: debhelper (>= 4.1.40), perl (>= 5.6.0-16), libdbd-mysql-perl, libdbi-perl, libperlbal-perl, liblinux-aio-perl, po-debconf, libnet-netmask-perl, libwww-perl
|
||||
Standards-Version: 3.6.1.0
|
||||
|
||||
Package: mogilefsd
|
||||
Architecture: all
|
||||
Depends: ${perl:Depends}, libdbd-mysql-perl, libdbi-perl, debconf (>= 1.2.0), libnet-netmask-perl, libwww-perl
|
||||
Suggests: libmogilefs-perl, mogilefs-utils
|
||||
Description: scalable distributed filesystem from Danga Interactive
|
||||
MogileFS is an open-source, application-level distributed filesystem. It
|
||||
creates a host-nuetral, filesystem-agnostic method of distributing files
|
||||
that has many advantages over NFS and single-machine raid. This set
|
||||
of utilities is very scalable and can handle Livejournal.com's load, for
|
||||
which it was designed.
|
||||
|
||||
Package: mogstored
|
||||
Architecture: all
|
||||
Depends: ${perl:Depends}, libperlbal-perl, liblinux-aio-perl, debconf (>= 1.2.0)
|
||||
Suggests: mogilefs-utils
|
||||
Description: storage node daemon for MogileFS
|
||||
Mogstored is a storage node daemon for MogileFS, the open-source
|
||||
application-level distributed filesystem from Danga Interactive.
|
||||
27
wcmtools/mogilefs/server/debian/copyright
Executable file
27
wcmtools/mogilefs/server/debian/copyright
Executable file
@@ -0,0 +1,27 @@
|
||||
This package was debianized by Jay Bonci <jay@bonci.com> on
|
||||
Fri Jan 14 15:57:37 EST 2005
|
||||
|
||||
It was downloaded from: http://www.danga.com/dist/MogileFS/server/
|
||||
|
||||
Upstream Author:
|
||||
Brad Fitzpatrick <brad@danga.com>
|
||||
Brad Whitaker <whitaker@danga.com>
|
||||
Mark Smith <junior@danga.com>
|
||||
|
||||
|
||||
Copyright:
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of either:
|
||||
|
||||
a) the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 1, or (at your option) any
|
||||
later version, or
|
||||
|
||||
b) the "Artistic License"
|
||||
|
||||
See:
|
||||
|
||||
/usr/share/common-licenses/Artistic
|
||||
/usr/share/common-licenses/GPL
|
||||
|
||||
For more information regarding these licensing options
|
||||
26
wcmtools/mogilefs/server/debian/mogilefsd.config
Executable file
26
wcmtools/mogilefs/server/debian/mogilefsd.config
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
PACKAGE=mogilefsd
|
||||
|
||||
set -e
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
RUNASUSER=""
|
||||
|
||||
while [ "$RUNASUSER" = "" ]
|
||||
do
|
||||
|
||||
db_input medium $PACKAGE/runasuser || true
|
||||
db_go
|
||||
|
||||
db_get $PACKAGE/runasuser
|
||||
RUNASUSER="$RET"
|
||||
|
||||
if [ "$RUNASUSER" = "root" ]
|
||||
then
|
||||
|
||||
db_reset $PACKAGE/runasuser
|
||||
db_fset $PACKAGE/runasuser seen false
|
||||
fi
|
||||
|
||||
done
|
||||
91
wcmtools/mogilefs/server/debian/mogilefsd.init
Executable file
91
wcmtools/mogilefs/server/debian/mogilefsd.init
Executable file
@@ -0,0 +1,91 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# skeleton example file to build /etc/init.d/ scripts.
|
||||
# This file should be used to construct scripts for /etc/init.d.
|
||||
#
|
||||
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
|
||||
# Modified for Debian
|
||||
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
|
||||
#
|
||||
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
|
||||
#
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DAEMON=/usr/bin/mogilefsd
|
||||
NAME=mogilefsd
|
||||
DESC=mogilefsd
|
||||
DEFAULTS=/etc/default/$NAME
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
if [ ! -e $DEFAULTS ]
|
||||
then
|
||||
echo "Can't start $NAME. Defaults file ($DEFAULTS) doesn't exist."
|
||||
echo "Please run dpkg-reconfigure $NAME to correct the problem."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#Read defaults file
|
||||
[ -r $DEFAULTS ] && . $DEFAULTS
|
||||
|
||||
if [ "$MOGILEFSD_RUNASUSER" == "" ]
|
||||
then
|
||||
|
||||
echo "Cannot determine user to run as, even though defaults file ($DEFAULTS) exists."
|
||||
echo "Please run dpkg-reconfigure $NAME to correct the problem."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: "
|
||||
|
||||
if [ -e $PIDFILE ]
|
||||
then
|
||||
|
||||
if [ -d /proc/`cat $PIDFILE`/ ]
|
||||
then
|
||||
|
||||
echo "$NAME already running."
|
||||
exit 0;
|
||||
else
|
||||
rm -f $PIDFILE
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME --chuid $MOGILEFSD_RUNASUSER
|
||||
echo "$NAME."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME --user $MOGILEFSD_RUNASUSER
|
||||
echo "$NAME."
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented, move the "force-reload"
|
||||
# option to the "reload" entry above. If not, "force-reload" is
|
||||
# just the same as "restart".
|
||||
#
|
||||
echo -n "Restarting $DESC: "
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME --user $MOGILEFSD_RUNASUSER
|
||||
rm -f $PIDFILE
|
||||
sleep 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME --chuid $MOGILEFSD_RUNASUSER
|
||||
echo "$NAME."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
33
wcmtools/mogilefs/server/debian/mogilefsd.postinst
Executable file
33
wcmtools/mogilefs/server/debian/mogilefsd.postinst
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
PKG=mogilefsd
|
||||
DEFAULTFILE=/etc/default/$PKG
|
||||
|
||||
. /usr/share/debconf/confmodule || exit 0
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
|
||||
if [ ! -e /etc/mogilefs/mogilefsd.conf ]
|
||||
then
|
||||
mkdir -p /etc/mogilefs
|
||||
cp /usr/share/mogilefsd/mogilefsd.conf.default /etc/mogilefs/mogilefsd.conf
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
db_stop
|
||||
|
||||
15
wcmtools/mogilefs/server/debian/mogilefsd.postrm
Executable file
15
wcmtools/mogilefs/server/debian/mogilefsd.postrm
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
if [ "$1" = "purge" ]
|
||||
then
|
||||
rm -f /etc/mogilefs/mogilefsd.conf
|
||||
rm -f /etc/default/mogilefsd
|
||||
|
||||
[ -d /etc/mogilefs ] && rmdir --ignore-fail-on-non-empty /etc/mogilefs
|
||||
rmdir --ignore-fail-on-non-empty /etc/default
|
||||
fi
|
||||
|
||||
rm -f /var/run/mogilefsd.pid
|
||||
|
||||
24
wcmtools/mogilefs/server/debian/mogilefsd.preinst
Executable file
24
wcmtools/mogilefs/server/debian/mogilefsd.preinst
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
PKG=mogilefsd
|
||||
DEFAULTFILE=/etc/default/$PKG
|
||||
|
||||
. /usr/share/debconf/confmodule || exit 0
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
set -e
|
||||
|
||||
db_get $PKG/runasuser
|
||||
RUNAS=$RET
|
||||
|
||||
getent passwd $RUNAS >/dev/null || adduser --system $RUNAS
|
||||
|
||||
if [ ! -e $DEFAULTFILE ]
|
||||
then
|
||||
mkdir -p /etc/default
|
||||
echo "#!/bin/sh" >> $DEFAULTFILE
|
||||
echo "# Defaults for the mogilefsd package" >> $DEFAULTFILE
|
||||
echo "MOGILEFSD_RUNASUSER=$RUNAS" >> $DEFAULTFILE
|
||||
fi
|
||||
|
||||
7
wcmtools/mogilefs/server/debian/mogilefsd.templates
Executable file
7
wcmtools/mogilefs/server/debian/mogilefsd.templates
Executable file
@@ -0,0 +1,7 @@
|
||||
Template: mogilefsd/runasuser
|
||||
Type: string
|
||||
_Default: mogilefsd
|
||||
_Description: User to run mogilefsd as:
|
||||
The mogilefsd storage engine cannot be run as root. What user should it be
|
||||
run as? This user will be created for you as a system user if it does not
|
||||
yet exist.
|
||||
9
wcmtools/mogilefs/server/debian/mogstored.config
Executable file
9
wcmtools/mogilefs/server/debian/mogstored.config
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
PACKAGE=mogstored
|
||||
|
||||
set -e
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
db_input medium $PACKAGE/docroot || true
|
||||
db_go
|
||||
72
wcmtools/mogilefs/server/debian/mogstored.init
Executable file
72
wcmtools/mogilefs/server/debian/mogstored.init
Executable file
@@ -0,0 +1,72 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# skeleton example file to build /etc/init.d/ scripts.
|
||||
# This file should be used to construct scripts for /etc/init.d.
|
||||
#
|
||||
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
|
||||
# Modified for Debian
|
||||
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
|
||||
#
|
||||
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
|
||||
#
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DAEMON=/usr/bin/mogstored
|
||||
NAME=mogstored
|
||||
DESC=mogstored
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: "
|
||||
|
||||
if [ -e $PIDFILE ]
|
||||
then
|
||||
|
||||
if [ -d /proc/`cat $PIDFILE`/ ]
|
||||
then
|
||||
|
||||
echo "$NAME already running."
|
||||
exit 0;
|
||||
else
|
||||
rm -f $PIDFILE
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME
|
||||
echo "$NAME."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME
|
||||
echo "$NAME."
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented, move the "force-reload"
|
||||
# option to the "reload" entry above. If not, "force-reload" is
|
||||
# just the same as "restart".
|
||||
#
|
||||
echo -n "Restarting $DESC: "
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME
|
||||
rm -f $PIDFILE
|
||||
sleep 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME
|
||||
echo "$NAME."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
47
wcmtools/mogilefs/server/debian/mogstored.postinst
Executable file
47
wcmtools/mogilefs/server/debian/mogstored.postinst
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
PKG=mogstored
|
||||
|
||||
. /usr/share/debconf/confmodule || exit 0
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
|
||||
if [ ! -e /etc/mogilefs/mogstored.conf ]
|
||||
then
|
||||
mkdir -p /etc/mogilefs
|
||||
cp /usr/share/mogstored/mogstored.conf.default /etc/mogilefs/mogstored.conf
|
||||
|
||||
db_get $PKG/docroot
|
||||
MOGSTORED_DOCROOT=$RET
|
||||
|
||||
if [ ! -d "$MOGSTORED_DOCROOT" ]
|
||||
then
|
||||
|
||||
mkdir -p $MOGSTORED_DOCROOT
|
||||
chmod 755 $MOGSTORED_DOCROOT
|
||||
fi
|
||||
|
||||
perl -pi -e "s|#MOGSTORED_DOCROOT|$MOGSTORED_DOCROOT|" /etc/mogilefs/mogstored.conf
|
||||
|
||||
fi
|
||||
|
||||
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
db_stop
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
24
wcmtools/mogilefs/server/debian/mogstored.postrm
Executable file
24
wcmtools/mogilefs/server/debian/mogstored.postrm
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
PKG=mogstored
|
||||
|
||||
. /usr/share/debconf/confmodule || exit 0
|
||||
|
||||
if [ "$1" = "purge" ]
|
||||
then
|
||||
rm -f /etc/mogilefs/mogstored.conf
|
||||
rmdir --ignore-fail-on-non-empty /etc/mogilefs
|
||||
|
||||
db_get $PKG/docroot
|
||||
DOCROOT=$RET
|
||||
|
||||
rmdir --ignore-fail-on-non-empty $DOCROOT &> /dev/null
|
||||
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
rm -f /var/run/mogstored.pid
|
||||
|
||||
|
||||
5
wcmtools/mogilefs/server/debian/mogstored.templates
Executable file
5
wcmtools/mogilefs/server/debian/mogstored.templates
Executable file
@@ -0,0 +1,5 @@
|
||||
Template: mogstored/docroot
|
||||
Type: string
|
||||
_Default: /var/mogdata
|
||||
_Description: Document root for mogstored:
|
||||
The mogstored daemon needs a directory for the root of its filetree.
|
||||
2
wcmtools/mogilefs/server/debian/po/POTFILES.in
Executable file
2
wcmtools/mogilefs/server/debian/po/POTFILES.in
Executable file
@@ -0,0 +1,2 @@
|
||||
[type: gettext/rfc822deb] mogstored.templates
|
||||
[type: gettext/rfc822deb] mogilefsd.templates
|
||||
64
wcmtools/mogilefs/server/debian/po/templates.pot
Executable file
64
wcmtools/mogilefs/server/debian/po/templates.pot
Executable file
@@ -0,0 +1,64 @@
|
||||
#
|
||||
# Translators, if you are not familiar with the PO format, gettext
|
||||
# documentation is worth reading, especially sections dedicated to
|
||||
# this format, e.g. by running:
|
||||
# info -n '(gettext)PO Files'
|
||||
# info -n '(gettext)Header Entry'
|
||||
#
|
||||
# Some information specific to po-debconf are available at
|
||||
# /usr/share/doc/po-debconf/README-trans
|
||||
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
|
||||
#
|
||||
# Developers do not need to manually edit POT or PO files.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2005-01-19 13:36-0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#. Type: string
|
||||
#. Default
|
||||
#: ../mogstored.templates:3
|
||||
msgid "/var/mogdata"
|
||||
msgstr ""
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../mogstored.templates:4
|
||||
msgid "Document root for mogstored:"
|
||||
msgstr ""
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../mogstored.templates:4
|
||||
msgid "The mogstored daemon needs a directory for the root of its filetree."
|
||||
msgstr ""
|
||||
|
||||
#. Type: string
|
||||
#. Default
|
||||
#: ../mogilefsd.templates:3
|
||||
msgid "mogilefsd"
|
||||
msgstr ""
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../mogilefsd.templates:4
|
||||
msgid "User to run mogilefsd as:"
|
||||
msgstr ""
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../mogilefsd.templates:4
|
||||
msgid ""
|
||||
"The mogilefsd storage engine cannot be run as root. What user should it be "
|
||||
"run as? This user will be created for you as a system user if it does not "
|
||||
"yet exist."
|
||||
msgstr ""
|
||||
80
wcmtools/mogilefs/server/debian/rules
Executable file
80
wcmtools/mogilefs/server/debian/rules
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This is the debhelper compatibility version to use.
|
||||
# export DH_COMPAT=4
|
||||
|
||||
ENV=/usr/bin/env
|
||||
PERL=/usr/bin/perl
|
||||
|
||||
MOGILEFSD_PACKAGE=mogilefsd
|
||||
MOGSTORED_PACKAGE=mogstored
|
||||
|
||||
MOGILEFSD_CONFDIR=$(CURDIR)/debian/$(MOGILEFSD_PACKAGE)/usr/share/$(MOGILEFSD_PACKAGE)
|
||||
MOGSTORED_CONFDIR=$(CURDIR)/debian/$(MOGSTORED_PACKAGE)/usr/share/$(MOGSTORED_PACKAGE)
|
||||
|
||||
MOGILEFSDBLIB=blib.mogilefsd
|
||||
MOGSTOREDBLIB=blib.mogstored
|
||||
|
||||
build:
|
||||
dh_testdir
|
||||
# Add here commands to compile the package.
|
||||
$(ENV) DANGABUILD_MOGILEFSDONLY=1 perl Makefile.PL verbose INSTALLDIRS=vendor INST_SCRIPT=$(MOGILEFSDBLIB)
|
||||
cp Makefile Makefile.mogilefsd
|
||||
$(ENV) DANGABUILD_MOGSTOREDONLY=1 perl Makefile.PL verbose INSTALLDIRS=vendor INST_SCRIPT=$(MOGSTOREDBLIB)
|
||||
cp Makefile Makefile.mogstored
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
|
||||
-$(MAKE) clean
|
||||
rm -f Makefile.old Makefile.mogilefsd Makefile.mogstored
|
||||
rm -rf $(MOGILEFSDBLIB) $(MOGSTOREDBLIB)
|
||||
dh_clean
|
||||
|
||||
install:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
$(MAKE) -f Makefile.mogilefsd PREFIX=$(CURDIR)/debian/$(MOGILEFSD_PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
|
||||
$(MAKE) -f Makefile.mogstored PREFIX=$(CURDIR)/debian/$(MOGSTORED_PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
|
||||
|
||||
#There is no test suite, so smoke-test here
|
||||
perl -c $(CURDIR)/mogilefsd
|
||||
perl -c $(CURDIR)/mogstored
|
||||
|
||||
install -d $(MOGILEFSD_CONFDIR)
|
||||
install -m 644 $(CURDIR)/conf/mogilefsd.conf $(MOGILEFSD_CONFDIR)/mogilefsd.conf.default
|
||||
|
||||
install -d $(MOGSTORED_CONFDIR)
|
||||
install -m 644 $(CURDIR)/conf/mogstored.conf $(MOGSTORED_CONFDIR)/mogstored.conf.default
|
||||
|
||||
-find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
|
||||
|
||||
binary-arch:;
|
||||
binary-indep: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installman
|
||||
dh_installdebconf
|
||||
dh_installinit
|
||||
dh_installchangelogs
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_perl
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
2
wcmtools/mogilefs/server/debian/watch
Executable file
2
wcmtools/mogilefs/server/debian/watch
Executable file
@@ -0,0 +1,2 @@
|
||||
version=2
|
||||
http://www.danga.com/dist/MogileFS/server/mogilefs-server-([0-9].*)\.tar.gz
|
||||
3037
wcmtools/mogilefs/server/mogilefsd
Executable file
3037
wcmtools/mogilefs/server/mogilefsd
Executable file
File diff suppressed because it is too large
Load Diff
198
wcmtools/mogilefs/server/mogstored
Executable file
198
wcmtools/mogilefs/server/mogstored
Executable file
@@ -0,0 +1,198 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
|
||||
if 0; # not running under some shell
|
||||
|
||||
#
|
||||
# MogileFS storage node daemon
|
||||
# (perlbal front-end)
|
||||
#
|
||||
# (c) 2004, Brad Fitzpatrick, <brad@danga.com>
|
||||
|
||||
use strict;
|
||||
use lib 'lib';
|
||||
use Perlbal;
|
||||
use Linux::AIO '1.3';
|
||||
use IO::Socket::INET;
|
||||
|
||||
my $opt_daemonize;
|
||||
my $opt_config;
|
||||
exit 1 unless
|
||||
Getopt::Long::GetOptions(
|
||||
'daemon' => \$opt_daemonize,
|
||||
'config=s' => \$opt_config,
|
||||
);
|
||||
|
||||
my $default_config = "/etc/mogilefs/mogstored.conf";
|
||||
$opt_config = $default_config if ! $opt_config && -e $default_config;
|
||||
|
||||
my $conf;
|
||||
if (-e $opt_config) {
|
||||
if (open F, $opt_config) {
|
||||
local $/ = undef;
|
||||
$conf = <F>;
|
||||
close F;
|
||||
} else {
|
||||
die "Couldn't open config file ($opt_config): $!\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $out = sub { print STDOUT join("\n", map { ref $_ eq 'ARRAY' ? @$_ : $_ } @_) . "\n"; };
|
||||
|
||||
my $path = "/var/mogdata";
|
||||
my $listen = "0.0.0.0:7500";
|
||||
|
||||
$conf ||= "
|
||||
SERVER max_connections = 10000
|
||||
CREATE SERVICE mogstored
|
||||
SET mogstored.role = web_server
|
||||
SET mogstored.listen = $listen
|
||||
SET mogstored.docroot = $path
|
||||
SET mogstored.dirindexing = 0
|
||||
SET mogstored.enable_put = 1
|
||||
SET mogstored.enable_delete = 1
|
||||
SET mogstored.min_put_directory = 1
|
||||
SET mogstored.persist_client = 1
|
||||
ENABLE mogstored
|
||||
";
|
||||
|
||||
Perlbal::run_manage_command($_, $out) foreach split(/\n/, $conf);
|
||||
|
||||
unless (Perlbal::Socket->WatchedSockets() > 0) {
|
||||
die "Invalid configuration. (shouldn't happen?) Stopping.\n";
|
||||
}
|
||||
|
||||
if ($opt_daemonize) {
|
||||
Perlbal::daemonize();
|
||||
} else {
|
||||
print "Running.\n";
|
||||
}
|
||||
|
||||
# register our disk usage callback to get disk usage and keep an eye on how we're doing
|
||||
Perlbal::Socket::register_callback(1, sub {
|
||||
my $err = sub { Perlbal::log('crit', $_[0]); return 60; };
|
||||
my $rval = `df -l`;
|
||||
foreach my $l (split /\r?\n/, $rval) {
|
||||
next unless $l =~ /^(.+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(.+)\s+(.+)$/;
|
||||
my ($dev, $total, $used, $avail, $use, $disk) = ($1, $2, $3, $4, $5, $6);
|
||||
next unless $disk =~ /^$path/;
|
||||
|
||||
# create string to print
|
||||
my $now = time;
|
||||
my $output = "time: $now\ndevice: $dev\ntotal: $total\nused: $used\navailable: $avail\nuse: $use\ndisk: $disk\n";
|
||||
|
||||
# open a file on that disk location called 'usage'
|
||||
my $rv = open(FILE, ">$disk/usage");
|
||||
unless ($rv) {
|
||||
$err->("Unable to open '$disk/usage' for writing: $!");
|
||||
next;
|
||||
}
|
||||
print FILE $output;
|
||||
close FILE;
|
||||
|
||||
}
|
||||
return 60;
|
||||
});
|
||||
|
||||
# setup a new socket for handling size requests
|
||||
my $server = IO::Socket::INET->new(LocalPort => 7501, # FIXME make this configurable
|
||||
Type => SOCK_STREAM,
|
||||
Proto => 'tcp',
|
||||
Blocking => 0,
|
||||
Reuse => 1,
|
||||
Listen => 10 )
|
||||
or die "Error creating socket: $@\n";
|
||||
|
||||
# in Perl 5.6, we weren't always seeing this turned off by IO::Socket
|
||||
# so we have to do it manually here just to be sure.
|
||||
IO::Handle::blocking($server, 0);
|
||||
|
||||
# accept handler for new workers
|
||||
my $accept_handler = sub {
|
||||
my $csock = $server->accept()
|
||||
or return;
|
||||
IO::Handle::blocking($csock, 0);
|
||||
my $client = SideChannelClient->new($csock);
|
||||
$client->watch_read(1);
|
||||
# ... that's it. Client->new adds to event loop.
|
||||
};
|
||||
|
||||
# add to fd list so this one gets processed
|
||||
Perlbal::Socket->AddOtherFds(fileno($server) => $accept_handler);
|
||||
|
||||
# now start the main loop
|
||||
Perlbal::run();
|
||||
|
||||
#############################################################################
|
||||
### simple package for handling the stream request port
|
||||
package SideChannelClient;
|
||||
|
||||
use base qw{Perlbal::Socket};
|
||||
use fields qw{count};
|
||||
|
||||
# needed since we're pretending to be a Perlbal::Socket... never idle out
|
||||
sub max_idle_time { return 0; }
|
||||
|
||||
sub new {
|
||||
my SideChannelClient $self = shift;
|
||||
$self = fields::new($self) unless ref $self;
|
||||
$self->SUPER::new(@_);
|
||||
$self->state('side_channel');
|
||||
$self->{count} = 0;
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub event_read {
|
||||
my SideChannelClient $self = shift;
|
||||
|
||||
my $bref = $self->read(1024);
|
||||
return $self->close() unless defined $bref;
|
||||
$self->{read_buf} .= $$bref;
|
||||
|
||||
while ($self->{read_buf} =~ s/^(.+?)\r?\n//) {
|
||||
my $cmd = $1;
|
||||
if ($cmd =~ /^size (\S+)$/) {
|
||||
# increase our count
|
||||
$self->{count}++;
|
||||
|
||||
# validate uri
|
||||
my $uri = $1;
|
||||
if ($uri =~ /\.\./) {
|
||||
$self->write("ERROR: uri invalid (contains ..)\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
# now stat the file to get the size and such
|
||||
Linux::AIO::aio_stat("$path$uri", sub {
|
||||
return if $self->{closed};
|
||||
my $size = -e _ ? -s _ : -1;
|
||||
$self->write("$uri $size\r\n");
|
||||
});
|
||||
} else {
|
||||
# we don't understand this so pass it on to manage command interface
|
||||
my @out;
|
||||
Perlbal::run_manage_command($cmd, sub { push @out, $_[0]; });
|
||||
$self->write(join("\r\n", @out) . "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# override Danga::Socket's event handlers which die
|
||||
sub event_err { $_[0]->close; }
|
||||
sub event_hup { $_[0]->close; }
|
||||
|
||||
# as_string handler
|
||||
sub as_string {
|
||||
my SideChannelClient $self = shift;
|
||||
|
||||
my $ret = $self->SUPER::as_string;
|
||||
$ret .= "; size_requests=$self->{count}";
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
# Local Variables:
|
||||
# mode: perl
|
||||
# c-basic-indent: 4
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
3
wcmtools/mogilefs/utils/MANIFEST
Executable file
3
wcmtools/mogilefs/utils/MANIFEST
Executable file
@@ -0,0 +1,3 @@
|
||||
MANIFEST
|
||||
Makefile.PL
|
||||
mogtool
|
||||
13
wcmtools/mogilefs/utils/MANIFEST.SKIP
Executable file
13
wcmtools/mogilefs/utils/MANIFEST.SKIP
Executable file
@@ -0,0 +1,13 @@
|
||||
^#
|
||||
\bCVS\b
|
||||
^MANIFEST\.
|
||||
^Makefile$
|
||||
~$
|
||||
\.html$
|
||||
\.old$
|
||||
^blib/
|
||||
_blib$
|
||||
^MakeMaker-\d
|
||||
^\.exists
|
||||
\bdebian\b
|
||||
\bconf\b
|
||||
33
wcmtools/mogilefs/utils/Makefile.PL
Executable file
33
wcmtools/mogilefs/utils/Makefile.PL
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use ExtUtils::MakeMaker;
|
||||
|
||||
my $exe_files;
|
||||
|
||||
foreach("mogtool", "mogadm")
|
||||
{
|
||||
push @$exe_files, $_ if -e;
|
||||
}
|
||||
|
||||
warn "No \$exe_files!" unless defined($exe_files);
|
||||
|
||||
WriteMakefile(
|
||||
NAME => 'MogileFS-Utils',
|
||||
VERSION => '1.00',
|
||||
AUTHOR => 'Brad Whitaker <whitaker@danga.com>',
|
||||
ABSTRACT => 'MogileFS client library',
|
||||
EXE_FILES => $exe_files,
|
||||
PREREQ_PM => {
|
||||
'LWP::Simple' => 0,
|
||||
'Compress::Zlib' => 0,
|
||||
},
|
||||
dist => {
|
||||
CI => "cvs commit",
|
||||
RCS_LABEL => 'cvs tag RELEASE_$(VERSION_SYM)',
|
||||
SUFFIX => ".gz",
|
||||
DIST_DEFAULT => 'all tardist',
|
||||
COMPRESS => "gzip",
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
20
wcmtools/mogilefs/utils/conf/mogtool.conf
Executable file
20
wcmtools/mogilefs/utils/conf/mogtool.conf
Executable file
@@ -0,0 +1,20 @@
|
||||
# Configuration for mogtool
|
||||
# See man mogtool(1p) for a description of options
|
||||
|
||||
trackers = 10.0.0.3:7001, 10.10.0.5/10.0.0.5:7001
|
||||
domain = mogiledomain
|
||||
class = fileclass
|
||||
|
||||
# Location of private MogileFS library
|
||||
#lib = /home/foo/lib
|
||||
|
||||
gzip = 1
|
||||
big = 1
|
||||
overwrite = 1
|
||||
chunksize = 32M
|
||||
|
||||
# Where receipts should go to
|
||||
# receipt = foo@bar.com, baz@bar.com
|
||||
verify = 1
|
||||
concurrent = 3
|
||||
|
||||
5
wcmtools/mogilefs/utils/debian/changelog
Executable file
5
wcmtools/mogilefs/utils/debian/changelog
Executable file
@@ -0,0 +1,5 @@
|
||||
mogilefs-utils (0.01-1) unstable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- Jay Bonci <jaybonci@debian.org> Thu, 20 Jan 2005 03:11:27 -0500
|
||||
1
wcmtools/mogilefs/utils/debian/compat
Executable file
1
wcmtools/mogilefs/utils/debian/compat
Executable file
@@ -0,0 +1 @@
|
||||
4
|
||||
13
wcmtools/mogilefs/utils/debian/control
Executable file
13
wcmtools/mogilefs/utils/debian/control
Executable file
@@ -0,0 +1,13 @@
|
||||
Source: mogilefs-utils
|
||||
Section: perl
|
||||
Priority: optional
|
||||
Maintainer: Jay Bonci <jaybonci@debian.org>
|
||||
Build-Depends-Indep: debhelper (>= 4.1.40), perl (>= 5.6.0-16), libcompress-zlib-perl, libwww-perl, libmogilefs-perl
|
||||
Standards-Version: 3.6.1.0
|
||||
|
||||
Package: mogilefs-utils
|
||||
Architecture: all
|
||||
Depends: ${perl:Depends}, libcompress-zlib-perl, libwww-perl, libmogilefs-perl
|
||||
Description: utilities to manipulate mogileFS filesystems
|
||||
The mogilefs-utils package contains tools to administrate and work with the
|
||||
mogileFS filesystem from Danga Interactive.
|
||||
25
wcmtools/mogilefs/utils/debian/copyright
Executable file
25
wcmtools/mogilefs/utils/debian/copyright
Executable file
@@ -0,0 +1,25 @@
|
||||
This package was debianized by Jay Bonci <jaybonci@debian.org> on
|
||||
Thu Jan 20 03:12:59 EST 2005
|
||||
|
||||
It was downloaded from: http://cvs.danga.com/browse.cgi/wcmtools/mogilefs/utils/mogtool
|
||||
|
||||
Upstream Authors:
|
||||
Brad Fitzpatrick <brad@danga.com>
|
||||
Mark Smith <marksmith@danga.com>
|
||||
|
||||
Copyright:
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of either:
|
||||
|
||||
a) the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 1, or (at your option) any
|
||||
later version, or
|
||||
|
||||
b) the "Artistic License"
|
||||
|
||||
See:
|
||||
|
||||
/usr/share/common-licenses/Artistic
|
||||
/usr/share/common-licenses/GPL
|
||||
|
||||
For more information regarding these licensing options
|
||||
9
wcmtools/mogilefs/utils/debian/mogilefs-utils.postinst
Executable file
9
wcmtools/mogilefs/utils/debian/mogilefs-utils.postinst
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -e /etc/mogilefs/ ]
|
||||
then
|
||||
mkdir -p /etc/mogilefs
|
||||
cp /usr/share/mogilefs-utils/mogtool.conf.default /etc/mogilefs/mogtool.conf
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
9
wcmtools/mogilefs/utils/debian/mogilefs-utils.postrm
Executable file
9
wcmtools/mogilefs/utils/debian/mogilefs-utils.postrm
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "purge" ]
|
||||
then
|
||||
rm -f /etc/mogilefs/mogtool.conf
|
||||
rmdir --ignore-fail-on-non-empty /etc/mogilefs
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
60
wcmtools/mogilefs/utils/debian/rules
Executable file
60
wcmtools/mogilefs/utils/debian/rules
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This is the debhelper compatibility version to use.
|
||||
# export DH_COMPAT=4
|
||||
|
||||
PACKAGE=`pwd | sed -e "s/.*\/\\(.*\\)-.*/\\1/"`
|
||||
SHAREDIR=$(CURDIR)/debian/$(PACKAGE)/usr/share/$(PACKAGE)
|
||||
|
||||
build:
|
||||
dh_testdir
|
||||
# Add here commands to compile the package.
|
||||
perl Makefile.PL verbose INSTALLDIRS=vendor
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
|
||||
-$(MAKE) clean
|
||||
rm -f Makefile.old
|
||||
dh_clean
|
||||
|
||||
install:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
$(MAKE) PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
|
||||
|
||||
# No tests, so we smoke test like this:
|
||||
perl -c mogtool
|
||||
|
||||
install -d $(SHAREDIR)
|
||||
install -m 644 conf/mogtool.conf $(SHAREDIR)/mogtool.conf.default
|
||||
|
||||
-find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
|
||||
|
||||
binary-arch:;
|
||||
binary-indep: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installman
|
||||
dh_installchangelogs
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_perl
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
1316
wcmtools/mogilefs/utils/mogtool
Executable file
1316
wcmtools/mogilefs/utils/mogtool
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user