# Load order for services

**URL:** <https://forums.suse.com/t/load-order-for-services/35168>\
**Category:** SLES Configure-Administer\
**Created:** [July 24, 2020, 1:13pm UTC](https://forums.suse.com/t/load-order-for-services/35168 "2020-07-24T13:13:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 1:13pm UTC](https://forums.suse.com/t/load-order-for-services/35168/1 "2020-07-24T13:13:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [July 24, 2020, 1:18pm UTC](https://forums.suse.com/t/load-order-for-services/35168/2 "2020-07-24T13:18:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 1:26pm UTC](https://forums.suse.com/t/load-order-for-services/35168/3 "2020-07-24T13:26:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [July 24, 2020, 1:37pm UTC](https://forums.suse.com/t/load-order-for-services/35168/4 "2020-07-24T13:37:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 1:39pm UTC](https://forums.suse.com/t/load-order-for-services/35168/5 "2020-07-24T13:39:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 1:49pm UTC](https://forums.suse.com/t/load-order-for-services/35168/6 "2020-07-24T13:49:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 1:51pm UTC](https://forums.suse.com/t/load-order-for-services/35168/7 "2020-07-24T13:51:09Z")

</div>

That did not work

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [July 24, 2020, 3:02pm UTC](https://forums.suse.com/t/load-order-for-services/35168/8 "2020-07-24T15:02:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 3:13pm UTC](https://forums.suse.com/t/load-order-for-services/35168/9 "2020-07-24T15:13:55Z")

</div>

deleted this comment

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 3:16pm UTC](https://forums.suse.com/t/load-order-for-services/35168/10 "2020-07-24T15:16:08Z")

</div>

Not sure why some text went bold and larger

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [July 24, 2020, 3:22pm UTC](https://forums.suse.com/t/load-order-for-services/35168/11 "2020-07-24T15:22:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 3:25pm UTC](https://forums.suse.com/t/load-order-for-services/35168/12 "2020-07-24T15:25:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 3:25pm UTC](https://forums.suse.com/t/load-order-for-services/35168/13 "2020-07-24T15:25:40Z")

</div>

On both files?

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [July 24, 2020, 3:42pm UTC](https://forums.suse.com/t/load-order-for-services/35168/14 "2020-07-24T15:42:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 3:44pm UTC](https://forums.suse.com/t/load-order-for-services/35168/15 "2020-07-24T15:44:53Z")

</div>

Can’t seem to attach those kind of files.

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [July 24, 2020, 3:56pm UTC](https://forums.suse.com/t/load-order-for-services/35168/16 "2020-07-24T15:56:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 3:58pm UTC](https://forums.suse.com/t/load-order-for-services/35168/17 "2020-07-24T15:58:16Z")

</div>

```auto
[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

```

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 4:00pm UTC](https://forums.suse.com/t/load-order-for-services/35168/18 "2020-07-24T16:00:31Z")

</div>

```auto
[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

```

---

<div class="post-metadata">

**Author:** ![warper2](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@warper2](https://forums.suse.com/u/warper2)\
**Post date:** [July 24, 2020, 4:00pm UTC](https://forums.suse.com/t/load-order-for-services/35168/19 "2020-07-24T16:00:46Z")

</div>

I think I understand now 🙂

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [July 24, 2020, 4:32pm UTC](https://forums.suse.com/t/load-order-for-services/35168/20 "2020-07-24T16:32:54Z")

</div>

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?

```auto
systemctl status pacemaker sanlock

```

[Next page](https://forums.suse.com/t/load-order-for-services/35168.md?page=2)
