Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rpi servicename #1421

Draft
wants to merge 4 commits into
base: development
Choose a base branch
from
Draft

Conversation

mfalkvidd
Copy link
Member

An attempt to implement the feature requested in #1407

If you can, please test and give feedback.

I am worried that people will use this new feature without thinking, and start multiple instances with the same eeprom file and/or config file. That would get them into big trouble.

@mfalkvidd mfalkvidd force-pushed the rpi-servicename branch 2 times, most recently from 89b6d3f to 06c419e Compare May 14, 2020 13:40
Service rename works, but we also need to handle config file,
log file, log pipe, eeprom file and maybe something more.

This feature was requested in https://bit.ly/3fL0fLn
* On stderr, the service name is printed on each line.
* Print the name of the eeprom file, the log file and
the log pipe on startup.

Hopefully, this will help people notice when they are
running multiple instances, and to distinguish between
them.
@mfalkvidd
Copy link
Member Author

This is how I tested:

pi@raspberrypi:~/MySensors $ ./configure --service-name=my2ndmysgw --my-port=5333
pi@raspberrypi:~/MySensors $ make
pi@raspberrypi:~/MySensors $ sudo make install
Installing bin/my2ndmysgw to /usr/local/bin
install -m0644 initscripts/mysgw.systemd /etc/systemd/system/my2ndmysgw.service
systemctl daemon-reload
MySensors gateway has been installed, to add to the boot run:
  sudo systemctl enable my2ndmysgw.service
To start the gateway run:
  sudo systemctl start my2ndmysgw.service

pi@raspberrypi:~/MySensors $ sudo systemctl enable my2ndmysgw.service
Created symlink /etc/systemd/system/multi-user.target.wants/my2ndmysgw.service → /etc/systemd/system/my2ndmysgw.service.
pi@raspberrypi:~/MySensors $ sudo systemctl start my2ndmysgw.service

/tmp/mysgw.log:
May 16 11:12:46 my2ndmysgw INFO  Using log file /tmp/mysgw.log
May 16 11:12:46 my2ndmysgw INFO  Starting gateway...
May 16 11:12:46 my2ndmysgw INFO  Protocol version - 2.4.0-alpha
May 16 11:12:46 my2ndmysgw INFO  Using eeprom file /etc/mysensors.eeprom
May 16 11:12:46 my2ndmysgw DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=0,VER=2.4.0-alpha
May 16 11:12:46 my2ndmysgw DEBUG TSF:LRT:OK
May 16 11:12:46 my2ndmysgw DEBUG TSM:INIT
May 16 11:12:46 my2ndmysgw DEBUG TSF:WUR:MS=0

pi@raspberrypi:~/MySensors $ sudo make uninstall
Stopping daemon my2ndmysgw (ignore errors)
removing files
rm /etc/systemd/system/my2ndmysgw.service /usr/local/bin/my2ndmysgw

@mfalkvidd
Copy link
Member Author

mfalkvidd commented May 16, 2020

THIS IS NOT READY FOR MERGE

My main concern for this feature is that people will start multiple instances without changing the eeprom config file. If 2 or more gateways use the same eeprom file, behavior will not be good and users will be mightily confused.

@mfalkvidd mfalkvidd added the release-notes Issues that have information that should be included in the release notes label May 16, 2020
@mfalkvidd mfalkvidd removed the release-notes Issues that have information that should be included in the release notes label May 29, 2020
@mfalkvidd mfalkvidd marked this pull request as draft October 27, 2020 07:24
@MySensors-MJChrist
Copy link

Is it this ready for testing. I want two use an RS485 and RF24 as two instance on a Raspberry

@mfalkvidd
Copy link
Member Author

Yes, you can use it with the caveat posted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants