This combination seems to mount my /firewall-scripts filesystem on both nodes.  
My application stuff is still commented out for right now.   I’ll have to 
change that very soon so I can finish debugging my own stuff.

I had to put back in the sleep 30 in my glustermount.sh (used to be rc.local).  
I know sleeping 30 seconds is ugly and I would **much** rather do it more 
deterministically by making sure it runs in the proper order.  But I’m not so 
sure that “After” line in the .service file really means it.  Or maybe “After” 
means start after those items are started but not necessarily finished. Not 
really sure.  I wish I had a better handle on that.

And then my other systemd issue with all this is, systemd doesn’t seem to 
record all the output of the scripts it runs.  I have a bunch of debug stuff in 
my glustermount.sh script, but when I do systemctl status glustermount.service 
–n 50, it is always missing the last 10 or so lines of output from my script.  
I’ve shown that in a few other posts in this thread.  The debug stuff shows a 
df –h, then the result of mount –av, then another df –h.  systemd consistently 
truncates the output from that second df –h.  So when I use systemd to run that 
script, I never see before and after results.  Frustrating.

[root@chicago-fw1 ~]# more /usr/lib/systemd/system/glustermount.service
# This unit is Greg's attempt to mount my Gluster filesystem.
# Ripped off from rc-local.service
# Must run after glusterd.service

[Unit]
Description=Set up Gluster mounts
ConditionFileIsExecutable=/etc/rc.d/glustermount.sh
After=network.target glusterd.service

[Service]
Type=forking
ExecStart=/etc/rc.d/glustermount.sh
TimeoutSec=0
RemainAfterExit=no
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
[root@chicago-fw1 ~]#
[root@chicago-fw1 ~]#
[root@chicago-fw1 ~]# more /etc/rc.d/glustermount.sh
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
#
# Note removed by default starting in Fedora 16.

touch /var/lock/subsys/local

#***********************************
# Local stuff below

date
echo "Sleeping 30 seconds."
sleep 30
date
echo "Making sure the Gluster stuff is mounted"
echo "Mounted before mount -av"
df -h
mount -av
echo "Mounted after mount -av"
df -h
# The fstab mounts happen early in startup, then Gluster starts up later.
# By now, Gluster should be up and running and the mounts should work.
# That _netdev option is supposed to account for the delay but doesn't seem
# to work right.

echo "Starting up firewall common items"
## /firewall-scripts/etc/rc.d/common-rc.local
[root@chicago-fw1 ~]#

_______________________________________________
Gluster-users mailing list
[email protected]
http://supercolony.gluster.org/mailman/listinfo/gluster-users

Reply via email to