LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2024, 01:32 PM   #1
Gronjus
LQ Newbie
 
Registered: Jan 2024
Posts: 1

Rep: Reputation: 0
SystemD Service - Python Script Problem (Network Manager)


Hello everyone,

I am an embedeed Electronics Engineer and since 2 two months, I started to develop on a Debian Distro for a client.

I am actually developing a project which have a part that handles a MODEM4G & the os Connectivity. The modem is managed by AT Commands and the os connectivity mainly with ping and curl command.

The python script is working fine so far and have tested it for like 2 weeks now. I am happy with it but now, I am in the script automation phase.

I have tried to launch my script at boot with systemd and with the old school method (init.d). Both launched the script correctly but I am getting problem with the ouput of my ping and curl command.

Once the modem have been setted up with AT Commands, I am using a "nmcli device connect" command from the NetworkManager Package to get an ip from the network and can then interact with the network command as ping and curl.

When launched as systemd service or with the help of init.d, the output of the command are failing. I can not ping the host and the curl result is "000".

Still, when looking at Network Manager status, there is a valid ip,dns,route and even outside the script, using ping and curl command have the same failing behaviour.

Looking for solutions, I have found that Network Manager is using DBUS Session for the service to work and it seems complex to implement that kind of package with script started at boot.

I am bit stuck and I am wondering if anyone has suggestions for troubleshooting deeper ?

I have already set up Network Manager logging as debug but nothing relevant.

Thanks a lot for your help !

Antoine
 
Old 02-12-2024, 06:35 PM   #2
___
Member
 
Registered: Apr 2023
Posts: 141
Blog Entries: 1

Rep: Reputation: Disabled
Big welcome to LQ! (Sorry it's been a couple weeks; great project: hope you return.)

I'm far from expert, but to clarify your mysterious situation, post like this:
Code:
$ ip r
default via 192.168.1.254 dev eth0  src 192.168.1.158  metric 1002 
127.0.0.0/8 dev lo scope link 
192.168.1.0/24 dev eth0 scope link  src 192.168.1.158  metric 1002 

$ ping -c2 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=56 time=26.870 ms
64 bytes from 1.1.1.1: seq=1 ttl=56 time=30.117 ms
--- 1.1.1.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 26.870/28.493/30.117 ms
I probably don't have the knowledge to understand your sophisticated setup,
but, as a loose analogy, telling a car mechanic that:
Quote:
My new fancy engine is ok
But "nothing works"
may not get a response!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to cache systemd-ask-password data for automatic systemd service restarts? midiox Linux - Server 0 09-02-2020 11:48 AM
Can't access full journalctl from script via systemd service even though user is in systemd-journal group iwtbf Linux - Newbie 0 02-19-2016 02:44 PM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
Network Manager service vs Network service jeromeNP7 Fedora 2 07-18-2009 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration