Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 [2] 3 4 ... 6

Author Topic: Best way to get DSL Stats running 24/7?  (Read 5749 times)

RichardB

  • Just arrived
  • *
  • Posts: 9
Re: Best way to get DSL Stats running 24/7?
« Reply #15 on: December 12, 2017, 08:37:19 AM »

The only issue I have not managed to overcome to date is getting DSLStats to auto-start on RPi boot, there is quite a long thread on this in one of the attached links, not a big issue to me, I have the daughter/son educated in restarting DSLStats post a power outage be it accidental or otherwise.


Hi

I auto re-start DSLstats on my PI Zero W using a bash script.

The script is named "DSL_start" and located in the home folder.

Script contents:
     #!/bin/bash
     #usually reboots due to power failure
     #or maintenance
      sleep 2m    #wait 2 minutes for DSL to reconnect
      /home/pi/dslstats32RPi-6.1/dslstats

The DSL_start script is called by the LXDE autostart script.

~/.config/lxsession/LXDE-pi/autostart

I added the following line to end of the file:
       @/home/pi/DSL_start

Finally, DSLstrats has to be configured to autostart recording when started.
 
Configuration Tab, Misc Tab, Program Start, Tick "Autostart recording on program start"
Logged

tiffy

  • Reg Member
  • ***
  • Posts: 296
Re: Best way to get DSL Stats running 24/7?
« Reply #16 on: December 12, 2017, 10:17:24 AM »

@RichardB

Many thanks for the information on auto-starting DSLStats, seems a nice simple solution, I will certainly give this a try & report outcome, I already have DSLStats configured to auto-start recording on boot.
Logged
Plusnet 40/10 - DSLStats/RPi - ZyXEL VMG1312-B10A - Huawei Cab - MDWS (sadly gone 12/03/18)

tiffy

  • Reg Member
  • ***
  • Posts: 296
Re: Best way to get DSL Stats running 24/7?
« Reply #17 on: December 12, 2017, 03:12:38 PM »

@RichardB

Have tried your auto-start solution on my RPi Mk 1B, running latest version of Raspbian, does not work for me for some reason, no errors displayed as such just won't start DSLStats on boot.
Thought I might have found the reason, the created file, "DSL_start" execute permission was by default set at "nobody", changed this to "anybody" but still no joy.
Executing the file "DSL_start" manually does not produce any results or errors either (assuming this is possible)

There is an old forum post on the RPi/DSLStats auto-start issue here (quite a long thread):

http://forum.kitz.co.uk/index.php/topic,15882.0.html

Although some members achived success, none of the solutions suggested in this thread worked for me, from memory I was getting the "already running" error, finally gave up.

As you can probably tell, I'am by no means a Linux expert !

 
Logged
Plusnet 40/10 - DSLStats/RPi - ZyXEL VMG1312-B10A - Huawei Cab - MDWS (sadly gone 12/03/18)

vic0239

  • Reg Member
  • ***
  • Posts: 319
Re: Best way to get DSL Stats running 24/7?
« Reply #18 on: December 12, 2017, 04:05:44 PM »

I've had all these issues previously, but now that VNC is bundled with the OS it seems to work much better.

Both my Pi devices are running Raspbian GNU/Linux 8 (jessie).

I have the following in:

~/.config/autostart/dslstats.desktop

Code: [Select]
[Desktop Entry]
Version=1.0
Type=Application
Name=DSLstats
Exec=/home/pi/start.dslstats

and the script contains:

Code: [Select]
echo Sleeping for 30
sleep 30
echo "Doing autorun script..."
/home/pi/dslstats32RPi-6.1/dslstats &

RealVNC is now bundled so I use VNC viewer on the Mac to connect.
Logged

RichardB

  • Just arrived
  • *
  • Posts: 9
Re: Best way to get DSL Stats running 24/7?
« Reply #19 on: December 12, 2017, 06:20:26 PM »


Thought I might have found the reason, the created file, "DSL_start" execute permission was by default set at "nobody", changed this to "anybody" but still no joy.
Executing the file "DSL_start" manually does not produce any results or errors either (assuming this is possible)
 

Hmm, I guess there could be a number of potential causes.


If you copy vlc0239's echo command     echo "Doing autorun script..."        and add it to the beginning of DSL_start script.
The 2 minute delay in my DSL_start is far too long for debugging, reduce it to a minimum of 20 seconds.
set line 4 to "sleep 20".
Any less and I found that the script would not start DSL_stats.
I assume the script was run before the PI could start DSLstats. Not sure why!
As you are running a PI MK1 you may need to extend this time.

