Skip to content

Commit 63508fe

Browse files
committed
Fixed information in readme, added fsx-linux support.
2 parents 48e4e03 + c608cbe commit 63508fe

File tree

14 files changed

+242
-102
lines changed

14 files changed

+242
-102
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,4 @@ ENV/
9393
test_suite
9494
test_mount
9595
test_logs
96+
fsx-linux*

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ python:
3737
- "3.4"
3838
- "3.5"
3939
- "3.6"
40+
# - "3.7-dev"
4041

4142
# Install dependencies
4243
addons:

README.rst

Lines changed: 86 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -6,84 +6,96 @@
66
:target: https://travis-ci.org/pleiszenburg/loggedfs-python
77
:alt: Build Status: development branch
88

9-
|build_master| |build_develop|
10-
11-
LoggedFS-python - Filesystem monitoring with Fuse and Python
12-
============================================================
13-
14-
PROJECT STATUS NOTICE: **BETA** (UNDER DEVELOPMENT)
15-
---------------------------------------------------
16-
17-
FILESYSTEM PASSES `TEST SUITE FOR POSIX COMPLIANCE`_ - ALL OF IT.
18-
19-
A CUSTOM BUG-FIXED VERSION OF `FUSEPY`_ IS REQUIRED FOR FULL POSIX COMPLIANCE.
20-
IF THE LATEST OFFICIAL RELEASE OF FUSEPY IS USED INSTEAD, TIMESTAMPS WILL BE
21-
INACCURATE ON A NANOSECOND TO MICROSECOND SCALE.
22-
THERE IS A `PENDING PULL REQUEST`_.
23-
24-
THE FILESYSTEM HAS YET **NOT** BEEN **STRESS-TESTED**.
9+
.. |loggedfs_python_logo| image:: http://www.pleiszenburg.de/loggedfs-python_logo.png
10+
:target: https://github.com/pleiszenburg/loggedfs-python
11+
:alt: LoggedFS-python repository
2512

26-
THE FILESYSTEM IS CURRENTLY **ONLY** BEING DEVELOPED FOR AND TESTED ON **LINUX**.
27-
ANYONE INTERESTED IN ADDING MACOS AND/OR BSD SUPPORT?
28-
29-
.. _FUSEPY: https://github.com/s-m-e/fusepy
30-
.. _TEST SUITE FOR POSIX COMPLIANCE: https://github.com/pjd/pjdfstest
31-
.. _PENDING PULL REQUEST: https://github.com/terencehonles/fusepy/pull/76
32-
33-
Description
34-
-----------
13+
|build_master| |build_develop|
3514

36-
LoggedFS-python is a fuse-based filesystem which can log every operation that
37-
happens in it. It is a pure Python re-implementation of
38-
`LoggedFS`_ by `Rémi Flament`_ - heavily inspired by `Stavros Korokithakis`_'
39-
2013 blog post entitled "`Writing a FUSE filesystem in Python`_"
40-
(`source code repository`_).
15+
|loggedfs_python_logo|
4116

42-
How does it work?
17+
Synopsis
18+
========
4319

44-
Fuse does almost everything. LoggedFS-python only sends a message to ``syslog``
45-
when called by fuse and then let the real filesystem do the rest of the job.
20+
LoggedFS-python is a FUSE-based filesystem which can log every operation that happens in it.
21+
It is a pure Python re-implementation of `LoggedFS`_ by `Rémi Flament`_ maintaining CLI compatibility.
22+
The project is heavily inspired by `Stavros Korokithakis`_' 2013 blog post entitled
23+
"`Writing a FUSE filesystem in Python`_" (`source code repository`_).
24+
The filesystem is fully `POSIX`_ compliant (passing the `pjdfstest test-suite`_)
25+
and intended to be suitable for production systems (it is not yet!).
4626

