アスタリスクなど。 仮想ファイルシステム。 1歩後退するか2歩前進するか?

VoIP通信オペレーターのパート1パート2の近代化に関するプロジェクトへの参加を説明するために、見えなくなったタスクの1つは、アスタリスクサーバーの動作を視覚化および監視するための統合ツールの作成でした。 実際、このプロジェクトを離れた後、アスタリスク情報の表示をより便利な形にするという強迫観念は、アスタリスクで利用可能なすべての異種ツールの機能を組み合わせた統合仮想ファイルシステムのプロトタイプを作成するプロジェクトをもたらしました。







アスタリスクに対処した管理者の多くは、アスタリスクからデータを取得できるさまざまなコマンドの数にしばしば驚いたと思います。 サブスクライバデバイスのアカウント、認証のユーザー、チャネル、および仮想ファイルシステムの非標準的な使用について説明します。







データを取得するさまざまな方法について詳しく説明します。







最初は最も一般的です。







ピアリストのリクエスト
asterisk-macomnet*CLI> sip show peers Name/username Host Dyn Forcerport Comedia ACL Port Status Description Realtime 6001 (Unspecified) D Auto (No) No 0 Unmonitored person/person (Unspecified) D Auto (No) No 0 UNKNOWN 3 sip peers [Monitored: 0 online, 1 offline Unmonitored: 1 online, 1 offline]
      
      





ピアデータのリクエスト
 asterisk-macomnet*CLI> sip show peer 6001 * Name : 6001 Description : Realtime peer: No Secret : <Set> MD5Secret : <Not set> Remote Secret: <Not set> Context : web Record On feature : automon Record Off feature : automon Subscr.Cont. : <Not set> Language : ru Tonezone : <Not set> AMA flags : Unknown Transfer mode: open CallingPres : Presentation Allowed, Not Screened Callgroup : Pickupgroup : Named Callgr : Nam. Pickupgr: MOH Suggest : Mailbox : VM Extension : asterisk LastMsgsSent : 0/0 Call limit : 0 Max forwards : 0 Dynamic : Yes Callerid : "6001" <6001> MaxCallBR : 384 kbps Expire : -1 Insecure : no Force rport : Auto (No) Symmetric RTP: No ACL : No DirectMedACL : No T.38 support : No T.38 EC mode : Unknown T.38 MaxDtgrm: 4294967295 DirectMedia : No PromiscRedir : No User=Phone : No Video Support: No Text Support : No Ign SDP ver : No Trust RPID : No Send RPID : No Path support : No Path : N/A TrustIDOutbnd: Legacy Subscriptions: Yes Overlap dial : No DTMFmode : rfc2833 Timer T1 : 500 Timer B : 32000 ToHost : Addr->IP : (null) Defaddr->IP : (null) Prim.Transp. : UDP Allowed.Trsp : UDP,WS Def. Username: SIP Options : (none) Codecs : (gsm|g729|ulaw|alaw) Auto-Framing : No Status : Unmonitored Useragent : Reg. Contact : Qualify Freq : 60000 ms Keepalive : 0 ms Sess-Timers : Accept Sess-Refresh : uas Sess-Expires : 1800 secs Min-Sess : 90 secs RTP Engine : asterisk Parkinglot : Use Reason : No Encryption : Yes
      
      





ユーザーデータリクエスト
 asterisk-macomnet*CLI> sip show users Username Secret Accountcode Def.Context ACL Forcerport 6001 MegaPass12345 web No No person E346fz8Vam users_context No No asterisk-macomnet*CLI> sip show user 6001 * Name : 6001 Secret : <Set> MD5Secret : <Not set> Context : web Language : ru AMA flags : Unknown Tonezone : <Not set> Transfer mode: open MaxCallBR : 384 kbps CallingPres : Presentation Allowed, Not Screened Call limit : 0 Callgroup : Pickupgroup : Named Callgr : Nam. Pickupgr: Callerid : "6001" <6001> ACL : No Sess-Timers : Accept Sess-Refresh : uas Sess-Expires : 1800 secs Sess-Min-SE : 90 secs RTP Engine : asterisk Auto-Framing: No
      
      





おなじみのチームではないですか? そして、多くの人がほぼ毎日使用しています。 アスタリスクがオブジェクトのツリーを持っていることは、おそらく誰にも秘密ではありません。 アクセスはプロバイダーを通じて提供されます。 ツリーの情報は、以前見たものよりも充実しています。







 asterisk-macomnet*CLI> data show providers /asterisk/channel/iax2/peers (get) [chan_iax2.c] /asterisk/channel/iax2/users (get) [chan_iax2.c] /asterisk/channel/dahdi/version (get) [chan_dahdi.c] /asterisk/channel/dahdi/status (get) [chan_dahdi.c] /asterisk/channel/dahdi/channels (get) [chan_dahdi.c] /asterisk/channel/sip/peers (get) [chan_sip.c] /asterisk/core/hints (get) [pbx.c] /asterisk/core/channels (get) [channel.c] /asterisk/core/channeltypes (get) [channel.c] /asterisk/application/queue/list (get) [app_queue.c]
      
      





オブジェクトのツリーにアクセスすると、各オブジェクトに関する完全な情報を取得できます。







