Re: [gpfsug-discuss] wait for mount during gpfs startup

2020-04-30 Thread Skylar Thompson
On Thu, Apr 30, 2020 at 12:50:27PM +0200, Ulrich Sibiller wrote:
> Am 28.04.20 um 15:57 schrieb Skylar Thompson:
>  >> Have you looked a the mmaddcallback command and specifically the file 
> system mount callbacks?
> 
>  > We use callbacks successfully to ensure Linux auditd rules are only loaded
>  > after GPFS is mounted. It was easy to setup, and there's very fine-grained
>  > events that you can trigger on:
> 
> Thanks. But how do set this up for a systemd service? Disable the dependent 
> service and start it
> from the callback? Create some kind of state file in the callback and let the 
> dependent systemd
> service check that flag file in a busy loop? Use inotify for the flag file?

In the pre-systemd days, I would say just disable the service and let the
callback handle it. I do see your point, though, that you lose the other
systemd ordering benefits if you start the service from the callback.
Assuming you're still able to start the service via systemctl, I would
probably just leave it disabled and let the callback handle it.

In the case of auditd rules, it's not actually a service (just a command
that needs to be run) so we didn't run into this specific problem.

-- 
-- Skylar Thompson (skyl...@u.washington.edu)
-- Genome Sciences Department, System Administrator
-- Foege Building S046, (206)-685-7354
-- University of Washington School of Medicine
___
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss


Re: [gpfsug-discuss] wait for mount during gpfs startup

2020-04-30 Thread IBM Spectrum Scale
I now better understand the functionality you were aiming to achieve.  You 
want anything in systemd that is dependent on GPFS file systems being 
mounted to block until they are mounted.  Currently we do not offer any 
such feature though as Carl Zetie noted there is an RFE for such 
functionality, RFE 125955 (
https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=125955
).

For the mmaddcallback what I was thinking could resolve your problem was 
for you to create a either a "startup" callback or "mount" callbacks for 
your file systems.  I thought you could use those callbacks to track the 
file systems of interest and then use the appropriate means to integrate 
that information into the flow of systemd.  I have never done this so 
perhaps it is not possible.

Regards, The Spectrum Scale (GPFS) team

--
If you feel that your question can benefit other users of  Spectrum Scale 
(GPFS), then please post it to the public IBM developerWroks Forum at 
https://www.ibm.com/developerworks/community/forums/html/forum?id=----0479
. 

If your query concerns a potential software error in Spectrum Scale (GPFS) 
and you have an IBM software maintenance contract please contact 
1-800-237-5511 in the United States or your local IBM Service Center in 
other countries. 

The forum is informally monitored as time permits and should not be used 
for priority messages to the Spectrum Scale (GPFS) team.



From:   Ulrich Sibiller 
To: gpfsug-discuss@spectrumscale.org
Date:   04/30/2020 06:57 AM
Subject:[EXTERNAL] Re: [gpfsug-discuss] wait for mount during gpfs 
startup
Sent by:gpfsug-discuss-boun...@spectrumscale.org



Am 28.04.20 um 15:57 schrieb Skylar Thompson:
  >> Have you looked a the mmaddcallback command and specifically the file 
system mount callbacks?

  > We use callbacks successfully to ensure Linux auditd rules are only 
loaded
  > after GPFS is mounted. It was easy to setup, and there's very 
fine-grained
  > events that you can trigger on:

Thanks. But how do set this up for a systemd service? Disable the 
dependent service and start it
from the callback? Create some kind of state file in the callback and let 
the dependent systemd
service check that flag file in a busy loop? Use inotify for the flag 
file?

Uli
-- 
Science + Computing AG
Vorstandsvorsitzender/Chairman of the board of management:
Dr. Martin Matzke
Vorstand/Board of Management:
Matthias Schempp, Sabine Hohenstein
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Aufsichtsrat/Supervisory Board:
Martin Wibbe, Ursula Morgenstern
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196
___
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=IbxtjdkPAM2Sbon4Lbbi4w&m=KmkFZ30Ey3pB4QnhsP2vS2mmojVLAWGrIiStGaE0320&s=VHWoLbiq119iFhL724WAQwg4dSJ3KRNVSXnfrFBv9RQ&e=
 






