Ich habe versucht, dies in einer chroot ohne proc montiert
/ # python
Python 2.7.1 (r271:86832, Feb 26 2011, 00:09:03)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> from ctypes import *
>>> libc = cdll.LoadLibrary("libc.so.0")
>>> os.listdir("/proc")
[]
>>> libc.mount(None, "/proc", "proc", 0, None)
0
>>> os.listdir("/proc")
['vmnet', 'asound', 'sysrq-trigger', 'partitions', 'diskstats', 'crypto', 'key-users', 'version_signature', 'kpageflags', 'kpagecount', 'kmsg', 'kcore', 'softirqs', 'version', 'uptime', 'stat', 'meminfo', 'loadavg', 'interrupts', 'devices', 'cpuinfo', 'cmdline', 'locks', 'filesystems', 'slabinfo', 'swaps', 'vmallocinfo', 'zoneinfo', 'vmstat', 'pagetypeinfo', 'buddyinfo', 'latency_stats', 'kallsyms', 'modules', 'dma', 'timer_stats', 'timer_list', 'iomem', 'ioports', 'execdomains', 'schedstat', 'sched_debug', 'mdstat', 'scsi', 'misc', 'acpi', 'fb', 'mtrr', 'irq', 'cgroups', 'sys', 'bus', 'tty', 'driver', 'fs', 'sysvipc', 'net', 'mounts', 'self', '1', '2', '3', '4', '5', '6', '7', '8' ..........
Sie sollten für Netzwerkfreigaben von „None“, um das Format der Halterung() Funktion erwartet der Lage sein, die Gerätedatei zu ändern. Ich glaube, es ist das gleiche wie der Mount-Befehl "Host:/Pfad/zu/Verzeichnis"
Duplizieren: http://StackOverflow.com/Questions/325463/Launch-Ashell-Command-with-in-A -python-script-wait-for-the-termination-and-retu –
Die Frage ist nicht die gleiche, aber die Antworten sind. –
Alte Frage, aber für zukünftige Abenteuer. Sehen Sie sich [mount.py] (https://github.com/MrVallentin/mount.py) an. – Vallentin