I assume you executed DSL_start manually, from the command line in a Terminal window?
Did you prefix DSL_start with  "./"      I.E. type "./DSL_start"  ?

If not could you try and post the result here?

Logged

tiffy

  • Reg Member
  • ***
  • Posts: 296
Re: Best way to get DSL Stats running 24/7?
« Reply #20 on: December 12, 2017, 09:23:40 PM »

Thanks to both for the further suggestions, will hopefully try these tomorrow when I have more time and report back.
Logged
Plusnet 40/10 - DSLStats/RPi - ZyXEL VMG1312-B10A - Huawei Cab - MDWS (sadly gone 12/03/18)

tiffy

  • Reg Member
  • ***
  • Posts: 296
Re: Best way to get DSL Stats running 24/7?
« Reply #21 on: December 13, 2017, 06:24:00 PM »

@RichardB

Following your suggestions, realised that I made some very basic mistakes in the script of "DSL_start" file such as incorrect DSLStats file path, have added the "vic0239" echo lines which certainly made debugged easier, the file now runs in a command window and starts DSLStats with sleep delay as required.

As per your suggestion, I have increased the sleep delay to 3 mins as my old Mk.1 B RPi does take quite a while to boot.

However, when doing a full cold boot nothing appears to happen after the 3 min delay, can detect CPU activity at that point indicating that something appears to be going on.
In fact the "DSL_start" script does appear to execute but DSLStats does not appear on the desktop, can tell this is the case as either attempting to re-run the "DSL_start" script manually or executing the DSLStats desktop icon produce the error "program already running, shutting down".

So, looks like everything associated with your auto-start method is functioning but I am back to my original issue of error "program already running".

Is there any way I could delay the execution of the "DSL_start" file while still preserving the auto start at boot function, could a sleep delay be incorporated in the "autostart" script ?
Logged
Plusnet 40/10 - DSLStats/RPi - ZyXEL VMG1312-B10A - Huawei Cab - MDWS (sadly gone 12/03/18)

burakkucat

  • Global Moderator
  • Senior Kitizen
  • *
  • Posts: 22548
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: Best way to get DSL Stats running 24/7?
« Reply #22 on: December 13, 2017, 06:46:24 PM »

I'm sure there is a "cron" option that uses the "@reboot" specification, thus allowing one-off script execution.

Looking at the output of "man 5 crontab", I see the following under the "EXTENSIONS" heading --

Code: [Select]
EXTENSIONS
       When specifying day of week, both day 0 and day 7 will be considered Sunday.  BSD and ATT seem to disagree about this.

       Lists  and ranges are allowed to co-exist in the same field.  "1-3,7-9" would be rejected by ATT or BSD cron -- they want to see "1-3"
       or "7,8,9" ONLY.

       Ranges can include "steps", so "1-9/2" is the same as "1,3,5,7,9".

       Names of months or days of the week can be specified by name.

       Environment variables can be set in the crontab.  In BSD or ATT, the environment handed to child processes is basically the  one  from
       /etc/rc.

       Command  output is mailed to the crontab owner (BSD canít do this), can be mailed to a person other than the crontab owner (SysV canít
       do this), or the feature can be turned off and no mail will be sent at all (SysV canít do this either).

       These special time specification "nicknames" are supported, which replace the 5 initial time and date fields, and are prefixed by  the
       í@í character:
       @reboot    :    Run once after reboot.
       @yearly    :    Run once a year, ie.  "0 0 1 1 *".
       @annually  :    Run once a year, ie.  "0 0 1 1 *".
       @monthly   :    Run once a month, ie. "0 0 1 * *".
       @weekly    :    Run once a week, ie.  "0 0 * * 0".
       @daily     :    Run once a day, ie.   "0 0 * * *".
       @hourly    :    Run once an hour, ie. "0 * * * *".
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

vic0239

  • Reg Member
  • ***
  • Posts: 319
Re: Best way to get DSL Stats running 24/7?
« Reply #23 on: December 13, 2017, 09:33:38 PM »

I am back to my original issue of error "program already running".
I had this issue too which was due to my VNC server using a different display number to the Pi desktop. Originally I was running tightvnc which couldnít use display 0, so I changed to x11vnc which could. Apparently the initialisation of the VNC server causes a second iteration of the autostart items. What VNC server are you running?
Logged

Dray

  • Kitizen
  • ****
  • Posts: 2362
Re: Best way to get DSL Stats running 24/7?
« Reply #24 on: December 13, 2017, 09:44:07 PM »

