Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


ZollyMonsta

3009 posts

Uber Geek

ID Verified
Trusted

#318037 9-Dec-2024 15:55
Send private message

Hi there..

 

 

 

I have another curly one.

I have been successful in using a python script to connect between two different raspberry pi's over tailscale. 
The same command line, set up to run as a service, fails to connect to the other IP address.

I have also tried setting a route on the tailscale0 device for both IPs on both pi's, but this doesn't resolve the issue.

Running the script manually, no issue at all.

Example Route (it was a stab in the dark if this was the actual problem)

pi@open-ob-remote-belmont:~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 enxb827eb14cff3
<tailscale IP of Pi 1>  0.0.0.0         255.255.255.255 UH    0      0        0 tailscale0
<tailscale IP of Pi 2>   0.0.0.0         255.255.255.255 UH    0      0        0 tailscale0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 enxb827eb14cff3

 

The command itself runs via this in the original file on Pi 2:

sudo openob <ip of pi 1> cheesenode link1 rx -a alsa -d hw;0,0 &

 


I have to remove & for it as a service. I've tried with and without 'sudo' with no change..

 

Thanks





 

 

Check out my LPFM Radio Station at www.thecheese.co.nz - Now on iHeart Radio, TuneIn and Radio Garden

 

As per the usual std disclaimer.. "All thoughts typed here are my own."


Create new topic
LennonNZ
2459 posts

Uber Geek

ID Verified
Trusted

  #3318433 9-Dec-2024 16:25
Send private message

A few things you can try..

 

nohup rather than &
check logs via journalctl -u <your-service-name>.service
check env variables  (use env > /tmp/service_env.log in your script) as these may be different than when running manually





fe31nz
1229 posts

Uber Geek


  #3318601 9-Dec-2024 23:02
Send private message

When you say running it as a service, do you mean running it from systemd .service unit?  Is the service "Type=oneshot"?  If so, then you probably need to add

 

RemainAfterExit=yes

 

in the [Service] section of the unit file.

 

I had a problem like this where I was running a python program to retry mounting some sshfs mount points that were late becoming available at boot time.  The program was able to mount them when run manually, but when run as a service it reported mounting them, but when I tried to access the mount points they were not mounted.  It turned out that systemd starts programs in a separated environment (namespace?) or something similar, and when the service stops, systemd removes everything in that environment automatically, such as mount points and routing table entries.  Using RemainAfterExit=yes tells systemd to retain the environment (and so all the changes to the system setup) until the unit gets stopped when the system shuts down (or it otherwise is stopped).  Without RemainAfterExit=yes, a oneshot unit gets stopped as soon as the program it runs exits.


Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.