オブジェクトのツリーにアクセスすると、各オブジェクトに関する完全な情報を取得できます。
 asterisk-macomnet*CLI> data get /asterisk/channel/sip/peers peers peer vmexten: "asterisk" is_realtime: False amaflags text: "Unknown" value: 0 transports: "UDP,WS" inuse: 0 timer_t1: 500 callingpres text: "Presentation Allowed, Not Screened" value: 0 unsolicited_mailbox: "" host_dynamic: True subscribecontext: "" useragent: "" rtptimeout: 0 cid_num: "6001" mohinterpret: "default" parkinglot: "" mwi_from: "" call_limit: 0 fullcontact: "" rtpholdtimeout: 0 qualifyfreq: 60000 maxms: 0 rtpkeepalive: 0 allowtransfer text: "open" value: 0 regexten: "" onhold: 0 ringing: 0 fromdomain: "" timer_b: 32000 fromuser: "" username: "" secret: "MegaPass12345" accountcode: "" t38_maxdatagram: -1 remotesecret: "" md5secret: "" maxcallbitrate: 384 mohsuggest: "" lastms: 0 sipoptions sec_agree: False histinfo: False join: False resource-priority: False precondition: False eventlist: False outbound: False recipient-list-invite: False early-session: False recipient-list-subscribe: False sdp-anat: False 100rel: False replaces: False from-change: False replace: False gruu: False tdialog: False privacy: False norefersub: False timer: False path: False pref: False tohost: "" autoframing: False name: "6001" cid_name: "6001" language: "ru" context: "web" description: "" type: "friend" engine: "asterisk" codecs codec frame_length: 33 samplespersecond: 8000 name: "gsm" description: "GSM" codec frame_length: 10 samplespersecond: 8000 name: "g729" description: "G.729A" codec frame_length: 80 samplespersecond: 8000 name: "ulaw" description: "G.711 u-law" codec frame_length: 80 samplespersecond: 8000 name: "alaw" description: "G.711 a-law" peer vmexten: "asterisk" is_realtime: False amaflags text: "Unknown" value: 0 transports: "UDP,WS" inuse: 0 timer_t1: 500 callingpres text: "Presentation Allowed, Not Screened" value: 0 unsolicited_mailbox: "" host_dynamic: True subscribecontext: "" useragent: "" rtptimeout: 0 cid_num: "person" mohinterpret: "default" parkinglot: "" mwi_from: "" call_limit: 0 fullcontact: "" rtpholdtimeout: 0 qualifyfreq: 60000 maxms: 2000 rtpkeepalive: 0 allowtransfer text: "open" value: 0 regexten: "" onhold: 0 ringing: 0 fromdomain: "" timer_b: 32000 fromuser: "" username: "person" secret: "E346fz8Vam" accountcode: "" t38_maxdatagram: -1 remotesecret: "" md5secret: "" maxcallbitrate: 384 mohsuggest: "" lastms: 0 sipoptions sec_agree: False histinfo: False join: False resource-priority: False precondition: False eventlist: False outbound: False recipient-list-invite: False early-session: False recipient-list-subscribe: False sdp-anat: False 100rel: False replaces: False from-change: False replace: False gruu: False tdialog: False privacy: False norefersub: False timer: False path: False pref: False tohost: "" autoframing: False name: "person" cid_name: "person" language: "en" context: "users_context" description: "" type: "friend" engine: "asterisk" codecs codec frame_length: 33 samplespersecond: 8000 name: "gsm" description: "GSM" codec frame_length: 10 samplespersecond: 8000 name: "g729" description: "G.729A" codec frame_length: 80 samplespersecond: 8000 name: "ulaw" description: "G.711 u-law" codec frame_length: 80 samplespersecond: 8000 name: "alaw" description: "G.711 a-law"
      
      





「data get」コマンドの通常のドキュメントがないため、おそらくほとんどの人は知らないでしょうが、検索とフィールドのグループ化があります。







名前またはごちそうパラメーターで検索
 asterisk-macomnet*CLI> data get /asterisk/channel/sip/peers peers/peer/name=6001  asterisk-macomnet*CLI> data get /asterisk/channel/sip/peers peers/peer/secret=MegaPass12345 peers peer vmexten: "asterisk" is_realtime: False amaflags text: "Unknown" value: 0 transports: "UDP,WS" inuse: 0 timer_t1: 500 callingpres text: "Presentation Allowed, Not Screened" value: 0 unsolicited_mailbox: "" host_dynamic: True subscribecontext: "" useragent: "" rtptimeout: 0 cid_num: "6001" mohinterpret: "default" parkinglot: "" mwi_from: "" call_limit: 0 fullcontact: "" rtpholdtimeout: 0 qualifyfreq: 60000 maxms: 0 rtpkeepalive: 0 allowtransfer text: "open" value: 0 regexten: "" onhold: 0 ringing: 0 fromdomain: "" timer_b: 32000 fromuser: "" username: "" secret: "MegaPass12345" accountcode: "" t38_maxdatagram: -1 remotesecret: "" md5secret: "" maxcallbitrate: 384 mohsuggest: "" lastms: 0 sipoptions sec_agree: False histinfo: False join: False resource-priority: False precondition: False eventlist: False outbound: False recipient-list-invite: False early-session: False recipient-list-subscribe: False sdp-anat: False 100rel: False replaces: False from-change: False replace: False gruu: False tdialog: False privacy: False norefersub: False timer: False path: False pref: False tohost: "" autoframing: False name: "6001" cid_name: "6001" language: "ru" context: "web" description: "" type: "friend" engine: "asterisk" codecs codec frame_length: 33 samplespersecond: 8000 name: "gsm" description: "GSM" codec frame_length: 10 samplespersecond: 8000 name: "g729" description: "G.729A" codec frame_length: 80 samplespersecond: 8000 name: "ulaw" description: "G.711 u-law" codec frame_length: 80 samplespersecond: 8000 name: "alaw" description: "G.711 a-law"
      
      





ツリーからのデータのクエリは、パラメータフィルタリングをサポートしています。 この場合、検索パラメーターの値は「1 = 1」でなければなりません。上記のその他の検索条件は自動的に無視されます。







 asterisk-macomnet*CLI> data get /asterisk/channel/sip/peers 1=1 peers/peer/cid_num,peers/peer/name,peers/peer/username,peers/peer/secret,peers/peer/lastms,peers/peer/fullcontact peers peer cid_num: "6001" fullcontact: "sip:6001@192.168.200.247:5060" username: "" secret: "MegaPass12345" lastms: 0 name: "6001" peer cid_num: "person" fullcontact: "" username: "person" secret: "E346fz8Vam" lastms: 0 name: "person"
      
      





ツリーへのアクセスは非常に便利ですが、デフォルトのツリーには、構成ファイル内のハードエントリまたはキャッシュされたリアルタイム接続のエントリのみが含まれています。 完全なツリーを取得するには、すべてのリアルタイム接続のすべてのパラメーターをデータベースからダウンロードする必要があります。







リアルタイムピアデータの表示は、次のコマンドによって実行されます。







 asterisk-macomnet*CLI> sip show peer <name> load Usage: sip show peer <name> [load] Shows all details on one SIP peer and the current status. Option "load" forces lookup of peer in realtime storage.
      
      





残念ながら、データをダウンロードするには、何をダウンロードするかを知る必要があります。







 asterisk-macomnet*CLI> realtime load sippeers name zhecka Usage: realtime load <family> <colmatch> <value> Prints out a list of variables using the RealTime driver. You must supply a family name, a column to match on, and a value to match to.
      
      





ここにあるように、リアルタイムの接続データをダウンロードするには、何をロードするかを知る必要もあります。 しかし、汚いハックがあります。 colmatchおよびvalueパラメーターは、そのままSQLプロバイダーに渡されます。 したがって、「リアルタイムロードsippeers 1 1」という形式のリクエストを作成し、1つのリクエストですべてのデータを取得できます。







リアルタイムロードシッパー1 1
 asterisk-macomnet*CLI> realtime load sippeers 1 1 Column Name Column Value -------------------- -------------------- dtlssetup actpass id 1325 name zhecka ipaddr port 0 regseconds 0 defaultuser zhecka fullcontact regserver useragent lastms 0 host dynamic type friend context web permit deny secret zhecka md5secret remotesecret transport udp,tcp dtmfmode directmedia no nat callgroup pickupgroup language disallow allow insecure trustrpid progressinband promiscredir useclientcode accountcode setvar callerid amaflags callcounter busylevel allowoverlap allowsubscribe videosupport maxcallbitrate rfc2833compensate mailbox session-timers session-expires session-minse session-refresher t38pt_usertpsource regexten fromdomain fromuser qualify defaultip rtptimeout rtpholdtimeout sendrpid outboundproxy callbackextension timert1 timerb qualifyfreq constantssrc contactpermit contactdeny usereqphone textsupport faxdetect buggymwi auth fullname trunkname cid_number callingpres mohinterpret mohsuggest parkinglot hasvoicemail subscribemwi vmexten autoframing rtpkeepalive call-limit g726nonstandard ignoresdpversion allowtransfer dynamic path supportpath encryption no avpf yes force_avp yes icesupport yes dtlsenable yes dtlsverify fingerprint dtlscertfile /usr/local/share/asterisk/keys/cert.crt dtlsprivatekey /usr/local/share/asterisk/keys/private.pem dtlscafile /usr/local/share/asterisk/keys/ca.crt dtlssetup actpass id 1327 name zhecka1 ipaddr port regseconds defaultuser zhecka1 fullcontact regserver useragent lastms host dynamic type friend context web permit deny secret md5secret remotesecret transport ws dtmfmode directmedia no nat callgroup pickupgroup language disallow allow insecure trustrpid progressinband promiscredir useclientcode accountcode setvar callerid amaflags callcounter busylevel allowoverlap allowsubscribe videosupport maxcallbitrate rfc2833compensate mailbox session-timers session-expires session-minse session-refresher t38pt_usertpsource regexten fromdomain fromuser qualify defaultip rtptimeout rtpholdtimeout sendrpid outboundproxy callbackextension timert1 timerb qualifyfreq constantssrc contactpermit contactdeny usereqphone textsupport faxdetect buggymwi auth fullname trunkname cid_number callingpres mohinterpret mohsuggest parkinglot hasvoicemail subscribemwi vmexten autoframing rtpkeepalive call-limit g726nonstandard ignoresdpversion allowtransfer dynamic path supportpath encryption yes avpf yes force_avp yes icesupport yes dtlsenable yes dtlsverify fingerprint dtlscertfile /usr/local/share/asterisk/keys/cert.crt dtlsprivatekey /usr/local/share/asterisk/keys/private.pem dtlscafile /usr/local/share/asterisk/keys/ca.crt dtlssetup actpass
      
      





このクエリは、データベース内にあるすべてのリアルタイムピアを表示します。

次に、各ピアに対してコマンドを実行する必要があります