4727
.. _LoggedFS: https://github.com/rflament/loggedfs
4828
.. _Rémi Flament: https://github.com/rflament
4929
.. _Stavros Korokithakis: https://github.com/skorokithakis
5030
.. _Writing a FUSE filesystem in Python: https://www.stavros.io/posts/python-fuse-filesystem/
5131
.. _source code repository: https://github.com/skorokithakis/python-fuse-sample
32+
.. _POSIX: https://en.wikipedia.org/wiki/POSIX
33+
.. _pjdfstest test-suite: https://github.com/pjd/pjdfstest
34+
35+
36+
CAVEATS
37+
=======
38+
39+
* PROJECT STATUS: **BETA**
40+
* THE FILESYSTEM HAS RECEIVED **SOME STRESS TESTS WITH FSX-LINUX**
41+
BASED ON THE `FSX-FLAVOR`_ RELEASED BY THE `LINUX TEST PROJECT`_.
42+
**FSX REPORTS WRITE HOLES!**
43+
FULL TESTS UND RELATED BUG-FIXES ARE UNDER WAY.
44+
* A `CUSTOM BUG-FIXED VERSION OF FUSEPY`_ IS REQUIRED FOR FULL POSIX COMPLIANCE.
45+
IF THE LATEST OFFICIAL RELEASE OF FUSEPY IS USED INSTEAD, TIMESTAMPS WILL BE
46+
INACCURATE ON A NANOSECOND TO MICROSECOND SCALE AND UTIME_NOW AS WELL AS
47+
UTIME_OMIT WILL NOT BE HONORED. THERE IS A `PENDING PULL REQUEST`_.
48+
* THE FILESYSTEM IS CURRENTLY **ONLY** BEING DEVELOPED FOR AND TESTED ON **LINUX**.
49+
ANYONE INTERESTED IN ADDING MAC OS X AND/OR BSD SUPPORT?
50+
51+
.. _FSX-FLAVOR: http://codemonkey.org.uk/projects/fsx/
52+
.. _LINUX TEST PROJECT: https://github.com/linux-test-project/ltp
53+
.. _CUSTOM BUG-FIXED VERSION OF FUSEPY: https://github.com/s-m-e/fusepy
54+
.. _PENDING PULL REQUEST: https://github.com/fusepy/fusepy/pull/79
55+
5256

5357
Installation
54-
------------
58+
============
5559

5660
.. code:: bash
5761
5862
pip install git+https://github.com/pleiszenburg/loggedfs-python.git@master
5963
60-
Simplest usage
61-
--------------
64+
This project has intentionally not yet been published in the `Python Package Index`_ (PyPI).
65+
It will be released on PyPI once critical changes have been merged into `fusepy`_,
66+
a dependency of LoggedFS-python.
6267

63-
To record access to ``/tmp/TEST`` into ``~/log.txt``, just do:
68+
**Supports Python 3.{4,5,6}.**
6469

65-
.. code:: bash
70+
**Supports Linux.**
71+
Support for MAC OS X and BSD likely requires minor changes only, but has yet not been added.
6672

67-
loggedfs -l ~/log.txt /tmp/TEST
73+
.. _Python Package Index: https://pypi.org/
74+
.. _fusepy: https://github.com/fusepy/fusepy
6875

69-
To stop recording, just unmount as usual:
76+
77+
Simple usage example
78+
====================
79+
80+
To start recording access to ``/tmp/TEST`` into ``/root/log.txt``, just do:
7081

7182
.. code:: bash
7283
73-
sudo umount /tmp/TEST
84+
sudo loggedfs -p -s -l /root/log.txt /tmp/TEST
7485
75-
``~/log.txt`` will need to be changed to readable by setting permissions:
86+
To stop recording, just unmount as usual:
7687

7788
.. code:: bash
7889
79-
chmod 0666 ~/log.txt
90+
sudo fusermount -u /tmp/TEST
91+
8092
8193
Configuration
82-
-------------
94+
=============
8395

8496
LoggedFS-python can use an XML configuration file if you want it to log
8597
operations only for certain files, for certain users, or for certain operations.
86-
The format is compatible with LoggedFS' original format.
98+
The format is fully compatible with LoggedFS' original format.
8799

88100
Here is a sample configuration file :
89101

@@ -105,39 +117,43 @@ Here is a sample configuration file :
105117
This configuration can be used to log everything except if it concerns a
106118
``*.bak`` file, or if the ``uid`` is 1000, or if the operation is ``getattr``.
107119

108-
Launching LoggedFS-python
109-
-------------------------
110120

111-
If you just want to test LoggedFS-python you don't need any configuration file.
121+
Need help?
122+
==========
112123

113-
Just use that command:
124+
Feel free to post questions in the `GitHub issue tracker`_ of this project.
114125

115-
.. code:: bash
126+
.. _GitHub issue tracker: https://github.com/pleiszenburg/loggedfs-python/issues
116127

117-
loggedfs -f -p /var
118128

119-
You should see logs like these:
129+
Bugs & issues
130+
=============
120131

121-
::
132+
Please report bugs in LoggedFS-python here in its `GitHub issue tracker`_.
122133

123-
tail -f /var/log/syslog
124-
2017-12-09 17:29:34,910 (loggedfs-python) LoggedFS-python running as a public filesystem
125-
2017-12-09 17:29:34,915 (loggedfs-python) LoggedFS-python not running as a daemon
126-
2017-12-09 17:29:34,920 (loggedfs-python) LoggedFS-python starting at /var
127-
2017-12-09 17:29:34,950 (loggedfs-python) chdir to /var
128-
2017-12-09 17:29:35,246 (loggedfs-python) getattr /var/ {SUCCESS} [ pid = 8700 kded [kdeinit] uid = 1000 ]
129-
2017-12-09 17:29:41,841 (loggedfs-python) getattr /var/ {SUCCESS} [ pid = 10923 ls uid = 1000 ]
130-
2017-12-09 17:29:41,858 (loggedfs-python) getattr /var/run {SUCCESS} [ pid = 10923 ls uid = 1000 ]
131-
2017-12-09 17:29:41,890 (loggedfs-python) getattr /var/run/nscd {FAILURE} [ pid = 10923 ls uid = 1000 ]
132-
2017-12-09 17:29:41,912 (loggedfs-python) readdir /var/ {SUCCESS} [ pid = 10923 ls uid = 1000 ]
133-
2017-12-09 17:29:41,987 (loggedfs-python) getattr /var/pouak {SUCCESS} [ pid = 10923 ls uid = 1000 ]
134134

135-
If you have a configuration file to use you should use this command:
135+
Miscellaneous
136+
=============
136137

137-
.. code:: bash
138+
- Full project documentation
139+
140+
- at `Read the Docs`_
141+
- at `LoggedFS-python repository`_
138142

139-
loggedfs -c loggedfs.xml -p /var
143+
- `License`_ (**Apache License 2.0**)
144+
- `Contributing`_ (**Contributions are highly welcomed!**)
145+
- `FAQ`_
146+
- `Authors`_
147+
- `Changes`_
148+
- `Long-term ideas`_
149+
- `Upstream issues`_ (relevant bugs in dependencies)
140150

141-
If you want to log what other users do on your filesystem, you should use the
142-
``-p`` option to allow them to see your mounted files. For a complete
143-
documentation see the manual page.
151+
.. _Read the Docs: http://loggedfs-python.readthedocs.io/en/latest/
152+
.. _LoggedFS-python repository: https://github.com/pleiszenburg/loggedfs-python/blob/master/docs/index.rst
153+
.. _License: https://github.com/pleiszenburg/loggedfs-python/blob/master/LICENSE
154+
.. _Contributing: https://github.com/pleiszenburg/loggedfs-python/blob/master/CONTRIBUTING.rst
155+
.. _FAQ: http://loggedfs-python.readthedocs.io/en/stable/faq.html
156+
.. _Authors: https://github.com/pleiszenburg/loggedfs-python/blob/master/AUTHORS.rst
157+
.. _Changes: https://github.com/pleiszenburg/loggedfs-python/blob/master/CHANGES.rst
158+
.. _Long-term ideas: https://github.com/pleiszenburg/loggedfs-python/milestone/2
159+
.. _Upstream issues: https://github.com/pleiszenburg/loggedfs-python/issues?q=is%3Aissue+is%3Aopen+label%3Aupstream

docs/examples.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Launching LoggedFS-python
2+
=========================
3+
4+
If you just want to test LoggedFS-python you don't need any configuration file.
5+
6+
Just use that command:
7+
8+
.. code:: bash
9+
10+
sudo loggedfs -s -f -p /var
11+
12+
You should see logs like these:
13+
14+
::
15+
16+
tail -f /var/log/syslog
17+
2017-12-09 17:29:34,910 (loggedfs-python) LoggedFS-python running as a public filesystem
18+
2017-12-09 17:29:34,915 (loggedfs-python) LoggedFS-python not running as a daemon
19+
2017-12-09 17:29:34,920 (loggedfs-python) LoggedFS-python starting at /var
20+
2017-12-09 17:29:34,950 (loggedfs-python) chdir to /var
21+
2017-12-09 17:29:35,246 (loggedfs-python) getattr /var/ {SUCCESS} [ pid = 8700 kded [kdeinit] uid = 1000 ]
22+
2017-12-09 17:29:41,841 (loggedfs-python) getattr /var/ {SUCCESS} [ pid = 10923 ls uid = 1000 ]
23+
2017-12-09 17:29:41,858 (loggedfs-python) getattr /var/run {SUCCESS} [ pid = 10923 ls uid = 1000 ]
24+
2017-12-09 17:29:41,890 (loggedfs-python) getattr /var/run/nscd {FAILURE} [ pid = 10923 ls uid = 1000 ]
25+
2017-12-09 17:29:41,912 (loggedfs-python) readdir /var/ {SUCCESS} [ pid = 10923 ls uid = 1000 ]
26+
2017-12-09 17:29:41,987 (loggedfs-python) getattr /var/pouak {SUCCESS} [ pid = 10923 ls uid = 1000 ]
27+
28+
If you have a configuration file to use you should use this command:
29+
30+
.. code:: bash
31+
32+
loggedfs -c loggedfs.xml -p /var
33+
34+
If you want to log what other users do on your filesystem, you should use the
35+
``-p`` option to allow them to see your mounted files. For a complete
36+
documentation see the manual page.

makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,19 @@ upload_test:
4444
install:
4545
pip install --process-dependency-links .[dev]
4646
make install_fstest
47+
make install_fsx
4748

4849
install_link:
4950
pip install --process-dependency-links -e .[dev]
5051
make install_fstest
52+
make install_fsx
5153

5254
install_fstest:
5355
python3 -c 'import sys; import os; sys.path.append(os.path.join(os.getcwd(), "tests")); import loggedfs_libtest; loggedfs_libtest.install_fstest()'
5456

57+
install_fsx:
58+
python3 -c 'import sys; import os; sys.path.append(os.path.join(os.getcwd(), "tests")); import loggedfs_libtest; loggedfs_libtest.install_fsx()'
59+
5560
mount:
5661
python3 -c 'import sys; import os; sys.path.append(os.path.join(os.getcwd(), "tests")); import loggedfs_libtest; loggedfs_libtest.quick_cli_mount()'
5762

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
# Development dependencies
6262
development_deps_list = [
63+
'coverage',
6364
'psutil',
6465
'pytest',
6566
'python-language-server',

src/loggedfs/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
@click.option(
5151
'-p',
5252
is_flag = True,
53-
help = 'Allow every users to see the new loggedfs.'
53+
help = 'Allow every user to see the new loggedfs.'
5454
)
5555
@click.option(
5656
'-c',

0 commit comments

Comments
 (0)