___
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss


Re: [gpfsug-discuss] wait for mount during gpfs startup

2020-04-30 Thread Ulrich Sibiller

Am 28.04.20 um 13:38 schrieb Jonathan Buzzard:

Yuck, and double yuck. There are many things you can say about systemd
(and I have a choice few) but one of them is that it makes this sort of
hackery obsolete. At least that is one of it goals.

A systemd way to do it would be via one or more helper units. So lets
assume your GPFS file system is mounted on /gpfs, then create a file
called ismounted.txt on it and then create a unit called say
gpfs_mounted.target that looks like


# gpfs_mounted.target
[Unit]
TimeoutStartSec=infinity
ConditionPathExists=/gpfs/ismounted.txt
ExecStart=/usr/bin/sleep 10
RemainAfterExit=yes

Then the main unit gets

Wants=gpfs_mounted.target
After=gpfs_mounted.target

If you are using scripts in systemd you are almost certainly doing it
wrong :-)


Yes, that the right direction. But still not the way I'd like it to be. First, I don't really like 
the flag file stuff. Imagine the mess you'd create if multiple services would require flag files...


Second, I am looking for an all_local target. That one cannot be solved using this approach, right? 
(same for all_remote or all)


Uli

--
Science + Computing AG
Vorstandsvorsitzender/Chairman of the board of management:
Dr. Martin Matzke
Vorstand/Board of Management:
Matthias Schempp, Sabine Hohenstein
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Aufsichtsrat/Supervisory Board:
Martin Wibbe, Ursula Morgenstern
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196
___
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss


Re: [gpfsug-discuss] wait for mount during gpfs startup

2020-04-30 Thread Ulrich Sibiller

Am 28.04.20 um 13:55 schrieb Hannappel, Juergen:

a gpfs.mount target should be automatically created at boot by the
systemd-fstab-generator from the fstab entry, so no need with hackery like
ismountet.txt...
A generic gpfs.mount target does not seem to exist on my system. There are only specific mount 
targets for the mounted gpfs filesystems. So I'd need to individually configure each depend service 
on each system with the filesystem for wait for. My approach was more general in just waiting for 
all_local gpfs filesystems. So I can use the same configuration everywhere.


Besides, I have once tested and found that these targets are not usable because of some oddities but 
unfortunately I don't remember details. But the outcome was my script from the initial post. Maybe 
it was that there's no automatic mount target for all_local, same problem as above.


Uli
--
Science + Computing AG
Vorstandsvorsitzender/Chairman of the board of management:
Dr. Martin Matzke
Vorstand/Board of Management:
Matthias Schempp, Sabine Hohenstein
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Aufsichtsrat/Supervisory Board:
Martin Wibbe, Ursula Morgenstern
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196
___
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss


Re: [gpfsug-discuss] wait for mount during gpfs startup

2020-04-30 Thread Ulrich Sibiller

Am 28.04.20 um 15:57 schrieb Skylar Thompson:
 >> Have you looked a the mmaddcallback command and specifically the file 
system mount callbacks?

 > We use callbacks successfully to ensure Linux auditd rules are only loaded
 > after GPFS is mounted. It was easy to setup, and there's very fine-grained
 > events that you can trigger on:

Thanks. But how do set this up for a systemd service? Disable the dependent 
service and start it
from the callback? Create some kind of state file in the callback and let the 
dependent systemd
service check that flag file in a busy loop? Use inotify for the flag file?

Uli
--
Science + Computing AG
Vorstandsvorsitzender/Chairman of the board of management:
Dr. Martin Matzke
Vorstand/Board of Management:
Matthias Schempp, Sabine Hohenstein
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Aufsichtsrat/Supervisory Board:
Martin Wibbe, Ursula Morgenstern
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196
___
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss