Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Just the facts, Ma'am" -- Joe Friday


computers / comp.os.linux.misc / DBUS and classic mounts

SubjectAuthor
* DBUS and classic mountsHenning Hucke
`* Re: DBUS and classic mountsThe Natural Philosopher
 `* Re: DBUS and classic mountsDavid W. Hodgins
  `- Re: DBUS and classic mountsHenning Hucke

1
DBUS and classic mounts

<slrnsp77qu.a89.h_hucke+spam.news@sirius.aeon.icebear.cloud>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=6394&group=comp.os.linux.misc#6394

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: h_hucke+...@newsmail.aeon.icebear.org (Henning Hucke)
Newsgroups: comp.os.linux.misc
Subject: DBUS and classic mounts
Date: Tue, 16 Nov 2021 12:09:02 -0000 (UTC)
Organization: aeon: think longer than you thought before
Lines: 26
Message-ID: <slrnsp77qu.a89.h_hucke+spam.news@sirius.aeon.icebear.cloud>
Reply-To: Henning Hucke <h_hucke+news.reply(trick)@newsmail.aeon.icebear.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8-Bit
X-Trace: individual.net hAkDJm01W7AbOwMssXST7g3XjbS75C1g12u1ytx+f2i2dLEJ59
Summary: Looking for a dbus daemon/listener which starts script for
especially filesystem related events like inserting a usb flash drive.
Keywords: Linux, dbus, script
X-Orig-Path: news.aeon.icebear.cloud!news1.aeon.icebear.cloud!.POSTED.sirius.aeon.icebear.cloud!not-for-mail
Cancel-Lock: sha1:y2isPEgERLCXagE4UgfG9wOQ3zM= sha1:taIfY1TrJYfioFWubEFhSen6lWI=
Injection-Date: Tue, 16 Nov 2021 12:09:02 -0000 (UTC)
Injection-Info: sirius.aeon.icebear.cloud; posting-host="sirius.aeon.icebear.cloud:fd09:afca:b044:1::1";
logging-data="14552"; mail-complaints-to="abuse+news@aeon.icebear.cloud"
User-Agent: slrn/1.0.3 (Linux)
 by: Henning Hucke - Tue, 16 Nov 2021 12:09 UTC

Hi everybody,

I'm an admin for round about the last 25 years working with diverse
flavours of unixoid operating systems and especially with linux.

This means that I work mostly on servers, not on workstations infront of
which a user might sit using a desktop environment. Instead there might
only be a person which inserts a usb flash drive into a usb port on
demand with no graphical UI at all runing on this machine.

Despite the fact that the dbus ipc mechanism is not directly related to
desktop environment I wasn't yet able to find a dbus
daemon/service/listener which simply offers the possibility to start a
script stuffed with an appropriate set of environment variables fed with
the arguments of the dbus call to take appropriate actions like mounting
a file system in a suitable place.
A script because for instance we would like to start the backup of
certain filesystem areas if a certain usb external HDD or a certain usb
flash drive is inserted into a usb port - or similar things.

Does somebody know about such a program!?

Best regards
Henning
--
Can't open /usr/fortunes. Lid stuck on cookie jar.

Re: DBUS and classic mounts

<sn0alb$mhr$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=6395&group=comp.os.linux.misc#6395

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: DBUS and classic mounts
Date: Tue, 16 Nov 2021 13:11:07 +0000
Organization: A little, after lunch
Lines: 33
Message-ID: <sn0alb$mhr$1@dont-email.me>
References: <slrnsp77qu.a89.h_hucke+spam.news@sirius.aeon.icebear.cloud>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 16 Nov 2021 13:11:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="43aa92e3579eb4e6747a2bb00b5f4437";
logging-data="23099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19c6t4mWBImcEMBjpUlv8GtmT9Z/vQcHVA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Cancel-Lock: sha1:AzxrSZyvrPHgsMMoKkfGgm83tfQ=
In-Reply-To: <slrnsp77qu.a89.h_hucke+spam.news@sirius.aeon.icebear.cloud>
Content-Language: en-GB
 by: The Natural Philosop - Tue, 16 Nov 2021 13:11 UTC

On 16/11/2021 12:09, Henning Hucke wrote:
> Hi everybody,
>
> I'm an admin for round about the last 25 years working with diverse
> flavours of unixoid operating systems and especially with linux.
>
> This means that I work mostly on servers, not on workstations infront of
> which a user might sit using a desktop environment. Instead there might
> only be a person which
^^^^
I admire the gender neutrality, extended to cover robots and androids..

> inserts a usb flash drive into a usb port on
> demand with no graphical UI at all running on this machine.

Is dbus the best way to achieve that?

ISTR there is another mechanism designed to be triggered on drive
insertion/removal - udev?

https://unix.stackexchange.com/questions/28548/how-to-run-custom-scripts-upon-usb-device-plug-in

might be of interest in that respect.

I last hacked that (udev) ten years ago to get inserting a camera to
'do the right thing' (linux now does it by default). The syntax is
tricky and the interface poorly documented, but the bloody thing does,
in fact, work.

--
In a Time of Universal Deceit, Telling the Truth Is a Revolutionary Act.

- George Orwell

Re: DBUS and classic mounts

<op.1cymmwnha3w0dxdave@hodgins.homeip.net>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=6396&group=comp.os.linux.misc#6396

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dwhodg...@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.os.linux.misc
Subject: Re: DBUS and classic mounts
Date: Tue, 16 Nov 2021 11:55:34 -0500
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <op.1cymmwnha3w0dxdave@hodgins.homeip.net>
References: <slrnsp77qu.a89.h_hucke+spam.news@sirius.aeon.icebear.cloud>
<sn0alb$mhr$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="098d636f34548b12c8306c06a05afda3";
logging-data="24464"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/c4IgPlf9XSsvYSKU/Px3rzXDfckrfs68="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:EnfZ/Lty6J2Kh6fLflVsDbz+aFQ=
 by: David W. Hodgins - Tue, 16 Nov 2021 16:55 UTC

On Tue, 16 Nov 2021 08:11:07 -0500, The Natural Philosopher <tnp@invalid.invalid> wrote:
>> inserts a usb flash drive into a usb port on
>> demand with no graphical UI at all running on this machine.
> Is dbus the best way to achieve that?
> ISTR there is another mechanism designed to be triggered on drive
> insertion/removal - udev?

It is udev, controlled by a rule. For example ...
$ cat /etc/udev/rules.d/00-myusb.rules
# udev rules file for my usb drive
ACTION!="add", GOTO="myusb_rules_end"
SUBSYSTEM!="block", GOTO="myusb_rules_end"
ATTR{partition}=="1", RUN+="/bin/logger -t myusb drive inserted %k"
LABEL="myusb_rules_end"

Just change it to run the desired script instead of logger.

Another example, if you have a specific script to run for a specific usb drive ...
$ cat /etc/udev/rules.d/00-myusb2.rules
# udev rules file for my usb drive
ACTION!="add", GOTO="myusb2_rules_end"
KERNEL=="sd?1", ATTRS{serial}=="070526931096D296" , ACTION=="add", RUN+="/bin/logger -t cryptdrive inserted %k"
LABEL="myusb2_rules_end"

Regards, Dave Hodgins

Re: DBUS and classic mounts

<slrnspcout.obd.h_hucke+spam.news@sirius.aeon.icebear.cloud>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=6413&group=comp.os.linux.misc#6413

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: h_hucke+...@newsmail.aeon.icebear.org (Henning Hucke)
Newsgroups: comp.os.linux.misc
Subject: Re: DBUS and classic mounts
Date: Thu, 18 Nov 2021 14:31:57 -0000 (UTC)
Organization: aeon: think longer than you thought before
Lines: 26
Message-ID: <slrnspcout.obd.h_hucke+spam.news@sirius.aeon.icebear.cloud>
References: <slrnsp77qu.a89.h_hucke+spam.news@sirius.aeon.icebear.cloud>
<sn0alb$mhr$1@dont-email.me> <op.1cymmwnha3w0dxdave@hodgins.homeip.net>
Reply-To: Henning Hucke <h_hucke+news.reply(trick)@newsmail.aeon.icebear.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8-Bit
X-Trace: individual.net M2RPIqOiePPpvxoe1T7LJQX+2GQaOUekDRikgtBLCDeqeGSfsP
X-Orig-Path: news.aeon.icebear.cloud!news1.aeon.icebear.cloud!.POSTED.sirius.aeon.icebear.cloud!not-for-mail
Cancel-Lock: sha1:+K4IC49WS+kmdct6T53exuCZrjI= sha1:BGyXyl927eJ1wa1zq7qSXNrFrXQ=
Injection-Date: Thu, 18 Nov 2021 14:31:57 -0000 (UTC)
Injection-Info: sirius.aeon.icebear.cloud; posting-host="sirius.aeon.icebear.cloud:fd09:afca:b044:1::1";
logging-data="28616"; mail-complaints-to="abuse+news@aeon.icebear.cloud"
User-Agent: slrn/1.0.3 (Linux)
 by: Henning Hucke - Thu, 18 Nov 2021 14:31 UTC

On 2021-11-16, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:

> On Tue, 16 Nov 2021 08:11:07 -0500, The Natural Philosopher
> <tnp@invalid.invalid> wrote:
>>> inserts a usb flash drive into a usb port on
>>> demand with no graphical UI at all running on this machine.
>> Is dbus the best way to achieve that?
>> ISTR there is another mechanism designed to be triggered on drive
>> insertion/removal - udev?
>
> It is udev, controlled by a rule. For example ...

Just googled 'https://networkengineer.me/2015/06/16/conceptual-understanding-of-sysfs-udev-hald-dbus/'.

I *know* that it can be done by udev but I intentionally asked for a
solution with dbus - see above.

Concerning hardware events dbus is fed/triggered by udev indeed. There
are things which make dbus attractive also for the described scenario.

Regards
Henning
--
How many bits would a BitBlit blit if a BitBlit could blit bits?
-- macanespie@waves.pas.ti.com in <1993Nov16.130625.1@waves.pas.ti.com>

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor