N-Coder / studip-fuse

Python FUSE drive for courses and files available through the Stud.IP University Access Portal
GNU General Public License v3.0
20 stars 2 forks source link

log machine-readable status information #11

Closed N-Coder closed 5 years ago

N-Coder commented 6 years ago

Fixes #5, use tail and grep to wait for completed startup.

The result with the default logger configuration is:

$ cat .local/share/Stud.IP-Fuse/studip-status.txt
STARTING 0 0 -1109673712 9571 muster12 /home/muster/Stud.IP
INITIALIZING 0 0 0 9578 muster12 /home/muster/Stud.IP
READY 0 0 0 9578 muster12 /home/muster/Stud.IP
STOPPING 0 0 0 9578 muster12 /home/muster/Stud.IP
TERMINATED 0 0 0 9578 muster12 /home/muster/Stud.IP
...

The format is status fuse_get_context_uid fuse_get_context_gid fuse_get_context_pid os_process_id username mountpath. So, to wait for successfull startup use grep -q READY <(tail -f ~/.local/share/Stud.IP-Fuse/studip-status.txt) (see here for more details on the -q and timeouts) and use mountpoint /home/muster/Stud.IP to verify the mount afterwards.

N-Coder commented 5 years ago

Included in #13