Update breaks Quickbox web and Deluge web

I am curious as we want to avoid this in the future.
Will you show me the output of the following:

cd /
locate set_interface

It should show as

server:/# locate set_interface

If those are all showing, then show me the output for:

cat /srv/rutorrent/home/db/interface.txt

This is where the file that the cronjob for writing your adapter to these files on updates lives. If you have an empty file for some reason and no results are returned, we will need to add your adapter. You can do:

printf "venet0" > /srv/rutorrent/home/db/interface.txt

Next, run the updater from your dashboard (no worries, if this happens again… it gives us an idea) to import the text back to the files. Then allow 1 minute to pass for your adapter to show up.

locate set_interface
locate: can not stat () `/var/lib/mlocate/mlocate.db’: No such file or directory

Cron job exists. Does point to /usr/local/bin/quickbox/system/set_interface

interface.txt is empty.

Run the printf command, updated, rebooted (just to be sure) Everything is working as you would expect!

It hasnt updated everything, as the formatting change i made to disk_data has been retained. It kept showing like 8 or 9 decimal places, so I added couple of lines to format it to 3.

Could you possibly share those lines? I’ll credit you in the commit. :slight_smile:

Of course, they arent impressive and I dont want credit for them. You might even tell me there’s a nicer way to do it. Maybe using number_format(round(@…etc)

     //hard disk
      $dftotal = round(@disk_total_space(".")/(1024*1024*1024),3); //Total
      $dffree = round(@disk_free_space(".")/(1024*1024*1024),3); //Available
      $dffree = number_format($dffree,3);
  $dfused = $dftotal-$dffree; //used
  $dfused = number_format($dfused,3);

I had another idea that you would have been more impressed with, but I couldnt get the syntax to work. In Config.php around line 238, where you are running lots of PS Axo commands to determine if a process exists,

I was thinking run a single “ps” command showing all processes for that user, store the list of running program names in a variable or array. And then the next call to ProcessExists just becomes a check to see if that process exists in the array for that user. I thought this would be a lot more efficient and save on calls to the server.

1 Like

Excellent call on number_format. I actually hadn’t considered that!

This would be much more efficient. I could add pending variables to work around how some services requires the name of the service itself. This is a good idea and I will work on pushing it into the timeline… more than likely by v2.4.6 - as v2.4.5 is already assigned to launch today or tomorrow.

Thanks for the effort on that, the share and the wonderful suggestion!

As per the number format to return cleaner and more readable values, this works and will be included soon:

  //hard disk
  $dftotal = number_format(round(@disk_total_space("$location")/(1024*1024*1024),3)); //Total
  $dffree = number_format(round(@disk_free_space("$location")/(1024*1024*1024),3)); //Available
  $dfused = number_format(round(@disk_total_space("$location")/(1024*1024*1024),3)-round(@disk_free_space("$location")/(1024*1024*1024),3)); //used
  $perused = (floatval($dftotal)!=0)?round($dfused/$dftotal*100,2):0;

Return values are:

Free: 3,841 GB
Used: 1,680 GB
Size: 5,521 GB
1 Like

Hi, sorry to revive this topic, but I just have the problem today after an update.

Interface whasn’t in these files:
/srv/rutorrent/home/widgets/stat.php /srv/rutorrent/home/widgets/data.php /srv/rutorrent/home/widgets/bw_tables.php /srv/rutorrent/home/inc/config.php

This was non-existent:

Here is what I’ve done:
echo "eth0" > /srv/rutorrent/home/db/interface.txt /usr/local/bin/quickbox/system/set_interface

Yesterday, I had a problem with sudo, master.txt was missing also and sudoers was broken:
echo "myusername" > /srv/rutorrent/home/db/master.txt