I have to say I run dslstats on a windows 7 virtual machine on my server.
It gets started by a scheduled task which runs every minute and restarts dslstats if it ends for any reason.
This would be my requirement for a RPi install but I don't think that's going to happen.
Logged

licquorice

  • Reg Member
  • ***
  • Posts: 619
Re: Best way to get DSL Stats running 24/7?
« Reply #25 on: December 13, 2017, 10:32:14 PM »

I had this issue too which was due to my VNC server using a different display number to the Pi desktop. Originally I was running tightvnc which couldnít use display 0, so I changed to x11vnc which could. Apparently the initialisation of the VNC server causes a second iteration of the autostart items. What VNC server are you running?

xrdp works fine for me.
Logged

RichardB

  • Just arrived
  • *
  • Posts: 9
Re: Best way to get DSL Stats running 24/7?
« Reply #26 on: December 14, 2017, 08:01:52 AM »

vlc0259 could be correct. I have seen the issue vlc0259 describes before on Linux systems. However, I have not seen it on my PI.
I had this issue too which was due to my VNC server using a different display number to the Pi desktop. Originally I was running tightvnc which couldnít use display 0, so I changed to x11vnc which could. Apparently the initialization of the VNC server causes a second iteration of the autostart items. What VNC server are you running?
For info I am using Real VNC 6.1.1 Raspberry PI edition, as it was supplied with Raspbian.
https://www.realvnc.com/en/connect/docs/raspberry-pi.html

Tiffy, when the script has run you can check whether dslstats is running by opening a terminal and typing:

ps -A | grep dslstats

If dslstats is not running nothing will be displayed.

If dslstats is running something like
         1001 ?        05:16:39 dslstats
will be displayed.

Richard
Logged

tiffy

  • Reg Member
  • ***
  • Posts: 296
Re: Best way to get DSL Stats running 24/7?
« Reply #27 on: December 14, 2017, 09:00:11 PM »

Again, thanks to all for the further support, much appreciated:

Turns out I was actually running "TightVNC" server as per vic0239's experiences, have now installed the latest Real VNC Server revision, 6.1.1 on the RPi and also updated my VNC Viewer to the latest revision on my desktop, Win 8.1 64b PC.

Perhaps I should have stated earlier that I am running my RPi in GUI, desktop mode so I can directly observe the DSLStats GUI in the VNC window on my desktop PC, apologies if that is an obvious statement.
On my previous "TightVNC" setup, DSLStats appeared on the RPi desktop when started so very obvious that it was running, I have then made the incorrect assumption that if DSLStats does not appear on the RPi desktop it's not running.

So, current state:
With the latest VNC Server, DSLStats does now auto-start on RPi boot but runs in the background, ie. does not appear on the RPi GUI desktop, as per previous expectation.
I have applied the "running test" as suggested by RichardB which is positive and I can see that my stat's are being updated to MDWS.

Probably very obvious to the more Linux enlightened forum members, how do I now get DSLStats GUI to appear on the RPi desktop again ?
Logged
Plusnet 40/10 - DSLStats/RPi - ZyXEL VMG1312-B10A - Huawei Cab - MDWS (sadly gone 12/03/18)

vic0239

  • Reg Member
  • ***
  • Posts: 319
Re: Best way to get DSL Stats running 24/7?
« Reply #28 on: December 14, 2017, 09:40:38 PM »

Is your VNC Viewer set to connect to display number 0? hostname :0  Iím not a Windows bod, so not sure how that would be specified on that platform. 
Logged

tiffy

  • Reg Member
  • ***
  • Posts: 296
Re: Best way to get DSL Stats running 24/7?
« Reply #29 on: December 15, 2017, 12:14:02 AM »

Is your VNC Viewer set to connect to display number 0? hostname :0  Iím not a Windows bod, so not sure how that would be specified on that platform.

Can't see any reference to "display number" or "hostname" on my VNC Viewer configuration.
Of course, I am actually connecting perfectly and displaying the RPi GUI desktop screen on my desktop PC where I can perform any task except display DSLStats GUI window even thought I know it's running in the background.

As previously reported, when using the TightVNC server and starting DSLStats manually, DSLStats GUI window just appears after program boot up on the RPi desktop as per normal expectation.
Logged
Plusnet 40/10 - DSLStats/RPi - ZyXEL VMG1312-B10A - Huawei Cab - MDWS (sadly gone 12/03/18)
Pages: 1 [2] 3 4 ... 6
 

anything