1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'manifests/autostart_instance.pp', line 1
define db2_install::autostart_instance (
Stdlib::Absolutepath $location,
Variant[Boolean, Enum['on_failure']] $logoutput = lookup({ name => 'logoutput', default_value => 'on_failure' }),
) {
# exec { "Enable autostart for DB2 Fault Monitor for instance ${title}":
# command => "${location}/bin/db2fm -i ${title} -f on",
# unless => "ps -eaf | grep 'db2fmd -i ${title}' | grep -v grep",
# path => ['/bin','/usr/bin'],
# }
unless defined('Exec[Enable DB2 Fault monitor autostart]') {
#
# The fixpack installatie sometimes removes the systemd unit.
# This command restores the unit.
#
exec { 'Enable DB2 Fault monitor autostart':
command => "${location}/bin/db2fmcu -u -p ${location}/bin/db2fmcd",
creates => '/etc/systemd/system/db2fmcd.service',
logoutput => $logoutput,
}
}
exec { "Enable autostart for instance ${title}":
command => "${location}/bin/db2iauto -on ${title}",
unless => "${location}/instance/db2iset DB2AUTOSTART -i ${title}",
logoutput => $logoutput,
}
exec { "Start DB2 Fault Monitor for instance ${title}":
command => "${location}/bin/db2fm -i ${title} -U -f on",
unless => "ps -eaf | grep 'db2fmd -i ${title}' | grep -v grep",
path => ['/bin','/usr/bin'],
}
}
|