Unoffical empeg BBS

Quick Links: Empeg FAQ | Software | RioCar.Org | Hijack | jEmplode | emphatic
Repairs: Repairs | Addons: Eutronix | Cases

Topic Options
#366354 - 26/03/2016 20:17 Getting empeg's available disk space via Hijack
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5524
Loc: London, UK
If I'm connecting to the player by using Hijack, is there a way to figure out the available disk space?

Why? When you write a FID using emplode (i.e. the native car player protocol), the player decides which disk to put it on based on free disk space, such that the disks tend to fill up evenly (thus providing you with *two* single points of failure, but I digress...).

To write a FID using Hijack's HTTP server, I need to figure out which disk to write it to myself. So: how do I figure out which disk has the most space available?
_________________________
-- roger

Top
#366358 - 27/03/2016 14:46 Re: Getting empeg's available disk space via Hijack [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 13494
Loc: Canada
Something like this through the FTP server?

site exec df -a


[EDIT] Mmmm.. no, not quite. The Hijack "SITE EXEC" doesn't capture/return stdout. But using the built-in telnet server makes it easier:

telnet yeller
Trying 10.0.0.37...
Connected to yeller.localnet.
Escape character is '^]'.
bash: no job control in this shell
empeg:/# df /drive0
df /drive0
df: Warning: cannot read table of mounted filesystems: No such file or directory
Filesystem 1k-blocks Used Available Use% Mounted on
- 29181695 23860788 5320907 82% /drive0
empeg:/# exit


Edited by mlord (27/03/2016 14:56)

Top
#366359 - 27/03/2016 14:51 Re: Getting empeg's available disk space via Hijack [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 13494
Loc: Canada
Enable telnet with this in config.ini:

[hijack]
ktelnetd_port=23

Top
#366363 - 27/03/2016 16:23 Hijack v519 is released. [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 13494
Loc: Canada
I'll make it easier for you. smile

Hijack v519 is released, with a new /proc/df entry, which you can read from over HTTP, Telnet, and/or FTP.

Not exactly the same output as from the df command, but similar. Sizes are given as filesystem block counts.

Code:
Filesystem           MountPoint   Type         Size       Free
/dev/root            /            ext2        15863       4480
none                 /proc        proc            0          0
/dev/hda4            /drive0      ext2     29181695    5320907



Edited by mlord (27/03/2016 16:26)

Top
#366365 - 27/03/2016 18:03 Re: Hijack v519 is released. [Re: mlord]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5524
Loc: London, UK
Originally Posted By: mlord
Hijack v519 is released, with a new /proc/df entry


Perfect. Thanks Mark. I'll play with that later this weekend.
_________________________
-- roger

Top
#366366 - 28/03/2016 01:35 Re: Hijack v519 is released. [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 13494
Loc: Canada
Hah. Interesting.
The difference between the telnet "df" output, and the new /proc/df entry, is the "total Size" of the filesystem. The former shows the real size as well as the "size available to Joe Blow", whereas the latter only shows the real size (available to "root"). The difference is the "reserved" count.


Edited by mlord (28/03/2016 01:37)

Top