sip show peer zhecka load
 asterisk-macomnet*CLI> sip show peer zhecka load * Name : zhecka Description : Realtime peer: Yes, cached Secret : <Set> MD5Secret : <Not set> Remote Secret: <Not set> Context : web Record On feature : automon Record Off feature : automon Subscr.Cont. : <Not set> Language : ru Tonezone : <Not set> AMA flags : Unknown Transfer mode: open CallingPres : Presentation Allowed, Not Screened Callgroup : Pickupgroup : Named Callgr : Nam. Pickupgr: MOH Suggest : Mailbox : VM Extension : asterisk LastMsgsSent : 0/0 Call limit : 0 Max forwards : 0 Dynamic : Yes Callerid : "" <> MaxCallBR : 384 kbps Expire : 120 Insecure : no Force rport : Auto (No) Symmetric RTP: No ACL : No DirectMedACL : No T.38 support : No T.38 EC mode : Unknown T.38 MaxDtgrm: 4294967295 DirectMedia : No PromiscRedir : No User=Phone : No Video Support: No Text Support : No Ign SDP ver : No Trust RPID : No Send RPID : No Path support : No Path : N/A TrustIDOutbnd: Legacy Subscriptions: Yes Overlap dial : No DTMFmode : rfc2833 Timer T1 : 500 Timer B : 32000 ToHost : Addr->IP : (null) Defaddr->IP : (null) Prim.Transp. : UDP Allowed.Trsp : UDP,TCP Def. Username: zhecka SIP Options : (none) Codecs : (ulaw|alaw|gsm|h263) Auto-Framing : No Status : Unmonitored Useragent : Reg. Contact : Qualify Freq : 60000 ms Keepalive : 0 ms Sess-Timers : Accept Sess-Refresh : uas Sess-Expires : 1800 secs Min-Sess : 90 secs RTP Engine : asterisk Parkinglot : Use Reason : No Encryption : No
      
      





これらの操作の後、現在「オフライン」になっているピア「zhecka」のリアルタイムレコードが内部データツリーに表示されます。







 asterisk-macomnet*CLI> data get /asterisk/channel/sip/peers 1=1 peers/peer/cid_num,peers/peer/name,peers/peer/username,peers/peer/secret,peers/peer/lastms,peers/peer/fullcontact peers peer cid_num: "" fullcontact: "" username: "zhecka" secret: "zhecka" lastms: 4294967295 name: "zhecka" peer cid_num: "6001" fullcontact: "" username: "" secret: "MegaPass12345" lastms: 0 name: "6001" peer cid_num: "person" fullcontact: "" username: "person" secret: "E346fz8Vam" lastms: 0 name: "person"
      
      





提示されたシーケンスからわかるように、データを取得するには、リアルタイムで利用可能な各ピアに対していくつかの異なる操作を行う必要があります。







おそらくあなたの多くは、「RESTがあります!それを使用してください!」と言うでしょう。

「はい。RESTがあります。しかし、それはかなり弱く、必要な情報を提供しません」

RESTリクエストの出力http:// localhost:8088 / ari / endpoints / SIP







 [ { "technology": "SIP", "resource": "person", "state": "unknown", "channel_ids": [] }, { "technology": "SIP", "resource": "mtrf", "state": "unknown", "channel_ids": [] }, { "technology": "SIP", "resource": "6001", "state": "unknown", "channel_ids": [] } ]
      
      





残念ながら、出力には必須フィールドがありません。それらを追加するには、RESTモジュールを書き換えるか、追加する必要があります。







では、何が提案されていますか? また、devfs / procfsの方法でアスタリスクツリーをファイルシステムに転送し、すべての設定を1か所で追跡することが提案されています。







こんな感じです。







 # tree /mnt /mnt ├── config -> /usr/local/etc/asterisk ├── peers │  ├── iax2 │  │  ├── corbina │  │  │  └── full │  │  └── msm │  │  └── full │  └── sip │  ├── _offline │  │  └── mtrf -> ../mtrf │  ├── _online │  └── mtrf │  ├── codecs │  ├── contexts │  ├── credentials │  ├── full │  └── huntgroups └── users ├── iax2 │  └── macomnet │  └── full ├── sipfriends │  ├── 6001 │  │  ├── codecs │  │  ├── contexts │  │  ├── credentials │  │  ├── full │  │  └── huntgroups │  ├── _offline │  │  ├── 6001 -> ../6001 │  │  └── person -> ../person │  ├── _online │  │  └── zhecka -> ../zhecka │  ├── person │  │  ├── codecs │  │  ├── contexts │  │  ├── credentials │  │  ├── full │  │  └── huntgroups │  └── zhecka │  ├── codecs │  ├── contexts │  ├── credentials │  ├── full │  └── huntgroups └── sipusers ├── _offline │  └── zhecka1 -> ../zhecka1 ├── _online └── zhecka1 ├── codecs ├── contexts ├── credentials ├── full └── huntgroups
      
      





これは、アスタリスクテストサーバーファイルシステムの実際のキャストです。 出力データのフォーマットには制限がないため、接続のパラメーターの出力は次のようになります。







 # cat /mnt/users/sipfriends/_online/zhecka/credentials name=zhecka username=zhecka secret=zhecka md5secret= fromuser= fromdomain= cid_name= remotesecret= fullcontact=sip:zhecka@10.6.207.135:64802;transport=udp;rinstance=d42eec40501a7c4d useragent=Bria release 2.5 RC4 stamp 47242 regexten= transports=UDP,TCP
      
      





またはコンテキスト







 # cat /mnt/users/sipfriends/_online/zhecka/contexts context=web subscribecontext=
      
      





このすべてのデータは、デバイスの切断/接続中に、リアルタイムで、またはアスタリスクイベントの処理時に最小限の遅延で取得されます。







どのように機能しますか? AstFSはPythonで記述され、Fuseライブラリを使用します。







Fuseライブラリでは、ファイルシステムからの対応する各イベント(open、readdir、getattr、closeなど)が、着信データを処理してユーザーの最終データを形成するプロシージャを呼び出すことができます。







Fuseライブラリには、ほとんどのイベントベースのライブラリと同様に内部ループがあるため、外部プログラムから外部プログラムにデータを転送することは非常に困難です。 共有オブジェクトまたはパイプが機能する必要があります。







TCP / UDPソケットパイプなどを使用するという観点から、データ配信を提供するサーバーまたはデーモンに障害が発生した場合、ファイルシステムへの要求は制御不能にハングします。 繰り返しになりますが、内部ループのため、ライブラリはツイストのような非同期フレームワークに正しく実装できません(少なくとも成功しませんでした)。 スレッディングを介してすべてを取得しようとすると、さまざまな問題が発生し、このアイデアを放棄しなければなりませんでした。 プロシージャから直接アスタリスクへの接続を呼び出すと、最も大きなオーバーヘッドが発生しました。 「くしゃみ」ごとに、AMIへの新しい接続を開く必要がありました。







多かれ少なかれ通常の解決策は、ファイルシステムへのリクエストを処理するプロセスと、 マルチプロセッシングを使用してアスタリスクからデータを受信するプロセスを分離することでした。 このコンポーネントには、生成されたプロセスを制御する機能があり、プロセス間で操作できるオブジェクトもあります。







したがって、システムは3つのプロセスで構成されます。









それらの間には、JSON「rummages」でパックされた一般的な辞書があります。 事実は、共有オブジェクトはpython構造とは異なる構造を持ち、それらと互換性がないということです。 アスタリスクからのデータを更新するとき、このディクショナリは解凍され、更新されてからパックされます。







したがって、ファイルシステムからの要求を処理するプロセスは、必要に応じて辞書を解凍し、ユーザーの最終データを生成します。







AstFSソースコードには、すべての必要なクラスと、仮想ファイルシステムを作成するための例が含まれています。 もちろん、コードは理想とはほど遠いですが、可能であれば修正する予定です(ロシア語のコメントがあります)。







主な重点は、ファイルシステム構造の柔軟性に置かれました。







柔軟性とは、クラスまたは関数、または静的データのみをツリーまたはファイルブランチのハンドラーとして使用できることを意味します。







ツリーの定義は非常に簡単です。







  root = { 'helpfilefunc': [fsstruct.stat_info['file'], fusefscore.returnhelp], 'link_to_tmp': [fsstruct.stat_info['link'], '/tmp'], 'staticfile': [fsstruct.stat_info['file'], 'contents of staticfile'], 'customchmodfile': [{'st_mode': 0x8000 | int('0600', 8), 'st_uid': 0, 'st_gid': 0}, 'contents of customchmodfile'], 'nulldir': {}, 'nullfile': [{}, ''], 'demotreeclass': fsstruct.BasicTree('/demotreeclass', mpd, ''), 'tree': {'peer': [{'st_mode': 0x8000 | int('0644', 8)}, 'contents of peer'], 'friend': {}, 'user': {}} }
      
      





 # tree -ghpu /mnt/ /mnt/ ├── [-rw------- root wheel 27] customchmodfile ├── [drwxr-xr-x asterisk asterisk 512] demotreeclass │ ├── [-rw-r--r-- asterisk asterisk 12] help │ └── [-rw-r--r-- asterisk asterisk 12] info ├── [-rw-r--r-- asterisk asterisk 33] helpfilefunc ├── [lrwxr-xr-x asterisk asterisk 4] link_to_tmp -> /tmp ├── [drwxr-xr-x asterisk asterisk 512] nulldir ├── [-rw-r--r-- asterisk asterisk 0] nullfile ├── [-rw-r--r-- asterisk asterisk 22] staticfile └── [drwxr-xr-x asterisk asterisk 512] tree ├── [drwxr-xr-x asterisk asterisk 512] friend ├── [-rw-r--r-- asterisk asterisk 16] peer └── [drwxr-xr-x asterisk asterisk 512] user 6 directories, 7 files
      
      





ファイルを定義する必要がある場合は、2つのパラメーターで構成される配列(リスト)を指定するだけです。 1つ目はファイルのタイプとそのファイルへのアクセス権、2つ目はファイルの静的コンテンツ、またはファイルのコンテンツを返す関数の名前です。 ディレクトリを定義する必要がある場合は、辞書(dict)を定義するだけで、ファイルのリストまたはディレクトリのリストが含まれます。 動的に変化する構造が存在するディレクトリを決定するとき、すべてのファイルシステム要求を処理するサブクラスを指定できます。







実際、クラスの基本的な機能については、4つのメソッドを記述するだけで十分です。









実装の機能について詳しく見ていきましょう。







getattrはファイルまたはディレクトリのタイプを決定するために呼び出され、属性のみを返します! このメソッドから他の情報は取得されません。







