NetworkManager dispatcher doesn´t run in Porteus?

Post here if you are a new Porteus member and you're looking for some help.
zyrus
White ninja
White ninja
Posts: 12
Joined: 11 Jun 2024, 17:51
Distribution: porteus

NetworkManager dispatcher doesn´t run in Porteus?

Post#1 by zyrus » 05 Dec 2024, 18:45

Hi guys
I need to run a command when a internet connection is established, and NetworkManager.dispatcher service does nothing.
Is that service implemented in Porteus distro ?
If not, is there any way to achieve this?
Thanks

User avatar
Ed_P
Contributor
Contributor
Posts: 8745
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

NetworkManager dispatcher doesn´t run in Porteus?

Post#2 by Ed_P » 05 Dec 2024, 19:42

Which Porteus distro are you using? What NetworkManager.dispatcher command are you using to connect to the network? Do you see the Internet Connection that you want to connect to in the network window?

Added in 6 minutes 51 seconds:
:hmmm: Seems to be related to this thread: Lanzar un script cuando se conecta a Wifi

beny
Full of knowledge
Full of knowledge
Posts: 2244
Joined: 02 Jan 2011, 11:33
Location: italy

NetworkManager dispatcher doesn´t run in Porteus?

Post#3 by beny » 05 Dec 2024, 20:28

hi take a look a this link if is useful for you:
https://blogs.oracle.com/linux/post/net ... er-scripts

User avatar
Ed_P
Contributor
Contributor
Posts: 8745
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

NetworkManager dispatcher doesn´t run in Porteus?

Post#4 by Ed_P » 05 Dec 2024, 21:14

Having a system that automatically does a network connection script when a network connection is made doesn't sound very safe. Especially if the system is on a USB drive that could be given to someone. :hmmm:

beny
Full of knowledge
Full of knowledge
Posts: 2244
Joined: 02 Jan 2011, 11:33
Location: italy

NetworkManager dispatcher doesn´t run in Porteus?

Post#5 by beny » 05 Dec 2024, 21:53

hi Ed_P, is for this task that user need a very strong firewall policy

User avatar
Ed_P
Contributor
Contributor
Posts: 8745
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

NetworkManager dispatcher doesn´t run in Porteus?

Post#6 by Ed_P » 05 Dec 2024, 23:40

And beny does Porteus have a strong firewall policy built in?

Years ago CDs and USB drives could automatically run apps when plugged in now they don't.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4166
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

NetworkManager dispatcher doesn´t run in Porteus?

Post#7 by ncmprhnsbl » 05 Dec 2024, 23:48

zyrus wrote:
05 Dec 2024, 18:45
I need to run a command when a internet connection is established, and NetworkManager.dispatcher service does nothing.
Is that service implemented in Porteus distro ?
If not, is there any way to achieve this?
by the looks of it, you'll need /usr/libexec/nm-dispatcher running.
it doesn't appear that standard slackware init scripts for networkmanager handle that, so either:
add to /etc/rc.d/rc.local the line:

Code: Select all

/usr/libexec/nm-dispatcher
or you can use the cliexec= cheatcode on the APPEND line of the /boot/syslinux/porteus.cfg

Code: Select all

cliexec=/usr/libexec/nm-dispatcher
also, make sure your script(s) in /etc/NetworkManager/dispatcher.d is executable.

i'll link this for general info (but the systemd stuff does not apply here): https://wiki.archlinux.org/title/Networ ... dispatcher

EDIT but then i see this: https://www.linuxquestions.org/question ... 175468789/
which makes no mention of the above beyond the OP musing that the dispatcher might not be running..
so perhaps dbus is supposed to automagicly start nm-dispatcher if there's scripts present. (though this doesn't seem to be the case in systemd world)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

zyrus
White ninja
White ninja
Posts: 12
Joined: 11 Jun 2024, 17:51
Distribution: porteus

NetworkManager dispatcher doesn´t run in Porteus?

Post#8 by zyrus » 07 Dec 2024, 11:57

Ed_P wrote:
05 Dec 2024, 19:48
Which Porteus distro are you using? What NetworkManager.dispatcher command are you using to connect to the network? Do you see the Internet Connection that you want to connect to in the network window?
Porteus 5.01.
I want to launch a ntpdate command in order to syncronize date/time with a specific ntp server
i see (and use) the wireless internet connection without problems; i write this post from this one

zyrus
White ninja
White ninja
Posts: 12
Joined: 11 Jun 2024, 17:51
Distribution: porteus

NetworkManager dispatcher doesn´t run in Porteus?

Post#9 by zyrus » 07 Dec 2024, 12:18

Ed_P wrote:
05 Dec 2024, 21:14
Having a system that automatically does a network connection script when a network connection is made doesn't sound very safe. Especially if the system is on a USB drive that could be given to someone. :hmmm:
I do NOT establish automatically a network connection. I want to launch a script only when a internet connection is detected. Specifically,

