Load order for services

I am so close to getting this finished. This will be a high availability setup with Sles 12 SP5 and HA on top. Will be using it to manage virtual machines. Will use sanlock for disk locking to keep the machines from booting on 2 machine at once. I have 1 snag left that trying to figure out. Sanlock is required. The issue becomes that I have to have sanlock start after pacemaker. Otherwise pacemaker does not start and no cluster and no vm’s. I have googled this but still get confused. Yes coming from Sles 11 which personally I liked batter for Xen virtual environment with built in disk locking. Any recommendations would be greatly appreciated.

Hi
Assuming your using systemd services, then you would ensure sanlock service has an After=pacemaker.target entry. If you take this route ensure you copy the service file to /etc/system/systemd directory so it doesn’t get over written in an update.

Call me a dummy. But I am confused on what you are saying to do.

Hi
So how are the pacemaker and sanlock services started on boot?

Yes currently the are set in services mgr though last to start on boot. But pacemaker is loading after sanlock so does not come up since sanlock needs to be after.

Ok trying this.
Created a folder /etc/systemd/system/sanlock.service.requires
did a symlink in the folder “ln -s /usr/lib/systemd/system/pacemaker.service pacemaker.service”
rebooting to see if that is what need.

That did not work

Hi
Not that way, can you show the files sanlock.service and pacemaker.service?

deleted this comment

Not sure why some text went bold and larger

Hi
Can you edit and add Markdown three \ at beginning and three \\ at the end of your code output?

So Markdown at beginning of the file and Markdown three at the end of the file. Making sure I understand. Then reboot after?

On both files?

Hi
No I meant in your post that is affected by big fonts :wink: If not able to, can your repost the service files.

Can’t seem to attach those kind of files.

Hi
No it’s three of these \ as in \\\\\

[Unit]
Description=Pacemaker High Availability Cluster Manager
Documentation=man:pacemakerd
Documentation=https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/1.1/html-single/Pacemaker_Explained/index.html

# DefaultDependencies takes care of sysinit.target,
# basic.target, and shutdown.target

# We need networking to bind to a network address. It is recommended not to
# use Wants or Requires with network.target, and not to use
# network-online.target for server daemons.
After=network.target

# Time syncs can make the clock jump backward, which messes with logging
# and failure timestamps, so wait until it's done.
After=time-sync.target

# Managing systemd resources requires DBus.
After=dbus.service
Wants=dbus.service

# Some OCF resources may have dependencies that aren't managed by the cluster;
# these must be started before Pacemaker and stopped after it. The
# resource-agents package provides this target, which lets system adminstrators
# add drop-ins for those dependencies.
After=resource-agents-deps.target
Wants=resource-agents-deps.target

After=syslog.service
After=rsyslog.service
After=corosync.service
Requires=corosync.service


[Install]
WantedBy=multi-user.target


[Service]
Type=simple
KillMode=process
NotifyAccess=main
EnvironmentFile=-/etc/sysconfig/pacemaker
EnvironmentFile=-/etc/sysconfig/sbd
SuccessExitStatus=100

ExecStart=/usr/sbin/pacemakerd -f

# Systemd v227 and above can limit the number of processes spawned by a
# service. That is a bad idea for an HA cluster resource manager, so disable it
# by default. The administrator can create a local override if they really want
# a limit. If your systemd version does not support TasksMax, and you want to
# get rid of the resulting log warnings, comment out this option.
TasksMax=infinity

# If pacemakerd doesn't stop, it's probably waiting on a cluster
# resource.  Sending -KILL will just get the node fenced
SendSIGKILL=no

# If we ever hit the StartLimitInterval/StartLimitBurst limit and the
# admin wants to stop the cluster while pacemakerd is not running, it
# might be a good idea to enable the ExecStopPost directive below.
#
# Although the node will likely end up being fenced as a result so it's
# not on by default
#
# ExecStopPost=/usr/bin/killall -TERM crmd attrd stonithd cib pengine lrmd

# If you want Corosync to stop whenever Pacemaker is stopped,
# uncomment the next line too:
#
# ExecStopPost=/bin/sh -c 'pidof crmd || killall -TERM corosync'

# Uncomment this for older versions of systemd that didn't support
# TimeoutStopSec
# TimeoutSec=30min

# Pacemaker can only exit after all managed services have shut down
# A HA database could conceivably take even longer than this 
TimeoutStopSec=30min
TimeoutStartSec=60s

# Restart options include: no, on-success, on-failure, on-abort or always
Restart=on-failure

# crm_perror() writes directly to stderr, so ignore it here
# to avoid double-logging with the wrong format
StandardError=null
[Unit]
Description=Shared Storage Lease Manager
After=syslog.target pacemaker.service
Wants=wdmd.service pacemaker.service

[Service]
Type=forking
ControlGroup=cpu:/
EnvironmentFile=-/etc/sysconfig/sanlock
ExecStart=/usr/sbin/sanlock daemon $SANLOCKOPTS
ExecStop=/bin/kill -TERM $MAINPID
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

I think I understand now :slight_smile:

Hi
So in the sanlock systemd service, it does contain pacemaker.service, or is that what you added?
Can you show the status of the services?

systemctl status pacemaker sanlock