readdirは、ディレクトリを開いてファイルを要求するときに呼び出され、属性のないディレクトリ内のファイルのリストのみを返します!







通常のファイルリスト呼び出し







 # ls /mnt customchmodfile demotreeclass helpfilefunc link_to_tmp nulldir nullfile staticfile tree
      
      





次のシーケンスが発生します







ファイルリストリクエスト
 2017-03-14 13:13:04,559 - DEBUG - [FuseFSCore.getattr] path / fh None. Context: {'gid': 0, 'pid': 99276, 'uid': 0} 2017-03-14 13:13:04,559 - DEBUG - [FuseFSCore.returntree] Instance Dict > retdict: {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} 2017-03-14 13:13:04,560 - DEBUG - [FuseFSCore.getattr] Found data {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} for path / 2017-03-14 13:13:04,560 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object / is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 9, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:13:04,561 - DEBUG - [FuseFSCore.statfs] Request FileSystem Info. Context: {'gid': 0, 'pid': 99276, 'uid': 0} 2017-03-14 13:13:04,561 - DEBUG - [FuseFSCore.readdir] Path /:0. Context: {'gid': 0, 'pid': 99276, 'uid': 0} 2017-03-14 13:13:04,562 - DEBUG - [FuseFSCore.returntree] Instance Dict > retdict: {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} 2017-03-14 13:13:04,562 - DEBUG - [FuseFSCore.readdir] Found data {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} for path / 2017-03-14 13:13:04,562 - DEBUG - [FuseFSCore.readdir] SrcTree: {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []}, DirTree: <type 'dict'>:{'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []}
      
      







ファイルを開いてみましょう







ファイルを開く
 2017-03-14 13:26:45,137 - DEBUG - [FuseFSCore.open] /staticfile:0. Context: {'gid': 0, 'pid': 99297, 'uid': 0} 2017-03-14 13:26:45,138 - DEBUG - [FuseFSCore.getattr] path /staticfile fh None. Context: {'gid': 0, 'pid': 99297, 'uid': 0} 2017-03-14 13:26:45,139 - DEBUG - [FuseFSCore.returntree] Instance List > itemstat:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,139 - DEBUG - [FuseFSCore.returntree] data: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] 2017-03-14 13:26:45,140 - DEBUG - [FuseFSCore.getattr] Found data [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] for path /staticfile 2017-03-14 13:26:45,140 - DEBUG - [FuseFSCore.getattr] List <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 22, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,140 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /staticfile is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 22, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,141 - DEBUG - [FuseFSCore.read] read file /staticfile:4096:0. Context: {'gid': 0, 'pid': 99297, 'uid': 0} 2017-03-14 13:26:45,141 - DEBUG - [FuseFSCore.returntree] Instance List > itemstat:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,142 - DEBUG - [FuseFSCore.returntree] data: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] 2017-03-14 13:26:45,142 - DEBUG - [FuseFSCore.read] dirtree data [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] for path /staticfile 2017-03-14 13:26:45,142 - DEBUG - [FuseFSCore.read] FoundTree: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] 2017-03-14 13:26:45,143 - DEBUG - [FuseFSCore.read] read file /staticfile:4096:22. Context: {'gid': 0, 'pid': 99297, 'uid': 0} 2017-03-14 13:26:45,143 - DEBUG - [FuseFSCore.returntree] Instance List > itemstat:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,143 - DEBUG - [FuseFSCore.returntree] data: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] 2017-03-14 13:26:45,143 - DEBUG - [FuseFSCore.read] dirtree data [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] for path /staticfile 2017-03-14 13:26:45,144 - DEBUG - [FuseFSCore.read] FoundTree: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] 2017-03-14 13:26:45,144 - DEBUG - [FuseFSCore.truncate] /staticfile:22:None. Context: {'gid': 0, 'pid': 99297, 'uid': 0} 2017-03-14 13:26:45,144 - DEBUG - [FuseFSCore.getattr] path /staticfile fh None. Context: {'gid': 0, 'pid': 99297, 'uid': 0} 2017-03-14 13:26:45,144 - DEBUG - [FuseFSCore.returntree] Instance List > itemstat:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,144 - DEBUG - [FuseFSCore.returntree] data: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] 2017-03-14 13:26:45,145 - DEBUG - [FuseFSCore.getattr] Found data [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, 'contents of staticfile'] for path /staticfile 2017-03-14 13:26:45,145 - DEBUG - [FuseFSCore.getattr] List <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 22, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,145 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /staticfile is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 33188, 'st_dev': 0, 'st_size': 22, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:26:45,145 - DEBUG - [FuseFSCore.release] /staticfile:0. Context: {'gid': 0, 'pid': 99297, 'uid': 0}
      
      





.









. ?







/mnt/demotreeclass ,

fsstruct.BasicTree .







 2017-03-14 13:29:16,819 - DEBUG - [FuseFSCore.getattr] path /demotreeclass fh None. Context: {'gid': 0, 'pid': 99300, 'uid': 0} 2017-03-14 13:29:16,819 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:29:16,819 - DEBUG - [BasicTree._getattr] started for path 2017-03-14 13:29:16,820 - DEBUG - [BasicTree._getattr] path len 1, path [''] 2017-03-14 13:29:16,820 - DEBUG - [BasicTree._getattr] return full tree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:29:16,820 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:29:16,821 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:29:16,821 - DEBUG - [FuseFSCore.statfs] Request FileSystem Info. Context: {'gid': 0, 'pid': 99300, 'uid': 0} 2017-03-14 13:29:16,822 - DEBUG - [FuseFSCore.readdir] Path /demotreeclass:0. Context: {'gid': 0, 'pid': 99300, 'uid': 0} 2017-03-14 13:29:16,822 - DEBUG - [FuseFSCore.readdir] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:29:16,822 - DEBUG - [BasicTree._readdir] path len 1, path [''] 2017-03-14 13:29:16,822 - DEBUG - [BasicTree._readdir] return full tree {'info': {}, 'help': {}} 2017-03-14 13:29:16,822 - DEBUG - [FuseFSCore.readdir] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'info': {}, 'help': {}} 2017-03-14 13:29:16,822 - DEBUG - [FuseFSCore.readdir] SrcTree: <astfs.fsstruct.BasicTree object at 0x8058fe210>, DirTree: <type 'dict'>:{'info': {}, 'help': {}}
      
      





, , , , — . .







-







 # ls -al /mnt/demotreeclass total 2 drwxr-xr-x 1 asterisk asterisk 512 14  11:10 . drwxr-xr-x 9 asterisk asterisk 512 14  11:10 .. -rw-r--r-- 1 asterisk asterisk 12 14  11:10 help -rw-r--r-- 1 asterisk asterisk 12 14  11:10 info
      
      





 2017-03-14 13:40:46,539 - DEBUG - [FuseFSCore.getattr] path /demotreeclass fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,540 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:40:46,540 - DEBUG - [BasicTree._getattr] started for path 2017-03-14 13:40:46,540 - DEBUG - [BasicTree._getattr] path len 1, path [''] 2017-03-14 13:40:46,540 - DEBUG - [BasicTree._getattr] return full tree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,541 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,541 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:40:46,541 - DEBUG - [FuseFSCore.statfs] Request FileSystem Info. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,542 - DEBUG - [FuseFSCore.getattr] path /demotreeclass fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,542 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:40:46,542 - DEBUG - [BasicTree._getattr] started for path 2017-03-14 13:40:46,542 - DEBUG - [BasicTree._getattr] path len 1, path [''] 2017-03-14 13:40:46,543 - DEBUG - [BasicTree._getattr] return full tree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,543 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,543 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:40:46,543 - DEBUG - [FuseFSCore.readdir] Path /demotreeclass:0. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,544 - DEBUG - [FuseFSCore.readdir] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:40:46,544 - DEBUG - [BasicTree._readdir] path len 1, path [''] 2017-03-14 13:40:46,544 - DEBUG - [BasicTree._readdir] return full tree {'info': {}, 'help': {}} 2017-03-14 13:40:46,544 - DEBUG - [FuseFSCore.readdir] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'info': {}, 'help': {}} 2017-03-14 13:40:46,545 - DEBUG - [FuseFSCore.readdir] SrcTree: <astfs.fsstruct.BasicTree object at 0x8058fe210>, DirTree: <type 'dict'>:{'info': {}, 'help': {}} 2017-03-14 13:40:46,545 - DEBUG - [FuseFSCore.getattr] path /demotreeclass fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,545 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:40:46,545 - DEBUG - [BasicTree._getattr] started for path 2017-03-14 13:40:46,546 - DEBUG - [BasicTree._getattr] path len 1, path [''] 2017-03-14 13:40:46,546 - DEBUG - [BasicTree._getattr] return full tree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,546 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,546 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:40:46,546 - DEBUG - [FuseFSCore.getattr] path /demotreeclass fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,547 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:40:46,547 - DEBUG - [BasicTree._getattr] started for path 2017-03-14 13:40:46,547 - DEBUG - [BasicTree._getattr] path len 1, path [''] 2017-03-14 13:40:46,547 - DEBUG - [BasicTree._getattr] return full tree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,547 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,548 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:40:46,548 - DEBUG - [FuseFSCore.getattr] path / fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,548 - DEBUG - [FuseFSCore.returntree] Instance Dict > retdict: {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} 2017-03-14 13:40:46,548 - DEBUG - [FuseFSCore.getattr] Found data {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} for path / 2017-03-14 13:40:46,549 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object / is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 9, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:40:46,549 - DEBUG - [FuseFSCore.getattr] path / fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,549 - DEBUG - [FuseFSCore.returntree] Instance Dict > retdict: {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} 2017-03-14 13:40:46,549 - DEBUG - [FuseFSCore.getattr] Found data {'nullfile': [], 'demotreeclass': [], '__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}], 'link_to_tmp': [], 'helpfilefunc': [], 'tree': [], 'nulldir': [], 'customchmodfile': [], 'staticfile': []} for path / 2017-03-14 13:40:46,549 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object / is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 9, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:40:46,550 - DEBUG - [FuseFSCore.getattr] path /demotreeclass/info fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,550 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass/info 2017-03-14 13:40:46,550 - DEBUG - [BasicTree._getattr] started for path info 2017-03-14 13:40:46,550 - DEBUG - [BasicTree._getattr] path len 1, path ['info'] 2017-03-14 13:40:46,550 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 0, 'st_ino': 0, 'st_uid': 931, 'st_mode': 33188, 'st_atime': 1489479051}, <bound method BasicTree._getfile of <astfs.fsstruct.BasicTree object at 0x8058fe210>>] 2017-03-14 13:40:46,550 - DEBUG - [BasicTree._getfile] started for path info 2017-03-14 13:40:46,550 - DEBUG - [FuseFSCore.getattr] List <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 12, 'st_ino': 0, 'st_uid': 931, 'st_mode': 33188, 'st_atime': 1489479051} 2017-03-14 13:40:46,551 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass/info is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 12, 'st_ino': 0, 'st_uid': 931, 'st_mode': 33188, 'st_atime': 1489479051} 2017-03-14 13:40:46,551 - DEBUG - [FuseFSCore.getattr] path /demotreeclass/help fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,551 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass/help 2017-03-14 13:40:46,551 - DEBUG - [BasicTree._getattr] started for path help 2017-03-14 13:40:46,551 - DEBUG - [BasicTree._getattr] path len 1, path ['help'] 2017-03-14 13:40:46,552 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 0, 'st_ino': 0, 'st_uid': 931, 'st_mode': 33188, 'st_atime': 1489479051}, <bound method BasicTree._getfile of <astfs.fsstruct.BasicTree object at 0x8058fe210>>] 2017-03-14 13:40:46,552 - DEBUG - [BasicTree._getfile] started for path help 2017-03-14 13:40:46,552 - DEBUG - [FuseFSCore.getattr] List <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 12, 'st_ino': 0, 'st_uid': 931, 'st_mode': 33188, 'st_atime': 1489479051} 2017-03-14 13:40:46,552 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass/help is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 12, 'st_ino': 0, 'st_uid': 931, 'st_mode': 33188, 'st_atime': 1489479051} 2017-03-14 13:40:46,553 - DEBUG - [FuseFSCore.getattr] path /demotreeclass fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,554 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:40:46,554 - DEBUG - [BasicTree._getattr] started for path 2017-03-14 13:40:46,554 - DEBUG - [BasicTree._getattr] path len 1, path [''] 2017-03-14 13:40:46,554 - DEBUG - [BasicTree._getattr] return full tree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,554 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,554 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051} 2017-03-14 13:40:46,554 - DEBUG - [FuseFSCore.getattr] path /demotreeclass fh None. Context: {'gid': 0, 'pid': 99321, 'uid': 0} 2017-03-14 13:40:46,555 - DEBUG - [FuseFSCore.getattr] Found data <astfs.fsstruct.BasicTree object at 0x8058fe210> for path /demotreeclass 2017-03-14 13:40:46,555 - DEBUG - [BasicTree._getattr] started for path 2017-03-14 13:40:46,555 - DEBUG - [BasicTree._getattr] path len 1, path [''] 2017-03-14 13:40:46,555 - DEBUG - [BasicTree._getattr] return full tree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,555 - DEBUG - [FuseFSCore.getattr] Object <astfs.fsstruct.BasicTree object at 0x8058fe210> return dirtree {'__dirstat__': [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}, '']} 2017-03-14 13:40:46,555 - DEBUG - [FuseFSCore.getattr] Attrstat Result for object /demotreeclass is <type 'dict'>:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_gid': 931, 'st_dev': 0, 'st_size': 512, 'st_ino': 0, 'st_uid': 931, 'st_mode': 16877, 'st_atime': 1489479051}
      
      





, , .







, , . "" .







(symlink)







 # ls /mnt/link_to_tmp .ICE-unix aguilera.ulaw crontab.B0fGYRPx73~ macroform-the_simplicity.wav mycachedir pymp-Ri0pXJ pymp-eysf7M socket .X11-unix cachedir crontab.SyEoUZMExj~ manolo_camp-morning_coffee.ulaw mysql.sock pymp-SZfCWa pymp-hH6kLC treecache .XIM-unix crontab.1yo8gxs5HE~ errlog manolo_camp-morning_coffee.wav pymp-6oVKsj
      
      





symlink
 2017-03-14 13:47:55,593 - DEBUG - [FuseFSCore.readlink] path: /link_to_tmp. Context: {'gid': 0, 'pid': 99341, 'uid': 0} 2017-03-14 13:47:55,594 - DEBUG - [FuseFSCore.returntree] Instance List > itemstat:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 41453, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:47:55,594 - DEBUG - [FuseFSCore.returntree] data: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 41453, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, '/tmp'] 2017-03-14 13:47:55,594 - DEBUG - [FuseFSCore.readlink] FoundTree: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 41453, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, '/tmp'] 2017-03-14 13:47:55,595 - DEBUG - [FuseFSCore.readlink] path: /link_to_tmp. Context: {'gid': 0, 'pid': 99341, 'uid': 0} 2017-03-14 13:47:55,595 - DEBUG - [FuseFSCore.returntree] Instance List > itemstat:{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 41453, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051} 2017-03-14 13:47:55,595 - DEBUG - [FuseFSCore.returntree] data: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 41453, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, '/tmp'] 2017-03-14 13:47:55,596 - DEBUG - [FuseFSCore.readlink] FoundTree: [{'st_ctime': 1489479051, 'st_mtime': 1489479051, 'st_nlink': 1, 'st_mode': 41453, 'st_dev': 0, 'st_size': 0, 'st_gid': 931, 'st_uid': 931, 'st_ino': 0, 'st_atime': 1489479051}, '/tmp']
      
      





:









?







, . . , "" . , "" .

. , .. . , . .

, . , , pipe - . , .







. , uid gid . , .. , , . , .







, - .







- — ?







PS:誰かがgithubのプロジェクトへのリンクを見逃した場合、ここにあります







©Aborche 2017

アボルシュ








All Articles