Page 8 of 10

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Mon 13 Feb 2017 9:30 pm
by jank
BigOkie wrote:[I believe running 'update-rc.d cumulusmx defaults', then running 'update-rc.d cumulusmx enable' solved that issue.
OKay, this makes sense and I am gladf to hear that there was one person who solved the problem this way.

I am not 100% but I have also the feeling that form time to time the ownership of 1 file in the folder changed.
In the past I started and stopped CumulusMX many times because of changing something in my script, updating CumulusMX etc....and each ime when I cam accross the ownership problem I was not sure how I started cumulusmx last time. Pi or root .....but 2 days ago, I was 100% sure that I did it as pi and after I rebooted my Pi I noticed that the init.d script did not started CumulusMX. So I stated it manually and found out, that there was 1 file in the Cumulus folder which does not belong to user pi.

So lets see how things are going in the next days / week.
Btw: Uptime of my Raspberry was more then 200 days (if aynone is interested to know)

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Mon 20 Feb 2017 1:35 pm
by jank
I found something strange :groan: in the code of cumulusmx.sh which prevented the /etc/init.d/cumulusmx startup script to start cumulusmx.sh successfully, if the CumulusMX folder was installed on a USB Stick/External Drive. :ugeek:

I can not explain, but a command failed for any reason when CumulusMX was not installed on the root device

I will provide a new version of the cumulusmx.sh Start/stop script soon.

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Wed 22 Feb 2017 2:36 am
by novy
Ive followed a few instructions on here and got cumulusmx installed on raspberry pi3 b running RASPBIAN JESSIE WITH PIXEL 2017-01-11

Ive followed the instructions on here to have cumulus to start at boot .
When i type
chkconfig |grep cumu
It says
cumulusmx on

but its not on as its not uploading to wunderground nether can i access the local page dials etc.

I can start cumulus by entering in cumulusmx folder terminal
sudo mono CumulusMX.exe
It works uploading to wunderground and the local page works.

any ideas what could be wrong ?

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Wed 22 Feb 2017 2:36 pm
by VTHokie74
Have you installed Screen?

Code: Select all

sudo apt-get install screen
It sounds like CumulusMX is closing when you close the terminal or SSH session. You need Screen installed so CumulusMX can run in the background in it's own screen session after you close the terminal window. If you install Screen you can use the start stop script to open a screen and run it for you at boot up.

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Wed 22 Feb 2017 4:49 pm
by novy
yes i have installed screen and have just tried to reinstall it .

pi@raspberrypi:~ $ sudo apt-get install screen
Reading package lists... Done
Building dependency tree
Reading state information... Done
screen is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 135 not upgraded.

ive run

pi@raspberrypi:~/CumulusMX $ sudo mono CumulusMX.exe
Current culture: English (United Kingdom)
Serial: 74FECEABEB2DA94ECB5EBA0CD11A7137
Cumulus MX v.3.0.0 build 3043
Today.ini = data/today.ini
Last update=2017-02-22T16:30:00
Connected to station
16:45:24 Downloading Archive Data
Cumulus running at: http://*:8998/
(Replace * with any IP address on this machine, or localhost)
Starting web socket server on port 8002
22/02/2017 16:45:25
Type Ctrl-C to terminate
16:45:25 Downloading Archive Data
16:45:25 Normal running

and closed the terminal window and it continues to run fine in the background.

ive restarted the pi and its not running at boot ?
when i run
pi@raspberrypi:~ $ chkconfig |grep cumu
cumulusmx on

it says its on but its not running updating ?

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Wed 22 Feb 2017 7:51 pm
by VTHokie74
You have screen installed but I am not seeing where you are actually opening a screen to run CumulusMX. You can open a screen by just typing "screen". Then type"sudo mono CumulusMX.exe" in the CumulusMX directory to start CumulusMX. To detach the screen and get back to terminal hit cntl +a +d. Type "screen -ls" to check that the screen is still running with CumulusMX.

Jank's start stop script automates this all for you. Since I run Jank's script as user root to check it I have to type "sudo screen -ls" like this:
pi@raspberrypi:~ $ sudo screen -ls
There is a screen on:
12340.CumulusMX (01/31/2017 08:30:10 AM) (Detached)
1 Socket in /var/run/screen/S-root.
Could you try "screen -ls" and "sudo screen -ls" to see if there is really a detached screen running CumulusMX?

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Wed 22 Feb 2017 8:38 pm
by novy
ive have never typed screen in before, sorry this is all new to me .
i have been running cumulus from the cumulus folder / terminal


pi@raspberrypi:~/CumulusMX $ screen -ls
There are screens on:
1245.pts-0.raspberrypi (22/02/17 20:33:20) (Detached)
1197.pts-0.raspberrypi (22/02/17 20:32:03) (Detached)
1166.pts-0.raspberrypi (22/02/17 20:31:21) (Detached)
3 Sockets in /var/run/screen/S-pi.

pi@raspberrypi:~/CumulusMX $ sudo screen -ls
No Sockets found in /var/run/screen/S-root.

pi@raspberrypi:~/CumulusMX $



Ok ive just restarted the pi and done the same again

pi@raspberrypi:~/CumulusMX $ sudo screen -ls
No Sockets found in /var/run/screen/S-root.

pi@raspberrypi:~/CumulusMX $ screen -ls
There is a screen on:
1257.pts-0.raspberrypi (22/02/17 20:48:30) (Attached)
1 Socket in /var/run/screen/S-pi.

pi@raspberrypi:~/CumulusMX $



sorry i am really getting confused with this now lol . ive restarted pi again

i went to the cumulus folder
i opened terminal
i typed screen /enter/ screen opened
space bar / space bar / exit screen
back to terminal
i typed sudo mono cumulusmx.exe
cumulus running / closed the terminal window / running in background now

i opened terminal typed
sudo screen -ls
screen -ls

pi@raspberrypi:~ $ sudo screen -ls
No Sockets found in /var/run/screen/S-root.

pi@raspberrypi:~ $ screen -ls
There is a screen on:
1370.pts-0.raspberrypi (22/02/17 21:32:08) (Detached)
1 Socket in /var/run/screen/S-pi.

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 12:26 am
by VTHokie74
If I followed all that correctly you opened a screen and then switched back to terminal and ran CumulusMX. You need to start CumulusMX when you in screen and then you can switch back to terminal mode. Then you can detach the screen session and go back to terminal. By doing that CumulusMX will run until you reboot. Your screen -ls results show nothing running in a screen.

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 1:15 am
by novy
yes only because i could not type sudo mono CumulusMX.exe into the actual screen window ?
I take it as long as the screen window is open it does its job , and i have to run another terminal window from cumulus folder to enter the sudo mono CumulusMX.exe while the screen window is open also , and once cumulus has started i can cntl a+d on the screen window and close it , and close the cumulus window .

Ive done that above and cumulus is running now in the background . but will it start at boot by its self if i reboot the pi ?

I have x11vnc installed also to control the pi from my pc. it starts on its own every boot and i need cumulus to do this also .

pi@raspberrypi:~ $ sudo screen -ls
No Sockets found in /var/run/screen/S-root.

pi@raspberrypi:~ $ screen -ls
There is a screen on:
1170.pts-0.raspberrypi (23/02/17 00:59:29) (Detached)
1 Socket in /var/run/screen/S-pi.

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 1:43 am
by VTHokie74
Try typing "screen bash". Then run CumulusMX. Then disconnect the screen by hitting cntl-A then release and hit D. Now you should be back in terminal with CumulusMX running in a screen. You can check by typing "screen -ls".

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 2:00 am
by novy
ok done that

screen bash
sudo mono cumulusmx.exe wait till its running then
cntl-a release and d

i get these results

[detached from 1167.pts-0.raspberrypi]
pi@raspberrypi:~/CumulusMX $ screen -ls
There is a screen on:
1167.pts-0.raspberrypi (23/02/17 01:52:24) (Detached)
1 Socket in /var/run/screen/S-pi.


cumulus is now running in background ok


I have now rebooted the pi but cumulus did not start. it is not updating to wunderground nor can i connect to my local page.

if i run in terminal chkconfig it says cumulus on ? . does this data mean it should autorun at boot or am i mistaken ?

cumulusmx on

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 3:31 am
by VTHokie74
Manually running screen and CumulusMX does nothing on reboot. You need to run a script to run CumulusMX on reboot. Go back and read the first post in this topic and follow the instructions.

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 4:34 am
by novy
ok i just tried that again still not working. had enough tonight try again tomorrow

i wonder if it could be anything to do with using berryboot ?

thanks

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 8:55 am
by jank
Hello Novy, I am not sure, but when I read all your posts, it looks like, that you did not fully understood some things.
When you start with linux, it is much more complicated then Windows....so let me give you a summary.

You installed CumulusMX and it is working when you start it manually.
you have installed the Init.d Start Script in /etc/init.d/cumulus but you have not installed the main start stop script.

When you start a program in Linux (as you did with Cumulus - sudo mono CumulusMX , Cummulus will start, but the terminal window you opened is being used to run this program. In the moment, when you close this terminal, the program will be stopped. this is the reason why you use Screen.
with the program screen, you can run programs in the background ---> Since the usage of screen is complicated I wrote a CumuluxMX start/stop script which is doing all this for you. -----> Please read this post: https://cumulus.hosiene.co.uk/viewtopic.php?f=27&t=13767
this makes it easy to handle CumulusMX on a Linux system. you only need to type: sudo cumulusmx.sh -h to see all options.
this script will start cumulusmx for you, it can stop it, it can restart it it can crate backups and a lot of more things.
Once this script was running, some people asked me, if it is possible to start CumulusMX automatically when the pi starts.
To realize this, I wrote a second System Init script (similar to the startup folder in Windows) which is starting the cumulusmx.sh script which is starting CumulusMX.
---> System Boot ----> /etc/init.d/cumulusmx --------------> cumuluxmsh.sh script ------------> CumulusMX

you have not installed the cumulusmx.sh script but the init.d script.......But the init.d script can not start CumulusMX without the cumulusmx.sh script :-) Sounds complicated ? :ugeek:
This is how I understand your problem.

Re: RaspberryPi: CumulusMX init.d System Startup Script

Posted: Thu 23 Feb 2017 2:11 pm
by VTHokie74
jank, I think you are correct. I assumed he had already installed the main start stop script. That would explain it.