<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">+1 — This is the best solution.<div class=""><br class=""></div><div class="">The only thing I would change would be to add:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>TimeoutStartSec=300</div><div class=""><br class=""></div><div class="">Or something similar.</div><div class=""><br class=""></div><div class="">This leaves the maintenance of starting applications where it belongs (in systems, not in GPFS). You can use the same technique for other VFS types (like NFS if you needed). You can check for any file on the file system you want, so you could just put a dotfile in the root of each waited-for file system and look for that. You an even chase your symlink if you want (removing the parameter completely).</div><div class=""><br class=""></div><div class="">As a recovering sysadmin, this makes me smile.</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">-- <br class="">Stephen<br class=""><br class=""><br class=""></div>

</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Mar 14, 2019, at 5:36 PM, Trafford, Tyler <<a href="mailto:tyler.trafford@yale.edu" class="">tyler.trafford@yale.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I use the following:<br class=""><br class="">[Unit]<br class="">Description=Foo<br class="">After=gpfs.service<br class=""><br class="">[Service]<br class="">ExecStartPre=/bin/bash -c 'until [ -d /gpfs/%I/apps/services/foo ]; do sleep 20s; done'<br class="">ExecStart=/usr/sbin/runuser -u root /gpfs/%I/apps/services/foo/bin/runme<br class=""><br class="">[Install]<br class="">WantedBy=multi-user.target<br class=""><br class=""><br class="">Then I can drop it on multiple systems (with the same app layout), and run:<br class=""><br class="">systemctl enable foo@fs1<br class="">or<br class="">systemctl enable foo@fs2<br class=""><br class="">The "%I" gets replaced by what is after that "@".<br class=""><br class="">-- <br class="">Tyler Trafford<br class=""><a href="mailto:tyler.trafford@yale.edu" class="">tyler.trafford@yale.edu</a><br class=""><br class="">________________________________________<br class="">From: gpfsug-discuss-bounces@spectrumscale.org <gpfsug-discuss-bounces@spectrumscale.org> on behalf of Stephen R Buchanan <stephen.buchanan@us.ibm.com><br class="">Sent: Thursday, March 14, 2019 3:58 PM<br class="">To: gpfsug-discuss@spectrumscale.org<br class="">Subject: [gpfsug-discuss] Systemd configuration to wait for mount of SS filesystem<br class=""><br class="">I searched the list archives with no obvious results.<br class=""><br class="">I have an application that runs completely from a Spectrum Scale filesystem that I would like to start automatically on boot, obviously after the SS filesystem mounts, on multiple nodes. There are groups of nodes for dev, test, and production, (separate clusters) and the target filesystems are different between them (and are named differently, so the paths are different), but all nodes have an identical soft link from root (/) that points to the environment-specific path. (see below for details)<br class=""><br class="">My first effort before I did any research was to try to simply use a directive of After=gpfs.service which anyone who has tried it will know that the gpfs.service returns as "started" far in advance (and independently of) when filesystems are actually mounted.<br class=""><br class="">What I want is to be able to deploy a systemd service-unit and path-unit pair of files (that are as close to identical as possible across the environments) that wait for /appbin/builds/ to be available (/[dev|tst|prd]01/ to be mounted) and then starts the application. The problem is that systemd.path units, specifically the 'PathExists=' directive, don't follow symbolic links, so I would need to customize the path unit file for each environment with the full (real) path. There are other differences between the environments that I believe I can handle by specifying an EnvironmentFile directive -- but that would come from the SS filesystem so as to be a single reference point, so it can't help with the path unit.<br class=""><br class="">Any suggestions are welcome and appreciated.<br class=""><br class="">dev:(path names have been slightly generalized, but the structure is identical)<br class="">SS filesystem: /dev01<br class="">full path: /dev01/app-bin/user-tree/builds/<br class="">soft link: /appbin/ -> /dev01/app-bin/user-tree/<br class=""><br class="">test:<br class="">SS filesystem: /tst01<br class="">full path: /tst01/app-bin/user-tree/builds/<br class="">soft link: /appbin/ -> /tst01/app-bin/user-tree/<br class=""><br class="">prod:<br class="">SS filesystem: /prd01<br class="">full path: /prd01/app-bin/user-tree/builds/<br class="">soft link: /appbin/ -> /prd01/app-bin/user-tree/<br class=""><br class=""><br class="">Stephen R. Wall Buchanan<br class="">Sr. IT Specialist<br class="">IBM Data & AI North America Government Expert Labs<br class="">+1 (571) 299-4601<br class="">stephen.buchanan@us.ibm.com<br class=""><br class="">_______________________________________________<br class="">gpfsug-discuss mailing list<br class="">gpfsug-discuss at spectrumscale.org<br class="">http://gpfsug.org/mailman/listinfo/gpfsug-discuss<br class=""></div></div></blockquote></div><br class=""></div></body></html>