Code: Select all

ntpdate ntp.roa.es
.
I use three OS; Windows 10, Artix and Porteus. According to how the clock works in Porteus (Porteus clock. How it works.), I need to perform different commands if I dual boot Porteus-Windows or Porteus-Linux. By launching this command when internet connection is detected I solve the problem in a simple way
Last edited by zyrus on 07 Dec 2024, 12:38, edited 2 times in total.

zyrus
White ninja
White ninja
Posts: 12
Joined: 11 Jun 2024, 17:51
Distribution: porteus

NetworkManager dispatcher doesn´t run in Porteus?

Post#10 by zyrus » 07 Dec 2024, 12:32

Code: Select all

/usr/libexec/nm-dispatcher
I execute this command above, and doesn't anything;

Code: Select all

htop        or 
ps -aux | grep dispatcher
can't find that service running

User avatar
Ed_P
Contributor
Contributor
Posts: 8745
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

NetworkManager dispatcher doesn´t run in Porteus?

Post#11 by Ed_P » 07 Dec 2024, 16:07

zyrus wrote:
07 Dec 2024, 12:18
According to how the clock works in Porteus (Porteus clock. How it works.),
The good old days. :happy62: I wish more of the posters were still with us. :(
zyrus wrote:
07 Dec 2024, 12:18
I use three OS; Windows 10, Artix and Porteus.
How do Windows and Artix set their clocks?

What do ntpdate and date show you?

Code: Select all

root@porteus:/home/guest# date
Sat Dec  7 11:44:34 EST 2024
root@porteus:/home/guest# ntpdate
 7 Dec 11:43:49 ntpdate[2805]: no servers can be used, exiting
root@porteus:/home/guest# ntpdate ntp.roa.es
 7 Dec 11:50:21 ntpdate[2959]: step time server 150.214.94.5 offset -1.936387 sec
root@porteus:/home/guest# 
root@porteus:/home/guest# hwclock
2024-12-07 07:08:15.125894-05:00
root@porteus:/home/guest# 
Maybe this Blaze "hack" will interest you. :)
Timezone and RTC timescale cheatcodes does not work (Post by Blaze #65030)

beny
Full of knowledge
Full of knowledge
Posts: 2244
Joined: 02 Jan 2011, 11:33
Location: italy

NetworkManager dispatcher doesn´t run in Porteus?

Post#12 by beny » 07 Dec 2024, 19:03

hi,with porteux i have this: porteux nm-dispatcher: d-bus: failed to request name org.freedesktop.nm_dispatcher: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Connection ":1.68" is not allowed to own the service "org.freedesktop.nm_dispatcher" due to security policies in the configuration file
you can see the /var/log/syslog

Jack
Contributor
Contributor
Posts: 1914
Joined: 09 Aug 2013, 14:25
Distribution: Nemesis Cinnamon 64
Location: USA

NetworkManager dispatcher doesn´t run in Porteus?

Post#13 by Jack » 08 Dec 2024, 01:04

zyrus wrote:
05 Dec 2024, 18:45
Hi guys
I need to run a command when a internet connection is established, and NetworkManager.dispatcher service does nothing.
Is that service implemented in Porteus distro ?
If not, is there any way to achieve this?
Thanks
Sound like you have the same problem as I have. I think Porteus is for new computer and that they cut old thing that old computer need. All of the other distro run or work great for old and new computer. All my computer are at lease 10-12 years old. I still run Windows 7 pro because it run on my old computer. I did try Linux Mint (Mate) that was just release with no problem only problem is all program it has that I don't need or want. Last thing thatt I went back to my old Linux (Slax). That my $0.02 thought about the problem.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4166
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

NetworkManager dispatcher doesn´t run in Porteus?

Post#14 by ncmprhnsbl » 08 Dec 2024, 06:30

zyrus wrote:
07 Dec 2024, 12:32
I execute this command above, and doesn't anything;
can't find that service running
this is normal, it quits after a short timeout, if it has nothing to do... and also quits if it's task takes too long apparently :/ .. (see /usr/libexec/nm-dispatcher --help > there's a "--persist" option that overrides this (and --debug for verbose output))
afaics, in slackware and other non-systemd systems, this should just run when needed via dbus .. ie. if a script is present (and correct) in /etc/NetworkManager/dispatcher.d/
according to the manual: "Each script should be a regular executable file owned by root. Furthermore, it must not be writable by group or other, and not setuid."
ie. chmod 744 /etc/NetworkManager/dispatcher.d/ya_script.sh
as well as being formatted correctly..
https://networkmanager.dev/docs/api/lat ... tcher.html

@beny, that output is from running it as normal user instead of root.
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Post Reply