Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Apache
: 172.26.7.228 | : 13.59.5.179
Cant Read [ /etc/named.conf ]
5.6.40-24+ubuntu18.04.1+deb.sury.org+1
www-data
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
sbin /
[ HOME SHELL ]
Name
Size
Permission
Action
acpi_available
112
B
-rwxr-xr-x
agetty
55.23
KB
-rwxr-xr-x
apm_available
81
B
-rwxr-xr-x
apparmor_parser
1.41
MB
-rwxr-xr-x
badblocks
26.01
KB
-rwxr-xr-x
blkdeactivate
14.49
KB
-rwxr-xr-x
blkdiscard
26.08
KB
-rwxr-xr-x
blkid
86.11
KB
-rwxr-xr-x
blockdev
38.07
KB
-rwxr-xr-x
bridge
86.16
KB
-rwxr-xr-x
capsh
17.99
KB
-rwxr-xr-x
cfdisk
94.44
KB
-rwxr-xr-x
cgdisk
182.17
KB
-rwxr-xr-x
chcpu
22.07
KB
-rwxr-xr-x
cryptdisks_start
1.11
KB
-rwxr-xr-x
cryptdisks_stop
1.16
KB
-rwxr-xr-x
cryptsetup
86.23
KB
-rwxr-xr-x
cryptsetup-reencrypt
80.96
KB
-rwxr-xr-x
ctrlaltdel
18.07
KB
-rwxr-xr-x
debugfs
217.47
KB
-rwxr-xr-x
depmod
146.18
KB
-rwxr-xr-x
devlink
78.16
KB
-rwxr-xr-x
dhclient
488.42
KB
-rwxr-xr-x
dhclient-script
15.25
KB
-rwxr-xr-x
dmeventd
46.08
KB
-rwxr-xr-x
dmsetup
158.8
KB
-rwxr-xr-x
dmstats
158.8
KB
-rwxr-xr-x
dosfsck
58.08
KB
-rwxr-xr-x
dosfslabel
54.08
KB
-rwxr-xr-x
dumpe2fs
26.08
KB
-rwxr-xr-x
e2fsck
306.72
KB
-rwxr-xr-x
e2image
34.08
KB
-rwxr-xr-x
e2label
102.25
KB
-rwxr-xr-x
e2undo
18.07
KB
-rwxr-xr-x
ebtables
5.99
KB
-rwxr-xr-x
ebtables-restore
9.99
KB
-rwxr-xr-x
ebtables-save
1.63
KB
-rwxr-xr-x
ethtool
338.9
KB
-rwxr-xr-x
fatlabel
54.08
KB
-rwxr-xr-x
fdisk
122.13
KB
-rwxr-xr-x
findfs
10.07
KB
-rwxr-xr-x
fixparts
62.17
KB
-rwxr-xr-x
fsadm
23.5
KB
-rwxr-xr-x
fsck
46.13
KB
-rwxr-xr-x
fsck.cramfs
34.11
KB
-rwxr-xr-x
fsck.ext2
306.72
KB
-rwxr-xr-x
fsck.ext3
306.72
KB
-rwxr-xr-x
fsck.ext4
306.72
KB
-rwxr-xr-x
fsck.fat
58.08
KB
-rwxr-xr-x
fsck.minix
90.1
KB
-rwxr-xr-x
fsck.msdos
58.08
KB
-rwxr-xr-x
fsck.vfat
58.08
KB
-rwxr-xr-x
fsck.xfs
433
B
-rwxr-xr-x
fsfreeze
10.07
KB
-rwxr-xr-x
fstab-decode
5.99
KB
-rwxr-xr-x
fstrim
42.08
KB
-rwxr-xr-x
gdisk
190.17
KB
-rwxr-xr-x
getcap
9.99
KB
-rwxr-xr-x
getpcaps
9.99
KB
-rwxr-xr-x
getty
55.23
KB
-rwxr-xr-x
halt
178.08
KB
-rwxr-xr-x
hdparm
128.18
KB
-rwxr-xr-x
hwclock
58.19
KB
-rwxr-xr-x
ifconfig
77.11
KB
-rwxr-xr-x
init
1.54
MB
-rwxr-xr-x
insmod
146.18
KB
-rwxr-xr-x
installkernel
2.58
KB
-rwxr-xr-x
integritysetup
39.66
KB
-rwxr-xr-x
ip
545.12
KB
-rwxr-xr-x
ip6tables
92.74
KB
-rwxr-xr-x
ip6tables-restore
92.74
KB
-rwxr-xr-x
ip6tables-save
92.74
KB
-rwxr-xr-x
ipmaddr
17.99
KB
-rwxr-xr-x
iptables
92.74
KB
-rwxr-xr-x
iptables-restore
92.74
KB
-rwxr-xr-x
iptables-save
92.74
KB
-rwxr-xr-x
iptunnel
21.99
KB
-rwxr-xr-x
iscsi-iname
9.99
KB
-rwxr-xr-x
iscsi_discovery
5.16
KB
-rwxr-xr-x
iscsiadm
381.95
KB
-rwxr-xr-x
iscsid
398.15
KB
-rwxr-xr-x
iscsistart
354.13
KB
-rwxr-xr-x
isosize
22.08
KB
-rwxr-xr-x
kbdrate
9.99
KB
-rwxr-xr-x
killall5
22.08
KB
-rwxr-xr-x
ldconfig
387
B
-rwxr-xr-x
ldconfig.real
1001.67
KB
-rwxr-xr-x
logsave
10
KB
-rwxr-xr-x
losetup
82.19
KB
-rwxr-xr-x
lsmod
146.18
KB
-rwxr-xr-x
lvchange
2.42
MB
-rwxr-xr-x
lvconvert
2.42
MB
-rwxr-xr-x
lvcreate
2.42
MB
-rwxr-xr-x
lvdisplay
2.42
MB
-rwxr-xr-x
lvextend
2.42
MB
-rwxr-xr-x
lvm
2.42
MB
-rwxr-xr-x
lvmconf
12.55
KB
-rwxr-xr-x
lvmconfig
2.42
MB
-rwxr-xr-x
lvmdiskscan
2.42
MB
-rwxr-xr-x
lvmdump
10.07
KB
-rwxr-xr-x
lvmetad
82.13
KB
-rwxr-xr-x
lvmpolld
70.45
KB
-rwxr-xr-x
lvmsadc
2.42
MB
-rwxr-xr-x
lvmsar
2.42
MB
-rwxr-xr-x
lvreduce
2.42
MB
-rwxr-xr-x
lvremove
2.42
MB
-rwxr-xr-x
lvrename
2.42
MB
-rwxr-xr-x
lvresize
2.42
MB
-rwxr-xr-x
lvs
2.42
MB
-rwxr-xr-x
lvscan
2.42
MB
-rwxr-xr-x
mdadm
577.37
KB
-rwxr-xr-x
mdmon
321.21
KB
-rwxr-xr-x
mii-tool
18.46
KB
-rwxr-xr-x
mkdosfs
34.5
KB
-rwxr-xr-x
mke2fs
126.31
KB
-rwxr-xr-x
mkfs
10.07
KB
-rwxr-xr-x
mkfs.bfs
30.08
KB
-rwxr-xr-x
mkfs.cramfs
34.01
KB
-rwxr-xr-x
mkfs.ext2
126.31
KB
-rwxr-xr-x
mkfs.ext3
126.31
KB
-rwxr-xr-x
mkfs.ext4
126.31
KB
-rwxr-xr-x
mkfs.fat
34.5
KB
-rwxr-xr-x
mkfs.minix
78.09
KB
-rwxr-xr-x
mkfs.msdos
34.5
KB
-rwxr-xr-x
mkfs.ntfs
78.11
KB
-rwxr-xr-x
mkfs.vfat
34.5
KB
-rwxr-xr-x
mkfs.xfs
423.52
KB
-rwxr-xr-x
mkhomedir_helper
18.02
KB
-rwxr-xr-x
mkntfs
78.11
KB
-rwxr-xr-x
mkswap
78.08
KB
-rwxr-xr-x
modinfo
146.18
KB
-rwxr-xr-x
modprobe
146.18
KB
-rwxr-xr-x
mount.fuse
9.99
KB
-rwxr-xr-x
mount.lowntfs-3g
106.67
KB
-rwxr-xr-x
mount.ntfs
142.7
KB
-rwxr-xr-x
mount.ntfs-3g
142.7
KB
-rwxr-xr-x
mount.vmhgfs
42.16
KB
-rwxr-xr-x
nameif
14.14
KB
-rwxr-xr-x
ntfsclone
54.12
KB
-rwxr-xr-x
ntfscp
34.1
KB
-rwxr-xr-x
ntfslabel
26.1
KB
-rwxr-xr-x
ntfsresize
70.12
KB
-rwxr-xr-x
ntfsundelete
50.1
KB
-rwxr-xr-x
on_ac_power
2.16
KB
-rwxr-xr-x
pam_extrausers_chkpwd
34
KB
-rwxr-sr-x
pam_extrausers_update
34
KB
-rwxr-xr-x
pam_tally
10.01
KB
-rwxr-xr-x
pam_tally2
14.01
KB
-rwxr-xr-x
parted
78.09
KB
-rwxr-xr-x
partprobe
10.07
KB
-rwxr-xr-x
pivot_root
10.07
KB
-rwxr-xr-x
plipconfig
10
KB
-rwxr-xr-x
plymouthd
86.25
KB
-rwxr-xr-x
poweroff
178.08
KB
-rwxr-xr-x
pvchange
2.42
MB
-rwxr-xr-x
pvck
2.42
MB
-rwxr-xr-x
pvcreate
2.42
MB
-rwxr-xr-x
pvdisplay
2.42
MB
-rwxr-xr-x
pvmove
2.42
MB
-rwxr-xr-x
pvremove
2.42
MB
-rwxr-xr-x
pvresize
2.42
MB
-rwxr-xr-x
pvs
2.42
MB
-rwxr-xr-x
pvscan
2.42
MB
-rwxr-xr-x
rarp
32.45
KB
-rwxr-xr-x
raw
14.07
KB
-rwxr-xr-x
reboot
178.08
KB
-rwxr-xr-x
resize2fs
58.07
KB
-rwxr-xr-x
rmmod
146.18
KB
-rwxr-xr-x
route
64.3
KB
-rwxr-xr-x
rtacct
40.13
KB
-rwxr-xr-x
rtmon
50
KB
-rwxr-xr-x
runlevel
178.08
KB
-rwxr-xr-x
runuser
42.07
KB
-rwxr-xr-x
setcap
9.99
KB
-rwxr-xr-x
setvtrgb
14.13
KB
-rwxr-xr-x
sfdisk
106.08
KB
-rwxr-xr-x
sgdisk
174.17
KB
-rwxr-xr-x
shadowconfig
885
B
-rwxr-xr-x
shutdown
178.08
KB
-rwxr-xr-x
slattach
40.45
KB
-rwxr-xr-x
start-stop-daemon
35.1
KB
-rwxr-xr-x
sulogin
46.08
KB
-rwxr-xr-x
swaplabel
14.07
KB
-rwxr-xr-x
swapoff
18.07
KB
-rwxr-xr-x
swapon
46.08
KB
-rwxr-xr-x
switch_root
14.07
KB
-rwxr-xr-x
sysctl
22.07
KB
-rwxr-xr-x
tc
453.79
KB
-rwxr-xr-x
telinit
178.08
KB
-rwxr-xr-x
tipc
53.99
KB
-rwxr-xr-x
tune2fs
102.25
KB
-rwxr-xr-x
udevadm
574.4
KB
-rwxr-xr-x
unix_chkpwd
34
KB
-rwxr-sr-x
unix_update
34
KB
-rwxr-xr-x
ureadahead
34.34
KB
-rwxr-xr-x
veritysetup
35.45
KB
-rwxr-xr-x
vgcfgbackup
2.42
MB
-rwxr-xr-x
vgcfgrestore
2.42
MB
-rwxr-xr-x
vgchange
2.42
MB
-rwxr-xr-x
vgck
2.42
MB
-rwxr-xr-x
vgconvert
2.42
MB
-rwxr-xr-x
vgcreate
2.42
MB
-rwxr-xr-x
vgdisplay
2.42
MB
-rwxr-xr-x
vgexport
2.42
MB
-rwxr-xr-x
vgextend
2.42
MB
-rwxr-xr-x
vgimport
2.42
MB
-rwxr-xr-x
vgimportclone
2.42
MB
-rwxr-xr-x
vgmerge
2.42
MB
-rwxr-xr-x
vgmknodes
2.42
MB
-rwxr-xr-x
vgreduce
2.42
MB
-rwxr-xr-x
vgremove
2.42
MB
-rwxr-xr-x
vgrename
2.42
MB
-rwxr-xr-x
vgs
2.42
MB
-rwxr-xr-x
vgscan
2.42
MB
-rwxr-xr-x
vgsplit
2.42
MB
-rwxr-xr-x
wipefs
38.08
KB
-rwxr-xr-x
xfs_repair
631.16
KB
-rwxr-xr-x
xtables-multi
92.74
KB
-rwxr-xr-x
zramctl
90.19
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : lvmconf
#!/bin/bash # # Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. # # This file is part of the lvm2 package. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Edit an lvm.conf file to adjust various properties # # cluster with clvmd and/or locking lib? HANDLE_CLUSTER=0 # cluster without clvmd? HANDLE_HALVM=0 # also enable services appropriately (lvmetad, clvmd)? HANDLE_SERVICES=0 # also enable cmirrord service in addition? HANDLE_MIRROR_SERVICE=0 # also start/start services in addition to enabling/disabling them? START_STOP_SERVICES=0 function usage { echo "Usage: $0 <command>" echo "" echo "Commands:" echo "Enable clvm: --enable-cluster [--lockinglibdir <dir>] [--lockinglib <lib>]" echo "Disable clvm: --disable-cluster" echo "Enable halvm: --enable-halvm" echo "Disable halvm: --disable-halvm" echo "Set locking library: --lockinglibdir <dir> [--lockinglib <lib>]" echo "" echo "Global options:" echo "Config file location: --file <configfile>" echo "Set services: --services [--mirrorservice] [--startstopservices]" echo "" echo "Use the separate command 'lvmconfig' to display configuration information" } function set_default_use_lvmetad_var { eval "$(lvm dumpconfig --type default global/use_lvmetad 2>/dev/null)" if [ "$?" != 0 ]; then USE_LVMETAD=0 else USE_LVMETAD=$use_lvmetad fi } function parse_args { while [ -n "$1" ]; do case "$1" in --enable-cluster) LOCKING_TYPE=3 USE_LVMETAD=0 HANDLE_CLUSTER=1 shift ;; --disable-cluster) LOCKING_TYPE=1 set_default_use_lvmetad_var HANDLE_CLUSTER=1 shift ;; --enable-halvm) LOCKING_TYPE=1 USE_LVMETAD=0 HANDLE_HALVM=1 shift ;; --disable-halvm) LOCKING_TYPE=1 set_default_use_lvmetad_var HANDLE_HALVM=1 shift ;; --lockinglibdir) if [ -n "$2" ]; then LOCKINGLIBDIR=$2 shift 2 else usage exit 1 fi HANDLE_CLUSTER=1 ;; --lockinglib) if [ -n "$2" ]; then LOCKINGLIB=$2 shift 2 else usage exit 1 fi HANDLE_CLUSTER=1 ;; --file) if [ -n "$2" ]; then CONFIGFILE=$2 shift 2 else usage exit 1 fi ;; --services) HANDLE_SERVICES=1 shift ;; --mirrorservice) HANDLE_MIRROR_SERVICE=1 shift ;; --startstopservices) START_STOP_SERVICES=1 shift ;; *) usage exit 1 esac done if [ -n "$LOCKINGLIBDIR" ] || [ -n "$LOCKINGLIB" ]; then LOCKING_TYPE=2 USE_LVMETAD=0 fi } function validate_args { [ -z "$CONFIGFILE" ] && CONFIGFILE="/etc/lvm/lvm.conf" if [ ! -f "$CONFIGFILE" ] then echo "$CONFIGFILE does not exist" exit 10 fi if [ "$HANDLE_CLUSTER" = 1 ] && [ "$HANDLE_HALVM" = 1 ]; then echo "Either HA LVM or cluster method may be used at one time" exit 18 fi if [ "$HANDLE_SERVICES" = 0 ]; then if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then echo "--mirrorservice may be used only with --services" exit 19 fi if [ "$START_STOP_SERVICES" = 1 ]; then echo "--startstopservices may be used only with --services" exit 19 fi fi if [ -z "$LOCKING_TYPE" ] && [ -z "$LOCKINGLIBDIR" ]; then usage exit 1 fi if [ -n "$LOCKINGLIBDIR" ]; then if [ "${LOCKINGLIBDIR:0:1}" != "/" ] then echo "Prefix must be an absolute path name (starting with a /)" exit 12 fi if [ -n "$LOCKINGLIB" ] && [ ! -f "$LOCKINGLIBDIR/$LOCKINGLIB" ] then echo "$LOCKINGLIBDIR/$LOCKINGLIB does not exist, did you do a \"make install\" ?" exit 11 fi fi if [ "$LOCKING_TYPE" = 1 ] ; then if [ -n "$LOCKINGLIBDIR" ] || [ -n "$LOCKINGLIB" ]; then echo "Superfluous locking lib parameter, ignoring" fi fi } umask 0077 parse_args "$@" validate_args SCRIPTFILE=/etc/lvm/.lvmconf-script.tmp TMPFILE=/etc/lvm/.lvmconf-tmp.tmp # Flags so we know which parts of the file we can replace and which need # adding. These are return codes from grep, so zero means it IS present! have_type=1 have_dir=1 have_library=1 have_use_lvmetad=1 have_global=1 grep -q '^[[:blank:]]*locking_type[[:blank:]]*=' "$CONFIGFILE" have_type=$? grep -q '^[[:blank:]]*library_dir[[:blank:]]*=' "$CONFIGFILE" have_dir=$? grep -q '^[[:blank:]]*locking_library[[:blank:]]*=' "$CONFIGFILE" have_library=$? grep -q '^[[:blank:]]*use_lvmetad[[:blank:]]*=' "$CONFIGFILE" have_use_lvmetad=$? # Those options are in section "global {" so we must have one if any are present. if [ "$have_type" = 0 ] || [ "$have_dir" = 0 ] || [ "$have_library" = 0 ] || [ "$have_use_lvmetad" = 0 ] then # See if we can find it... grep -q '^[[:blank:]]*global[[:blank:]]*{' $CONFIGFILE have_global=$? if [ "$have_global" = 1 ] then echo "global keys but no 'global {' found, can't edit file" exit 13 fi fi if [ "$LOCKING_TYPE" = 2 ] && [ -z "$LOCKINGLIBDIR" ] && [ "$have_dir" = 1 ]; then echo "no library_dir specified in $CONFIGFILE" exit 16 fi # So if we don't have "global {" we need to create one and # populate it if [ "$have_global" = 1 ] then if [ -z "$LOCKING_TYPE" ]; then LOCKING_TYPE=1 fi if [ "$LOCKING_TYPE" = 3 ] || [ "$LOCKING_TYPE" = 2 ]; then cat "$CONFIGFILE" - <<EOF > "$TMPFILE" global { # Enable locking for cluster LVM locking_type = $LOCKING_TYPE library_dir = "$LOCKINGLIBDIR" # Disable lvmetad in cluster use_lvmetad = 0 EOF if [ $? != 0 ] then echo "failed to create temporary config file, $CONFIGFILE not updated" exit 14 fi if [ -n "$LOCKINGLIB" ]; then cat - <<EOF >> "$TMPFILE" locking_library = "$LOCKINGLIB" EOF if [ $? != 0 ] then echo "failed to create temporary config file, $CONFIGFILE not updated" exit 16 fi fi cat - <<EOF >> "$TMPFILE" } EOF fi # if we aren't setting cluster locking, we don't need to create a global section if [ $? != 0 ] then echo "failed to create temporary config file, $CONFIGFILE not updated" exit 17 fi else # # We have a "global {" section, so add or replace the # locking entries as appropriate # if [ -n "$LOCKING_TYPE" ]; then if [ "$have_type" = 0 ] then SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g" else SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE" fi fi if [ -n "$LOCKINGLIBDIR" ]; then if [ "$have_dir" = 0 ] then SEDCMD="${SEDCMD}\ns'^[[:blank:]]*library_dir[[:blank:]]*=.*'\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"'g" else SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"" fi fi if [ -n "$LOCKINGLIB" ]; then if [ "$have_library" = 0 ] then SEDCMD="${SEDCMD}\ns/^[[:blank:]]*locking_library[[:blank:]]*=.*/\ \ \ \ locking_library = \"$LOCKINGLIB\"/g" else SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ locking_library = \"$LOCKINGLIB\"" fi fi if [ "$have_use_lvmetad" = 0 ] then SEDCMD="${SEDCMD}\ns'^[[:blank:]]*use_lvmetad[[:blank:]]*=.*'\ \ \ \ use_lvmetad = $USE_LVMETAD'g" else SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ use_lvmetad = $USE_LVMETAD" fi echo -e "$SEDCMD" > "$SCRIPTFILE" sed <"$CONFIGFILE" >"$TMPFILE" -f "$SCRIPTFILE" if [ $? != 0 ] then echo "sed failed, $CONFIGFILE not updated" exit 15 fi fi # Now we have a suitably editted config file in a temp place, # backup the original and copy our new one into place. cp "$CONFIGFILE" "$CONFIGFILE.lvmconfold" if [ $? != 0 ] then echo "failed to backup old config file, $CONFIGFILE not updated" exit 2 fi cp "$TMPFILE" "$CONFIGFILE" if [ $? != 0 ] then echo "failed to copy new config file into place, check $CONFIGFILE is still OK" exit 3 fi rm -f "$SCRIPTFILE" "$TMPFILE" function set_service { local type=$1 local action=$2 shift 2 if [ "$type" = "systemd" ]; then if [ "$action" = "activate" ]; then for i in "$@"; do unset LoadState eval "$($SYSTEMCTL_BIN show "$i" -p LoadState 2>/dev/null)" test "$LoadState" = "loaded" || continue $SYSTEMCTL_BIN enable "$i" if [ "$START_STOP_SERVICES" = 1 ]; then $SYSTEMCTL_BIN start "$i" fi done elif [ "$action" = "deactivate" ]; then for i in "$@"; do unset LoadState eval "$($SYSTEMCTL_BIN show "$i" -p LoadState 2>/dev/null)" test "$LoadState" = "loaded" || continue "$SYSTEMCTL_BIN" disable "$i" if [ "$START_STOP_SERVICES" = 1 ]; then "$SYSTEMCTL_BIN" stop "$i" fi done fi elif [ "$type" = "sysv" ]; then if [ "$action" = "activate" ]; then for i in "$@"; do "$CHKCONFIG_BIN" --list "$i" > /dev/null || continue "$CHKCONFIG_BIN" "$i" on if [ "$START_STOP_SERVICES" = 1 ]; then "$SERVICE_BIN" "$i" start fi done elif [ "$action" = "deactivate" ]; then for i in "$@"; do "$CHKCONFIG_BIN" --list "$i" > /dev/null || continue if [ "$START_STOP_SERVICES" = 1 ]; then "$SERVICE_BIN" "$i" stop fi "$CHKCONFIG_BIN" "$i" off done fi fi } # Start/stop and enable/disable services if needed. if [ "$HANDLE_SERVICES" = 1 ]; then SYSTEMCTL_BIN=$(which systemctl 2>/dev/null) CHKCONFIG_BIN=$(which chkconfig 2>/dev/null) SERVICE_BIN=$(which service 2>/dev/null) # Systemd services if [ -n "$SYSTEMCTL_BIN" ]; then if [ "$USE_LVMETAD" = 0 ]; then set_service systemd deactivate lvm2-lvmetad.service lvm2-lvmetad.socket else set_service systemd activate lvm2-lvmetad.socket fi if [ "$LOCKING_TYPE" = 3 ]; then set_service systemd activate lvm2-cluster-activation.service if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service activate lvm2-cmirrord.service fi else set_service systemd deactivate lvm2-cluster-activation.service if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service systemd deactivate lvm2-cmirrord.service fi fi # System V init scripts elif [ -n "$SERVICE_BIN" ] && [ -n "$CHKCONFIG_BIN" ]; then if [ "$USE_LVMETAD" = 0 ]; then set_service sysv deactivate lvm2-lvmetad else set_service sysv activate lvm2-lvmetad fi if [ "$LOCKING_TYPE" = 3 ]; then set_service sysv activate clvmd if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service sysv activate cmirrord fi else set_service sysv deactivate clvmd if [ "$HANDLE_MIRROR_SERVICE" = 1 ]; then set_service sysv deactivate cmirrord fi fi # None of the service tools found, error out else echo "Missing tools to handle services" exit 20 fi fi
Close